Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora User (http://www.linux-archive.org/fedora-user/)
-   -   How to choose network path with two internet connection (http://www.linux-archive.org/fedora-user/534124-how-choose-network-path-two-internet-connection.html)

Armelius Cameron 06-02-2011 02:51 PM

How to choose network path with two internet connection
 
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.

How does an application know which network path to use ?*
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 ?

Thanks.AC

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

"Pittigher, Raymond - ES" 06-02-2011 02:55 PM

How to choose network path with two internet connection
 
________________________________________
From: users-bounces@lists.fedoraproject.org [users-bounces@lists.fedoraproject.org] On Behalf Of Armelius Cameron [armeliusc@gmail.com]
Sent: Thursday, June 02, 2011 10:51 AM
To: users@lists.fedoraproject.org
Subject: How to choose network path with two internet connection

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.

How does an application know which network path to use ?

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 ?

Thanks.
AC

You would have your default route defined as the next hop on the wireless network so if it is not a 192.168.x.x address it will use the wireless.

This e-mail and any files transmitted with it may be proprietary and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender.
Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of ITT Corporation. The recipient should check this e-mail and any attachments for the presence of viruses. ITT accepts no liability for any damage caused by any virus transmitted by this e-mail.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

Sam Varshavchik 06-02-2011 02:59 PM

How to choose network path with two internet connection
 
Armelius Cameron writes:


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.



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


The application doesn't know and doesn't care. It's the kernel's job to
route the connection properly.


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 ?


Given what you described, and how Fedora admin's tool work, it'll work
automatically, as long as you set up your network interfaces correctly.


When you set up your LAN interface, the admin tools should set up a route
for your LAN IP address range for that interface. Ditto for your wireless
connection, which will have a route for your wireless LAN, and a default
route to the wireless AP's IP address.


Connections to your LAN IP address ranges will take the LAN route.
Connections to all other IP address will go to the default route.


If you enable IP forwarding and masquerading, your machines on the LAN will
also have Internet connectivity, if they are set to use your laptop's LAN IP
address as their router.


--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

"Kevin J. Cummings" 06-02-2011 08:55 PM

How to choose network path with two internet connection
 
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@rcn.com
cummings@kjchome.homeip.net
cummings@kjc386.framingham.ma.us
Registered Linux User #1232 (http://counter.li.org)
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

Jeffrey Ross 06-05-2011 03:19 PM

How to choose network path with two internet connection
 
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.
>
> How does an application know which network path to use ?
>
> 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 ?
>
> Thanks.
> AC
>
The application(s) don't care which path you take they network stack
makes the decision first on what I refer to as the "longest match wins"
and then if there are multiple identical routes then route metrics can
come into play.

Lets say for example your two interfaces are:
int1 - 192.168.0.2/24
int2 - 192.168.1.2/24

and your default gateway is 192.168.0.1

You attempt to talk to a machine at 172.16.1.5, your machine will check
its routing table for the best match to reach the remote IP, in this
case 0.0.0.0 or the default is the only match.

lets say you add a static route to your system saying to reach
172.16.0.0/16 use the gateway 192.168.1.1
(actual syntax to add the route: "route add -net 172.16.0.0/16 gw
192.168.1.1") now when going to anything in the 172.16.0.0/16 subnet
you'll route your traffic via the 192.168.1.1 gateway since
172.16.0.0/16 is a better (longer) match than 0.0.0.0.

Say you want to reach all 172.16.0.0/16 traffic through the 192.168.1.1
gateway except the 172.168.1.5 host which needs to go through the
192.168.0.1 gateway, in that case you need to add a host route (syntax
"route add -host 172.168.1.5 gw 192.168.0.1)

notice the host route (or /32 bit network route) is more specific than
the "network" route so the more specific route always wins.

You can go so far as to say to reach the address range of
192.168.1.128/25 which is on a directly connected interface go via
192.168.0.1 with a simple network route.

hope that helps,
Jeff
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


All times are GMT. The time now is 08:49 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.