According to this:
http://undeadly.org/cgi?action=article&sid=20140204080515&mode=expanded
This is expected behaviour as:
"Note that classless-static-routes overrides the router option, and that a
default route must always be specified!"
There's no such warning in the man pages for dhclient or dhcpd.
So, options like this (notice 0.0.0.0/0 and def gw first) seems to work:
option classless-static-routes 0.0.0.0/0 172.16.192.119, 192.168.10.0/24
172.16.192.149;
option classless-ms-static-routes 0.0.0.0/0 172.16.192.119,
192.168.10.0/24 172.16.192.149;
I think this could be made clear in the dhcp-options(5) man page.
Now it reads:
option classless-static-routes ip/prefix ip [, ip/prefix ip ...];
This option specifies a list of static routes in CDIR notation,
which should be sent to the client.
option classless-ms-static-routes ip/prefix ip [, ip/prefix ip ...];
This option does the same as classless-static-routes, but uses
option code 249 instead of 121, since Windows XP and Windows
Server 2003 ignore option 121.
Something in the line of:
Note: classless-static-routes overrides the router option and a default
route must always be specified!
The syntax for a route is '1.2.3.4/13 5.6.7.8', which says that the
gateway 5.6.7.8 is the way to get to the subnet 1.2.3.4/13. Thus in
dhclient.conf you can say 'default classless-static-routes 0/0 5.6.7.9,
1.2.3.4/13 5.6.7.8;'. i.e. the default route is 5.6.7.9 and the gateway
for 1.2.3.4/13 is 5.6.7.8.
Similarly you can specify the value that dhcpd supplies to clients.
Thanks
Juan
> Hello
>
> dhclient on 5.7 won't set the client default gateway if other static
> routes are present (same problem exists on 5.6, at least).
>
> dhcpd server is running 5.6 stable with aprox 400 workstations and
> appliances/printers with mixed OSs and versions all working fine.
>
> At least both -windows and linux- are able to get and set default gw and
> static routes.
>
>
> The dhcpd.conf
>
> subnet 172.16.192.0 netmask 255.255.254.0 {
>
> # default gw
> option routers 172.16.192.119;
>
> # static route to new building
> option classless-static-routes 192.168.10.0/24 172.16.192.149;
> option classless-ms-static-routes 192.168.10.0/24 172.16.192.149;
>
> # Ips we assign
> range 172.16.192.153 172.16.192.249;
>
>
> host stratus { hardware ethernet 00:00:00:00:00:01; fixed-address
> 172.16.192.219; }
>
> ... other host declarations ...
> }
>
>
> With the config as it is above, the routers option will be ignored, while
> the 192.168.10.0/24 route will be set correctly.
>
> If I comment out both classless-* options and restart the server,
> "routers" will be honored and a default gateway set.
>
>
> This is dhclient config:
>
> testrat:/root{3}# cat /etc/dhclient.conf
> #request subnet-mask, broadcast-address, routers, domain-name,
> domain-name-servers;
>
> require routers;
> testrat:/root{4}#
>
> No luck with and empty dhclient.conf.
>
>
> Any ideas?
>
> Thanks
>
> Juan