Assign fixed-address using dhcp-client-identifier
dhcp1 at thehobsons.co.uk
Tue Mar 11 07:43:37 UTC 2008
>Is there a method to intelligently assign a 'fixed-address' based on
>a client's 'dhcp-client-identifier'?
>But if I try similar assignment with fixed-address....
> fixed-address = 10.100.20.(substring(option dhcp-client-identifier,2,1));
>...I get the following error....
> /etc/dhcpd.conf line 260: = (61): expecting IP address or hostname
> fixed-address =
> Configuration file errors encountered -- exiting
So, you want the last byte of hte address to match the second byte of
the client-id ?
At present there is NO easy way to do this. I can think of two
methods that might fit the bill depending on what you are trying to
achieve (depends on what the client-ids look like).
One that I think will work now would be reserved leases - IF you know
in advance what the client-ids will be. You could knock up a quick
script to generate skeleton leases to match clients to addresses and
add the reserved option. Stop the server, add these leases to the
leases file, start the server - then whenever one of these clients
connects, the server will see that it already has a lease and will
offer it. Because the leases are marked reserved, they will never be
allocated to another client.
Another method would be to create a class & pool for every client -
check back in the archives and you'll find examples of how to do
this, look for option-82. With this method you could use anything as
One thing I'll mention though, have you considered the possibility of
an ID clash ? Or is the second byte of the client-id guaranteed to be
More information about the dhcp-users