Different Option 43 strings based on Subnet

Glenn Satchell Glenn.Satchell at uniq.com.au
Wed Dec 9 03:28:36 UTC 2009


>To: Users of ISC DHCP <dhcp-users at lists.isc.org>
>Subject: Re: Different Option 43 strings based on Subnet 
>Content-ID: <795.1260285034.1 at dc.cis.okstate.edu>
>Date: Tue, 08 Dec 2009 09:10:34 -0600
>From: Martin McCormick <martin at dc.cis.okstate.edu>
>X-BeenThere: dhcp-users at lists.isc.org
>
>After re-reading dhcp-eval's man page, I have the confusion down
>to a smaller scope. dhcp-eval describes if-else constructs that
>sound like just what we need since the class statement first
>identifies a given access point by type and presently gives that
>AP the correct string. All we are doing is adding one more
>decision which says if you come from 10.193.4.0/25, you get this
>string. If you come from 10.193.20.0, you get a 
>different string.
>
>	Is there an expression that asks the question, "What
>network is he part of?

you can use leased-address to get the allocated IP address, then you
could use substring to get the first three bytes (if it was /24 for
example), eg:

if substring ( leased-address, 1, 3 ) = 0a:0a:0a 

where the substring but is in hex (yuck).

or

if substring (binary-to-ascii (10, 8, ".", leased-address)) = "192.168.5"

Which is ok for subnets on 8 bit boundaries, but not /25 for example.

The opposite way to do this is to put the if-else inside the subnet definition, 
but that gets rather long winded.

This may be one of the few cases where *defining* the classes inside the subnet 
scope makes sense, even if it does mean a fair bit of repitition.

regards,
-glenn




More information about the dhcp-users mailing list