Networking question

Rashkae ubuntu at
Wed Oct 15 23:45:21 UTC 2008

Mark Haney wrote:
> Paolo wrote:
>> Hello,
>> My connection to a Windows LAN is provided by a script which I was given, but 
>> don't understand, and which I've been using on Gutsy and Hardy.
>> Now it also seems to be working on Intrepid, but I wonder if, with the new 
>> networking capabilities of Intrepid, it is possible to do the configuration 
>> directly in the Network Manager?
>> The script is saved as /etc/dhcp3/dhclient-exit-hooks.d/cfg_static_routes
>> and looks like this:
>> #!/bin/sh
>>   # Add routes obtained by DHCP
>>   function process_static_routes() {
>>     while [ $# -ne 0 ]
>>     do
>>       host=$1
>>       gateway=$2
>>       shift; shift
>>       echo "add -host $host gw $gateway"
>>       route add -host $host gw $gateway
>>     done
>>   }
>>   if [ "$reason" = "BOUND" ]|| [ $reason == "REBOOT" ]
>>   then
>>   #  echo "static_routes = $new_static_routes"
>>      process_static_routes $new_static_routes
>>   fi
>> If anyone has some advice on what to try, I'd be grateful.
>> Paolo
> I'm not exactly sure what you're trying to do with this.  Or even why 
> you need it.  With DHCP, once you get an IP address, you'll also get a 
> default gateway.  All that does is tell your system if the system 
> doesn't know where a packet goes, to shove it to the default.  I've 
> NEVER needed to do this with DHCP, as it will provide basic networking 
> functionality when you request the IP address.  Otherwise, what would be 
> the point of DHCP?

mark, you missed the point of this entirely.

His DHCP config is specifying static routes to individual hosts.  These
are hosts that are on a different subnet not connected to his default

Why the network would be set up this way is a mystery..  Apparently
windows itself doesn't even support static routes to hosts in it's DHCP
client.  And it's a pain in the ass because the DHCP spec doesn't even
support stateless subnets for this purpose.  (You can't specify a
netmask range, you have to provide a gateway for each host, even if it's
the same gateway)

More information about the ubuntu-users mailing list