[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Default Route On Boot.



I'm at a complete loss of how to make this work. The way I understand it
there are three ways to set a default route when the machine boots. 1)
Use DHCP. 2) From the Interfaces file. 3) A script in one of the
if-xxxxx.d directorys. I have tried all these and just don't seem to be
able to get it to work.

Firstly, DHCP works fine. Secondly, I can configure the box manually
with route add. Thirdly, I have managed to kludge it with an init.d
script but would really like to know why I can't get it to work the way
it's supposed to.

Interfaces method.

Here's what I have in my /etc/network/interfaces file;

==============
# This file describes the network interfaces available on your system #
and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0

iface eth0 inet static
address 192.168.0.42
netmask 225.225.225.0
gateway 192.168.0.1
==============

This doesn't work. When the machine boots it sets the static IP okay and
the netmask but refuses to add the gateway. Lets assume everything up to
the 'auto eth0' is correct. I've also tried;

iface eth0 inet static
address 192.168.0.42
netmask 225.225.225.0
network 192.168.0.0
braudcast 192.168.0.255
gateway 192.168.0.1

and...

iface eth0 inet static
address 192.168.0.42
netmask 225.225.225.0
up route add default gw 192.168.0.1

and...

iface eth0 inet static
        address 192.168.0.42
        netmask 225.225.225.0
        gateway 192.168.0.1

and...

iface eth0 inet static
        address 192.168.0.42
        netmask 225.225.225.0
        up route add default gw 192.168.0.1

None of the above has had any effect on the routing table.

I've also tried adding an executable file to the if-up.d which contains
the single line; route add default gw 192.168.0.1

This didn't work either. Now I'm not overly convinced that this is how
the if-up.d directory is supposed to work but it's how I understood it
after reading the file format on 'interfaces'.

Also, this isn't the only box I've configured where I've run across this
problem so I can't see it being specific to the machine I'm currently
working. All the boxes have been installed from the basic netinstall
disk downloaded at various time over the last couple of years. The
latest was downloaded a couple of days ago. 

If anyone can offer some pointers as to where I'm going wrong I'd
appreciate it.

thx.
--
np



Reply to: