Static route set from dhcp
By Michael Henderson •
Does anyone know if it is possible to add static routes with dhcp? I know that there is option 121 in dhcp but I read that it can set routing via some gateway IP, and I need to set routing via device. Manually I can do that in linux with:
ip route add xxx.xxx.xxx.xxx dev eth0But I have no idea if it is possible (and how) with dhcp. I'm now using udhcpd.
21 Answer
With DHCP for IPv4 this is possible. With DHCP for IPv6 not.
The option you are looking for is classless-routes specified in RFC3442.
Not sure if you can configure this option on udhcpd but I've seen and used it with ISC DHCP Server. The syntax for this option is a little strange and is described in the RFC.
Note: I think there are some problems with older Versions of Windows which will request another DHCP option.
1