Subject: network with gateway on separate subnet: dhclient question
To: None <firstname.lastname@example.org>
From: Cherry G. Mathew <email@example.com>
Date: 02/09/2007 22:42:48
So I'm on this network where dhclient which returns a netmask of
255.255.255.255 and broadcast id of assigned ip address.
So dhclient-script does on line 195:
ifconfig rtk0 inet $assigned_ip netmask 255.255.255.255 broadcast $assigned_ip
This adds the following entries to route:
Then it tries to add the router entry:
route add default $router
This step _FAILS_
I tried this manually, and the route command told me that "there is no
route to host".
I guess this means that the gateway is on a different subnet.
Following advice from:
I flushed the routes:
# route -f flushall
Then I did:
# ifconfig rtk0 inet $assigned_ip netmask 255.255.255.255 broadcast
# route add -host $router -link rtk0 -iface
# route add default -ifa $assigned_ip $router
The only way this works is if I flush all routes, and do:
# ifconfig rtk0 $assigned_ip
This changes the netmask to 255.0.0.0 and the broadcast to 10.255.255.255
# route add -net 10.0.0.0/8 -iface $assigned_ip
# route add default $router
Everything works now.
Any ideas/reason why the default dhclient-script doesn't work ?