Solution: route pointing to a gateway that's not on net

J. W. Ballantine jwb at homer.att.com
Wed Mar 26 15:11:49 PST 2003



My situation is:

    1) Local LAN 10.0.0.0/8
    2) gateway assigned by dhcp on that LAN: 10.x.y.a
    3) Host X on the LAN has assigned 209.122.66.XXX IP address by
        ISP DCHP.

After much patience and advice from Guido van Rooij on how this
can be made to work.  The first step was to manually set-up the
network via:


    ifconfig xl0 with that ip address
    route add -net 10.0.0.0 -iface NIC_device
    route add default 10.x.y.a

After this was shown to work, the last step was to have dhclient
do the setup.  This was done by:

    Add the following line to /etc/dhclient.conf
      script "/etc/dhclient-script";  
    Note that this is the only line in my /etc/dhclient.conf

    Copy over /sbin/dhclient-script to /etc.
    Edit the /etc/dhclient-script.
    
    Look for this line:
    route add $new_ip_address 127.1 >/dev/null 2>&1
    and put the following line after it:
    route add -net 10.0.0.0 -iface xl0
    This happens a couple of times.
    
    After the following line:
    route delete $old_ip_address 127.1 >/dev/null 2>&1
    Also add:
    route delete -net 10.0.0.0 -iface xl0
    Again, this happens in a couple of places.
        
    Then reboot the system and everything should work.

Again much thanks to the information, patience and assistance of 
Guido van Rooij.

Jim Ballantine






More information about the freebsd-net mailing list