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

Re: Network routes

On Sat, Nov 18, 2000 at 11:41:10AM -0800, Kyle J. Moore wrote:
> I have just started using Debian in something other
> than a simple network. I'm looking for what file and
> syntax I should put entries for static routes. I'm
> used to RedHat and things seem to be different in
> Debian. Most of the docs I've seen while researching
> this refer to putting things in the
> /etc/init.d/network script. This doesn't seem like a
> good idea as it would get overwritten during an
> upgrade and it also doesn't seem to be supported
> anymore as the script looks totally different? Do I
/etc/init.d/network is the 2.1/slink (old) way,
in potato and up, /etc/network/interfaces is used,
and /etc/init.d/networking that calls ifup/ifdown
and sets up some things like ip spoofing protection,
but i don't recommend to edit it directly, it's nice
(imho) that all routes are reset if you do
ifdown -a; ifup -a.

> put this in /etc/network/interfaces or what? An
> example of syntax would also be helpful.

i usually do it in /etc/network/interfaces like:
 iface eth0 inet static
     up route add -net netmask dev eth0 gw
     down route del -net netmask

after up/down, just normal commands can be enterd.
i constrol my firewalls this way too, like 

up /root/bin/firewall-eth0 start
down /root/bin/firewall-eth0 stop

man 5 interfaces for more info

it could be a good idea to make a seperate script for
adding/removing the correct routes for an iface,
like i did for firewalling.
it isn't very managable if you have 30 'up' lines
in interfaces.

> Name:           Alson van der Meulen      <
> Personal:       alson@linuxfreak.nl       <
> School:       alson@gymnasiumleiden.nl    <
You can do this patch with the system up...

Reply to: