How to choose network path with two internet connection

Kevin J. Cummings cummings at kjchome.homeip.net
Thu Jun 2 20:55:52 UTC 2011


On 06/02/2011 10:51 AM, Armelius Cameron wrote:
> Hello,
> Suppose I have a laptop that has both Wired and Wireless connection. The
> Wired connection would be connected to LAN only. The Wireless connection
> would have full internet access. Obviously the two connections will have
> two different IP: a local IP address (e.g. 192.168.x.x) for the Wired,
> and a public IP address for the Wireless.

I hope you are saying that only one of these connections is ever 
connected at one time....

> How does an application know which network path to use ?

The network default route gets set when the network connection gets 
established.  If both networks are active at the same time, you *might* 
have a conflict with which default path to use.  But, if only one is 
active, there should be no conflict.

I've always thought that the higher bandwidth connection should take 
precedence, but there is nothing in the configuration scripts to ensure 
that.  NetworkManager used to (I'm not sure if it still does) drop a 
wireless connection if it sees that a wired connection is now made. 
But, it the wired connection is not your Internet connection (and your 
wireless connection is) then that would be the wrong thing to do.

> For example, I want to be able to run SSH or Synergy to other machine on
> the LAN, so SSH would have to use the LAN network. But I also want to be
> able to run mail client that is connected to an IMAP server in the
> outside world, so my mail client have to use the Wireless network. How
> does something like this work ?

If your LAN is a local LAN only, and not a default connection to the 
Internet, then you would have to ensure that connecting to your LAN does 
not set up a "default" route over the LAN when trying to get to some 
other network, especially if your wireless connection already does that. 
  In that case, the configuration of your LAN network should only add 
routes to your LAN and not a default route to the rest of the Internet.

> Thanks.
> AC

I hope this has been helpful.

-- 
Kevin J. Cummings
kjchome at rcn.com
cummings at kjchome.homeip.net
cummings at kjc386.framingham.ma.us
Registered Linux User #1232 (http://counter.li.org)


More information about the users mailing list