Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to assign multiple IP addresses via DHCP on the same interface. Does the DHCP protocol and DHCP servers allowing this?

share|improve this question
    
why what would the purpose be? –  tony roth Sep 22 '11 at 4:47
    
To have multiple IPs? If you have an SSL service and you do not want to share the certificates and the service is run on the same port and it is not supporting TLS. Why DHCP? To be able to manage the IPs used by VMs in one place. –  Mircea Vutcovici Sep 23 '11 at 15:19
    
A workaround would be to get the IP from DHCP, then use a configuration engine to set the all IPs statically, but without saving the configuration. In this way the VMs do not have a IP assigned, they do not need a proprietary DHCP server/client and they can use multiple IPs. I wondering how this will scale for different OSes... –  Mircea Vutcovici Sep 23 '11 at 15:23

2 Answers 2

up vote 1 down vote accepted

If the DHCP Client IDs are set to different values then you should be able to statically allocate different addresses. I say "should" because it's rarely done and support is sparse.

Your use case is at least partly accounted for by the spec (RFC-2131) in that a server must use the Client ID for identification if one was provided by the client.

You might try dnsmasq. According to the dnsmasq FAQ (about halfway down), it treats duplicate MAC addresses with differing Client IDs as different devices.

On the client, you can set the Client ID with dhclient's ``-I [Client-ID]'' flag.

share|improve this answer
    
+ For a Linux machine this is an good workaround. –  Mircea Vutcovici Sep 22 '11 at 13:50

No, DHCP only provides mechanisms for assigning a single IP to any one MAC address.

share|improve this answer
    
I know that there are options to set the routing table and I was wondering if I can not add secondary IPs too. –  Mircea Vutcovici Sep 22 '11 at 1:20
    
No, there are no options that I know of to specify secondary IP addresses. –  EEAA Sep 22 '11 at 1:24
    
Well DHCP is extensible. One could modify the DHCP client, and add custom classes on the server. Many DHCP clients have an API. –  Zoredache Sep 22 '11 at 5:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.