I have a handful of devices which are normally in separate networks (or perhaps not even connected to a network), and they use DHCP to get their IP addresses. Now I would like to run some script on each of them, eg. to update their firmware.
I want to connect them one at a time to my PC and run an update script, for which I need the device's IP address. One attractive solution would be for my script to always use the same IP and to configure my DHCP server to just offer the same IP address to every DHCPDISCOVER request it gets.
In pseudo dhcpd.conf, I want to say this:
host device-to-update {
hardware ethernet *;
fixed-address 192.168.1.100;
}
I've played around with classes a bit, but I haven't found a way to use them with fixed-address. The man page ominously says:
Please be aware that only the dhcp-client-identifier option and the hardware address can be used to match a host declaration
... so I suspect it might not be possible. Currently my workaround is to manage a pool of 1 address with a short lease time, which works OK, but has other drawbacks.
This is on Ubuntu 14.4 with isc-dhcp-server.