Luckily, even though they aren't standard (for obvious reasons) there are option codes for distributing classless routes in dhcpd. You just have to define them yourself, and if you want it to work for both unix and windows machines you have to define it twice (ms couldn't just stick to the rfc, that would have been too easy).
under the global definitions in dhcpd.conf, create the following new options:
option rfc3442-classless-static-routes code 121 = array of integer 8;
option ms-classless-static-routes code 249 = array of integer 8;
code 121 is the rfc3442 implementation for distributing static routes other than the default router, and 249 is Microsoft's version of that rfc.
Now that those options are defined we can create the routes themselves in our subnet options as arrays of integers with the pattern:
[netmask, network address byte 1, network address byte 2, network address byte 3, route byte 1, route byte 2, route byte 3, route byte 4]
for example:
option rfc3442-classless-static-routes = 24, 192, 168, 35, 10, 10, 0, 12;
option ms-classless-static-routes = 24, 192, 168, 35, 10, 10, 0, 12; which provide dhcp clients a route to the 192.168.35.0/24 network via 10.10.0.12.
Victory.
Hi again (the same annonymous):
ReplyDeleteSOLVED: The syntax must be the following:
option rfc3442-classless-static-routes 24, 192, 168, 35, 10, 10, 0, 12;
option ms-classless-static-routes 24, 192, 168, 35, 10, 10, 0, 12;
Thanks anyway
Hi again (the same annonymous):
ReplyDeleteThe syntax must be the following:
option rfc3442-classless-static-routes 24, 192, 168, 35, 10, 10, 0, 12;
option ms-classless-static-routes 24, 192, 168, 35, 10, 10, 0, 12;
Thanks anyway
In Spanish too:
ReplyDeletehttp://ignoresysprereqs.blogspot.com/2011/05/dhcpd-ruteo-estatico-sin-clase-dhcpd.html:
It's aways good to know...
ReplyDeletePattern for mask 24 (255.255.255.0):
[netmask, network address byte 1, network address byte 2, network address byte 3, route byte 1, route byte 2, route byte 3, route byte 4]
ex. 24, 192, 168, 35, 10, 10, 0, 12
For a network wich uses classes other than 24, we must create:
Pattern for mask 16 (255.255.0.0):
[netmask, network address byte 1, network address byte 2, route byte 1, route byte 2, route byte 3, route byte 4]
ex. 16, 192, 168, 10, 10, 0, 12
Pattern for mask 8 (255.0.0.0):
[netmask, network address byte 1, route byte 1, route byte 2, route byte 3, route byte 4]
ex. 16, 192, 10, 10, 0, 12
As I said, it's aways good to know.
I made a mistake,
ReplyDeleteIn the example above, for pattern to mask 8, the correct is:
Pattern for mask 8 (255.0.0.0):
[netmask, network address byte 1, route byte 1, route byte 2, route byte 3, route byte 4]
ex. 8, 192, 10, 10, 0, 12
Sorry for the incovenient.
Just a big thank you for saving me the hassle or having to figure this one out from scratch! THANKS!
ReplyDelete