[wellylug] multiple gateways

Pete Black pete at marchingcubes.com
Fri Dec 3 10:38:28 NZDT 2004


Can you clarify this please - when you say you want to respond to 
traffic that comes in from two different gateways, do you simply mean 
you have multiple interfaces on your machine?

Can you be more specific about your network setup, as the degree to 
which linux's default arp, rp_filter etc. proc entries and route cache 
will ruin your day depends very much on exactly what you are trying to do.

You can do just about any kind of 'smart' routing using iproute2 and 
iptables, and the assertion that you can have only one default gateway 
is technically not correct.

You can have only one default gateway per routing table. - it is 
relatively easy simply to mark all packets entering via a given 
interface and sending them to a specified route table which will enable 
you to control which interface a packet leaves on based on the interface 
it entered on etc. etc.

-Pete

>You can only have one default gateway. If you know the source
>addresses for all traffic coming in one of the interfaces, you can set
>up a bunch of static routes (route add <network> <netmask> <gateway>).
>
>Other than that, this indicates a pretty broken network set up and I
>suggest you fix it before you try any nasty hacks :)
>
>On Fri, 03 Dec 2004 at 10:06:17 +1300, Mark Signal wrote:
>
>  
>
>>Hi
>>
>>hopefully a simple question
>>
>>I want a debian box to be able to respond to traffic that comes  2 
>>different gateways.
>>
>>I tried adding a second gateway setting for eth0 in the  
>>/etc/network/interfaces file but as I expected it spat the dummy
>>
>>presumably I need a primary gateway (as defined in 
>>/etc/network/interfaces?) and an alternative gateway set up in routing 
>>somehow?
>>
>>as usual - any pointers/abuse gratefully accepted
>>
>>thanks
>>
>>Mark Signal
>>
>>
>>-- 
>>Wellington Linux Users Group Mailing List: wellylug at lists.wellylug.org.nz
>>To Leave:  http://lists.wellylug.org.nz/mailman/listinfo/wellylug
>>    
>>
>
>
>  
>




More information about the wellylug mailing list