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

Re: Where to add static routes?



Sonny Kupka <sonny@nothnbut.net> writes:
> 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..

If you have a single static route you need to set up, it's easy:

iface eth0 inet static
        address 18.101.2.57
        network 18.101.2.48
        netmask 255.255.255.240
        broadcast 18.101.2.63
        gateway 18.101.2.49

If you have multiple routes, you can add them using an "up" line in
/etc/network/interfaces (see interfaces(5)), or by using a script in
/etc/network/if-up.d (see http://bugs.debian.org/141634 for a man page
fragment).

On my router machine, I have a sufficiently complicated setup that I
use a separate script in /etc/rc2.d that gets run after the network
comes up.

> Another thing.. What the equivalent of an /etc/rc.d/rc.local

Copy /etc/init.d/skeleton to something descriptive.  Edit it to do
what you want.  Then run 'update-rc.d' or manually create symlinks
from there into the other /etc/rcN.d directories.

-- 
David Maze         dmaze@debian.org      http://people.debian.org/~dmaze/
"Theoretical politics is interesting.  Politicking should be illegal."
	-- Abra Mitchell



Reply to: