5

I am trying to get my DHCP server (isc-dhcpd-4.1.1-P1) in CentOS to give the same IP and hostname to two different MAC addresses (LAN and WLAN) on the same computer depending on which is connected..

This is my entry in dhcpd.conf

host hostname.my.domain {
        option host-name hostname;
        hardware ethernet xx:xx:xx:xx:xx:xx;
        fixed-address 10.0.1.134;
}

I've tried adding a second hardware line and adding the second MAC to the first hardware line. Neither worked. Does anyone have an idea how I can accomplish this task while using the same hostname and IP in DHCPd?

EDIT: My users bring their laptops into work. I want to make sure, whether they use our Wireless or LAN to connect to the network that their device gets the same IP address. I want to do this because I'm running out of IP addresses on my current internal ClassC.

8
host hostname-primary.my.domain {
    option host-name hostname;
    hardware ethernet xx:xx:xx:xx:xx:xx;
    fixed-address 10.0.1.134;
}
host hostname-secondary.my.domain {
    option host-name hostname;
    hardware ethernet yy:yy:yy:yy:yy:yy;
    fixed-address 10.0.1.134;
}

Just for the record... You are opening yourself for an IP address conflict, but I am sure you have a very valid reason for doing something like this.

  • My users bring their laptops into work. I want to make sure, whether they use our Wireless or LAN to connect to the network that their device gets the same IP address. I want to do this because I'm running out of IP addresses on my current internal ClassC. (I also added this to the text of the post) – Albion Feb 27 '14 at 17:15
  • If users enable their wireless and plug in you could have a problem. Ensure DHCP does the ping-before-offer thing. And I would begin formulating a plan to move to a larger subnet soon. Migrating to a larger subnet is a cleaner solution. – Daniel Widrick Feb 27 '14 at 17:19
  • I use this in for a PXE network with clonezilla, so i can restore systems back. Each IP have one special image to restore and i can group on the same ip the workstations and laptops of each department or role. As only 3 people can do this, the ip collision is very rare and with little importance – higuita Oct 21 '14 at 11:38
  • Giving the same IP address to two interfaces on the same host works without problems. You only have a problem if two different hosts get the same address. – Matthias Urlichs Feb 12 '15 at 18:10
  • Just as a follow up. Giving a duplicate IP out on a wired and on a wireless interface will surely cause some interesting problems in the network eventually. Especially when ARP shows up and the device in question starts responding to other nodes on a hardware address that isn't in the arp table. Your layer 3 - layer 4 translations will be a right mess. – Daniel Widrick Jun 6 '17 at 3:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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