Subject: network with gateway on separate subnet: dhclient question
To: None <>
From: Cherry G. Mathew <>
List: current-users
Date: 02/09/2007 22:42:48
So I'm on this network where dhclient which returns a netmask of and broadcast id of assigned ip address.

So dhclient-script does on line 195:

ifconfig rtk0 inet $assigned_ip netmask broadcast $assigned_ip

This adds the following entries to route:

$assigned_ip/32 #link2

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 broadcast
 # route add -host $router -link rtk0 -iface
 # route add default -ifa $assigned_ip $router

Didn't work.

The only way this works is if I flush all routes, and do:

 # ifconfig rtk0 $assigned_ip

This changes the netmask to and the broadcast to

 # route add -net -iface $assigned_ip
 # route add default $router

Everything works now.

Any ideas/reason why the default dhclient-script doesn't work ?