[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 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 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

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..

> I realize this question sounds silly, since I should just put it in
> interfaces in the same way I put the primary address and gateway, like
> this:
> iface eth0:1 inet static 
>    address 
>    gateway

Again, this would not work, but you are also missing the netmask.

> But it doesn't do the trick -- this is disregarded. If I enter it as
> above from bash, it always works.
> I've also tried things like
>         ip route add dev eth0 via

what you are doing here is that you are telling linux that the network resides behind which is not what you want to

what you are looking for is:
          ip route add dev eth0 via

The above should work if your netmask is correctly set.

Try if that helps, 

			  -< Sami Haahtinen >-
      -[ Notify immediately if you do not receive this message ]-
	-< 2209 3C53 D0FB 041C F7B1  F908 A9B6 F730 B83D 761C >-

Reply to: