1

Ubuntu Server 16.04 with isc-dhcp-server.

Within the /etc/dhcp/dhcpd.conf configuration I have stated a reserved address for a host provisioned with dhcp this way:

host laptop { hardware ethernet aa:bb:cc:dd:ee:ff; fixed-address 192.168.0.11;}

Now imagine that the above mentioned "laptop" host has also a wifi interface or a second ethernet nic, here comes my question...

Instead of create a second reservation with a different hostname. Is it possible to add a second "hardware ethernet" option sharing the same hostname with a different address?

I have tried several ways in the config and throws an error, I have searched the man for dhcpd.conf and saw no light. Apparently one can declare a second fixed-address but in a different segment, and my intention is to declare the very same hostname but with a different address.

For example I have tried this, without luck:

host laptop { hardware ethernet aa:bb:cc:dd:ee:ff; fixed-address 192.168.0.11; hardware ethernet a0:b1:c2:d3:e4:f5; fixed-address 192.168.0.12;}

Thanks in advance!

1 Answers1

1

You can do something like the following (at least it worked for me) to assign the same hostname to two MAC Addresses:

host wifi.hostname {              
    option host-name hostname;             
    hardware ethernet xx:xx:xx:xx:xx:00;     
    fixed-address 192.168.0.11;                 
}                                            

host eth.hostname {               
    option host-name hostname;             
    hardware ethernet xx:xx:xx:xx:xx:01;     
    fixed-address 192.168.0.12;                 
}

Just make sure to not connect both NICs at the same time, that may produce unexpected results.

Tim Schumacher
  • 556
  • 3
  • 12
  • Perhaps better to set the option "option host-name" to wifi.hostname and eth.hostname instead of just hostname. It's difficult to prevent users from connect more than one NIC, specially in laptops with wifi. – dienteperro Aug 01 '18 at 22:46