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

Re: Where to add static routes?



|> I'm switching from Slackware to Debian and I'm a little lost ;)
|> In Slackware I loaded my routes to /etc/rc.d/rc.inet1 like:
|>
|> route add -net xxx.xxx.xxx.xxx gw xxx.xxx.xxx.xxx netmask 255.255.255.240

|> I tried to put that line in my /etc/network/interfaces file just
|> after it started the eth0, but that didn't work right..
|>
|> Another thing.. What the equivalent of an /etc/rc.d/rc.local

If my understanding is correct, it should be enough to have in 
/etc/network/interfaces lines like:

gateway 192.168.93.3
netmask 255.255.255.0

In general, the interfaces file should look something like:

----------------------------------------------------------------------
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface

auto lo
iface lo inet loopback

# The first network card

auto eth0
iface eth0 inet static 
address 192.168.93.2 
netmask 255.255.255.0
broadcast 192.168.93.255
gateway 192.168.93.3
----------------------------------------------------------------------

If you don't want the eth0 interface brought up at boot-time, 
leave out the line beginning `auto'.

This assumes that your machine has a static IP address ....

In Debian, the relevant values are read from this file and passed to
the utilites ifup and ifdown (which themselves depend on and call
ifconfig).

ifup and ifdown are themselves called by the init script:

   /etc/init.d/networking

but all local configuration should be done in /etc/network/interfaces

Jim



Reply to: