Configure routing (with netmask)

Simon Hobson dhcp1 at thehobsons.co.uk
Thu May 10 14:36:27 UTC 2007


Vitor Flausino wrote:
>RFC3442 does not give me the syntax for dhcpd.conf...
>So far what I have and is not working is...
>
>
>option classless-routes code 249 = array of unsigned integer 8;
>option classless-routes 32,  0,0,0,0,  5,22,23,7,   24,  12,68,0,0, 
>5,22,23,100;


Is that meant to encode 0.0.0.0/32 via 5.22.23.7 and 12.68.0.0/24 via 
5.22.23.100 ?

If so then you haven't read rfc3442 (properly).

That set of routes would be (as I read it) :

32, 0,0,0,0, 5,22,23,7, 24, 12,68,0, 5,22,223,100

32,0,0,0,0 = 0.0.0.0/32
5,22,23,7 =  via 5.22.23.7
24,12,68,0 = 12.68.0.0/24 (note that the redundant 0 is dropped)
5,22,223,100 = via 5.22.223.100

I'm assuming that the DHCP server automatically calculates and 
inserts the option length byte.


The problem may be as simple as not allowing for dropping 
insignificant octets (ie 12.68.0.0/24 becomes 24,12,68,0) and 
possibly leaving off the length.


If you actually meant "default via 5.22.23.7 and 12.68.0.0/24 via 
5.22.23.100" then it would be :

0, 5,22,23,7, 24, 12,68,0, 5,22,223,100

where "0, 5,22,23,7" means 0.0.0.0/0 via 5.22.23.7


Does this work ?


More information about the dhcp-users mailing list