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

Re: Multiple Network Interfaces per host -- possible?



On Wed, 25 Apr 2001 17:14:59 Wayne Topa wrote:

> > In reply to:Lukas Ruf
> > 
> > 
> > Just added a 2nd card a few days ago.  Here is what I recall doing.
> > Read through the Net3 and Ethernet howto's first and then
> > 
> > /etc/network/aliases  Had this for the first card
>               ^^^^^^^   I meant interfaces  :(   
> >  iface eth0 inet static
> >      address 192.168.1.1
> >      network 192.168.1.0
> >      netmask 255.255.255.0
> >      broadcast 192.168.1.255
> > 
> > # so I added this for the 2nd card
> >  iface eth1 inet static
> >      address 192.168.1.10
> >      network 192.168.1.0
> >      netmask 255.255.255.0
> >      broadcast 192.168.1.255
> >      up route add 192.168.1.10 netmask 255.255.255.0 gw 192.168.1.1

You don't need a second a second network card. If you have ip
aliasing compiled into your kernel, you just need the following:

in /etc/network/interfaces add:

iface eth0:0 inet static

and give it the details of the second dsl interface.

Now you'll have to do some reading if you want to use both interfaces
simultaneously. You could try adding two default routes with the same
metric, but the first one to be configured will be the one that gets used.

If you want it to fail over and back as routers die/come back, all you'll
need is a simple script that sits in the background and pings a host that
is the next hop on from the interface of the primary dsl router. If it's
alive, make the default route go through the primary dsl router, if it's
dead, make the default route go through the secondary one.

I'd recommend pinging 3 times each a second apart with a count of 1 every
10 seconds. If all 3 fail then swap the route to the secondary. This will
give you a worst case scenario of about 20 seconds downtime and will avoid
flooding the host you're pinging.

The nice thing about an aliased interface is that it looks just like the
same interface to ipchains (as it works on a physical interface level) so
any masquerading/firewalling you have in place shouldn't have to change
that much.



Reply to: