Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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
Thanks, spent ages trying to figure out how to do this. For my purposes, installing Apache2 and rewrite rules would have been much faster, but I didn't want to install another server when the tools already existed! – Auspex May 4 '15 at 17:51

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
That might have been true once upon a time, but is certainly not true now, and jbbuckley's response suggests it wasn't even true when the question was asked. – Auspex May 4 '15 at 17:46

Your Answer


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.