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

Re: ip aliasing and second default gw in /etc/network/interfaces



On Wed, Sep 03, 2003 at 08:51:54PM +0300, Sami Haahtinen wrote:
> On Wed, Sep 03, 2003 at 01:23:58AM -0700, Peter Nome wrote:
> > I'm hoping some smart soul can help me with this. After experimenting
> > a bit, I discovered that I could add a second ip address by issuing
> > 
> >       ifconfig eth0:1 192.168.1.92 up
> 
> So far so good.. 
> 
> > Once that's in pace, I found I could add a second default gatway by
> > issuing
> > 
> >       route add default gw 192.168.1.1
> 
> Wrong, the problem with linux routing tables is that linux is capable of
> having only one default gateway, so your idea would never work, you
> would need to poll the connection and change the gateway if the other
> route goes down..

Wrong; check my main routing table (trimmed a bit to make it simpler);

203.12.236.227 dev ippp0  scope link
210.15.254.253 dev ppp5  scope link
[...]
192.188.107.0/24 dev ippp0  scope link
198.142.76.0/24 dev ppp5  scope link
[...]
203.113.192.0/18 dev ppp5  scope link
unreachable 192.168.0.0/16  scope host
unreachable 172.16.0.0/12  scope host
unreachable 10.0.0.0/8  scope host
default
        nexthop via 203.12.236.227  dev ippp0 weight 1
        nexthop via 203.17.101.66  dev ppp5 weight 4
 
Of course, if one goes down, you still want it to dispear as a
"nexthop" default route, otherwise you end up with strange
intermittant behaviour.

As in my case I have ppp and ippp links, I don't put stuff in
/etc/network/interfaces but in /etc/ppp/ip-(up|down).d/*

I see no reason why you couldn't use ip route stuff to do the same
sort of suff in /etc/network/interfaces though (it would probably be
easier).

Search for the Advanced Linux Routing HOWTO... it has much good info.
The other place to look is /usr/share/doc/iproute/ip-cref.ps.gz (why
the hell couldn't they provide this doco in html) after intalling
iproute.

-- 
----------------------------------------------------------------
Donovan Baarda                http://minkirri.apana.org.au/~abo/
----------------------------------------------------------------



Reply to: