How can I configure a DHCP server to assign addresses based on the OS that is running Solved maybe!

Marc Chamberlin marc at marcchamberlin.com
Sun Jan 16 18:10:19 UTC 2011


On 1/16/2011 4:27 AM, Glenn Satchell wrote:
> Perhaps forcing the client to release the IP when shutting down might 
> work for you? I am not sure wha happens if you suspend, or just pickup 
> the laptop and move it while running.
Thanks Glenn for the idea of running a script or configuring the DHCP 
client on each laptop to release its lease when it shuts down. Deploying 
this approach to each laptop is, as always, a bit of a headache, but 
doable. As for those who simply suspend the laptop, or move it while 
running, a reboot will fix the IP assignment and guess we will just have 
to live with that. Not a perfect answer, but what is? LOL

It will sure beat the approach I have been taking, when I get a 
complaint, which is to stop the dhcpd server,  hand edit the leases 
database file and remove the particular lease from it, then restart the 
dhcpd server!
>
>
> A few other minor notes about your posted dhcpd.conf:
>
> This will never match, the substring is 11 chars long, but you're 
> testing for equality with a 16 char string. Cut and paste error in the 
> email perhaps? The 11 should be replaced by the length of the string, 
> 16 in this example.
>
>   substring(option dhcp-client-identifier,1,11) = "marcslaptopLinux"
Oops! More of a hasty edit/touch up error on my part, trying to make it 
clear what I am doing. My laptop, under Linux, actually identifies 
itself simply as "marcslaptop"
>
> And this might be a little pedantic, but you can re-write this:
>
>   (ucase(binary-to-ascii(16, 8, ":", substring (hardware, 1, 6))) = 
> ucase("0:1a:73:55:7d:f")
>
> in a much simpler form:
>
>   ((substring (hardware, 1, 6)) = 0:1a:73:55:7d:f )
>
> Admittedly, with the processing capability of today's CPUs it probably 
> won't make that much difference.
>
> You can directly compare with a hex digit string. See this section of 
> the dhcp-eval man page:
>
> $ man dhcp-eval
> ...
>      colon-separated hexadecimal list
>
>        A list of hexadecimal octet values, separated  by  colons,
>        may be specified as a data expression.
Awww.... Guess I missed this when I did the configuration! Always happy 
to simplify my life! Thanks for the tip!

     Marc...

>
> regards,
> -glenn




More information about the dhcp-users mailing list