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

(Similar to this question, but with two different DHCP-assigned IPs)

Is there any way to let dhclient or dhcpcd request two different IPs for one physical interface, e.g. via virtual interfaces eth0 and eth0:1? Maybe by letting eth0:1 have a different MAC? Or by creating a virtual eth1 bridged to eth0? Or can I use ip addr add directly somehow?

share|improve this question
related:… – Tobias Kienzler Nov 8 '13 at 9:23

If eth0:1 has a different MAC, dhcpd should provide a second address automatically, unless it is on a different VLAN.

share|improve this answer
Do I actually have to use a virtual interface or can ip associate a second IP with a different MAC automatically? – Tobias Kienzler Nov 8 '13 at 10:01
You could have the same MAC address on a second interface, but you would probably have to add the ip manually or via the system configuration files. If you're asking if a single interface can have multiple MAC addresses, no, that's why there are interfaces like eth0:1, eth0:2, etc.. – NickW Nov 8 '13 at 10:29
That makes sense, thanks. Turns out my kernel doesn't currently support virtual interfaces (ifconfig eth0:1 up yields SIOCSIFFLAGS: Cannot assign requested address, and ip link add link eth0 mac0 type macvlan a RTNETLINK answers: Operation not supported) so I have to fix that first... – Tobias Kienzler Nov 8 '13 at 10:39
You did create the corresponding files for eth0:1 /etc/sysconfig/network-scripts/ifcfg-eth0:1 and made sure the Device name at the top is eth0:1 ? This of course the RH model, Debian systems use a different one.. – NickW Nov 8 '13 at 10:43
Not unless you specify the values it needs.. try ifconfig eth0:1 <ip> netmask <mask> , up calls the ifcfg-eth0:1 script. – NickW Nov 8 '13 at 10:52

No. The virtual interface is still the same underlying physical interface, and the MAC address is part of the physical interface, not the virtual interface.

You need to make one of the addresses static.

share|improve this answer
I am very certain that this is either wrong or we misunderstand one another - a virtual machine can easily obtain its own IP via (a bridge and) DHCP – Tobias Kienzler Nov 8 '13 at 10:16
So, if I type ifconfig eth0:2 down ifconfig eth0:2 ifconfig hw ether 11:22:33:44:55:66 then ifconfig eth0:2 up I wouldn't actually be changing the address? – NickW Nov 8 '13 at 10:27
@NickW Unless something has changed since the last time I tried this, then that is correct. Your commands don't work for me on CentOS 6 (ifconfig eth0:1 hw ether 11:22:33:44:55:66 == SIOCSIFHWADDR: Device or resource busy). I am happy to be corrected if this has been changed in recent kernels. – fukawi2 Nov 8 '13 at 22:00
@TobiasKienzler My understanding is that we're talking about Virtual NIC's (ie, eth0:1), not Virtual Machines (eg, KVM, Xen etc) – fukawi2 Nov 8 '13 at 22:01
Hm, now when I re-read my question I realize I have indeed unnecessarily narrowed it, I broadened it a bit now - from what I read so far (but could not test due to a lack of supporting Kernel) at the very least iproute2's macvlan should allow assigning multiple MACs to one physical interface – Tobias Kienzler Nov 11 '13 at 8:49

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.