How can I configure my DHCP server to distribute IP routes?
This can be done by adding the following lines to dhcpd.conf
:
option rfc3442-classless-static-routes code 121 = array of integer 8;
option rfc3442-classless-static-routes 24, 192, 168, 1, 192, 168, 0, 4;
option ms-classless-static-routes code 249 = array of integer 8;
option ms-classless-static-routes 24, 192, 168, 1, 192, 168, 0, 4;
This distributes a route entry for network 192.168.1.0/24 using the gateway 192.168.0.4.
The meaning of the bytes is (in brackets the value from the example above):
WW, D1, D2, D3, R1, R2, R3, R4
WW = destination network mask width (24)
D1..D3 = destination network address (192.168.1.*)
R1..R4 = router address (192.168.0.4)
Note: The number of D1..DN
bytes varies depending on the network mask. See RFC3442 for details.