Wednesday, 22 July 2015

DHCP and NUCs

I've put together a little test network at home for doing some Ironic testing on hardware using NUCs.  So far it's going quite well, although one problem that had me stumped for a while was getting the NUC to behave itself when obtaining an IP address with DHCP.

Each time I booted the network, a different IP address from the pool was being allocated (i.e. the next one in the DHCP address pool).

There's already a documented problem with isc-dhcp-server for devices where the BMC and host share a NIC (including the same MAC address), but this was even worse because on closer examination a different Client UID is being presented as part of the DHCPDISCOVER for the node each time. (Fortunately the NUC's BMC doesn't do this as well).

So I couldn't really find a solution online, but the answer was there all the time in the man page - there's a cute little option "ignore-client-uids true;" that ensures only the MAC address is used for DHCP lease matching, and not Client UID.  Turning this on means now that on each deploy the NUC receives the same IP address - and not just for the node, but also for the BMC - it works around the aforementioned bug as well.  Woohoo!

There's still one remaining problem, I can't seem to get a fixed IP address returned in the DHCPOFFER, I have to configure a dynamic pool instead (which is fine because this is a test network with limited nodes in it).  One to resolve another day...

1 comment:

  1. So just for posterity, today I resolved the fixed dhcp issue. It was PEBKAC, but just in case others have trouble working it out, here's what the setup that works for me on Ubuntu 14.04:

    # /etc/dhcp/dhcpd.conf
    allow duplicates;
    ignore-client-uids true;
    authoritative;

    subnet 192.168.1.0 netmask 255.255.255.0 {
    option routers 192.168.1.36; # This computer's IP address
    option broadcast-address 192.168.1.255;

    group {
    host nuc1 {
    hardware ethernet xx:xx:xx:xx:xx:xx;
    fixed-address 192.168.1.251; # Desired fixed IP address
    allow booting;
    allow bootp;
    next-server 192.168.1.36; # The IP address of this box, where tftp is
    filename "pxelinux.0";
    }
    }
    }

    ReplyDelete