Routing question -- multiple gateway setup?

William Park opengeometry-FFYn/CNdgSA at public.gmane.org
Sun Aug 22 19:07:53 UTC 2004


On Sun, Aug 22, 2004 at 07:56:43AM -0400, James Knott wrote:
> William Park wrote:
> >If you have multiple connections to Internet (say, PPP dialup, DSL, and
> >Cable), how do you make use of all 3 ?  
> >
> >    - Do you put 3 default entries in the routing table?  Like
> >	route add default gw 11.22.33.44
> >	route add default gw 55.66.77.88
> >	route add default gw 99.11.22.33
> >
> >    - Is there some /proc/* parameter you set to "round robin" the
> >      default gateway?
> >
> 
> You can only have 1 default gateway.  Using all 3 in the manner you 
> suggest, is not practical.  If you had multiple connections to the same 
> ISP, you might be able to arrange load balancing, but with three 
> unrelated connections, there's no way to do that.  You might be able to 
> determine which connection is best for a particular destination and 
> routhe that way, but again, that's not practical without knowing about 
> the routing between ISPs.  Just distributing the packets among the 3 
> won't work, as with tcp, you need a "connection", which includes a 
> consistent IP address on both ends.

I can see why NAT would fail for multiple defaults.  If it goes out
through ppp0, then the source IP will appear as 11.11.11.11, and if it
goes out through eth0, then the source IP will appear as 22.22.22.22.
So, once connection is made, all its packets must go out through the
same interface as the first connection.

But, when making that first connection, how do I choose the interface?

I did try some experiment with 2 defaults as identically configured as
possible, same metric, flags, etc:
    - eth0 -- first entry in routing table (not active)
    - ppp0 -- second entry (active)
When 'ping' few sites,
    - eth0 was chosen most of the time,
    - but, time to time, ppp0 was chosen (I saw modem lights blinking), and
      I did get packets returning.  But, this was rare case.

So, my kernel (without "advanced router" section enabled) somehow chose
the second default route (ppp0).  I would like know how it made that
decision, and how I can make it more consistent. :-)

-- 
William Park <opengeometry-FFYn/CNdgSA at public.gmane.org>
Open Geometry Consulting, Toronto, Canada
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list