29

My laptop has both wireless and a wired connection capabilities. Can I connect to a router A using wireless and a separate router B using wired ethernet at the same time without having to switch back and forth?

Thanks for replying so quickly.

I wish to connect to two separate networks. The wireless connection is to router A which is connected to broadband internet. The wired connection is to router B which I wish to share files and a printer on 1 or 2 other desktops also using wired connections on B and maybe using synergy to have only one keyboard and mouse for 2 desktops. The wireless laptop is the only one required to have internet access.

2 Answers 2

40

If you're using NetworkManager, it should just work. That said, you will need to set specific settings for your wired connection.

Select your wired connection in the Connection Editor window for NetworkManager (right click on the applet icon, then select Edit Connections). Click Edit, then switch to the IPv4 Settings tab and click the Routes button at the bottom.

You can then force the wired connection to not claim the default gateway (since NM would usually prefer wired over wireless), by checking the "Use this connection only for the resources on its network" checkbox.

4
  • 1
    Yeah! Thankyou so much. This took less than a minute to do following the above guide and worked straight away.
    – Col
    Nov 15, 2010 at 12:45
  • 5
    @Col, The best way to show that it works, is to accept the answer. Please, See What should I do when someone answers my question?. Honestly It was difficult for me to catch this answer without that green flag.
    – user.dz
    Mar 22, 2014 at 10:15
  • Just wanted to note - I was trying to use the "Use this connection only for resources on its network" thing, and it wasn't working for me - until I realized, thanks to the screens here, that I haven't had the "Require IPv4 addressing..." checkbox checked; once I checked it, I got the multiple connection working ... Thanks, cheers!
    – sdaau
    Mar 10, 2016 at 10:38
  • I found that this also works where the IPv4 Settings > Method is set to Manual, not just for Automatic (DHCP). Why would I try that too? I set it to Manual because my Network Attached Storage device is the only other device connected to my eth0, and it wants a number in the 169.254.x.x block.
    – Steve
    Jun 21, 2016 at 22:36
2

The issue here is more of the load-balancing between the wired and wireless connection. Usually, there is only one default route (0.0.0.0, netmask 0.0.0.0), in the routing table. If there is more than one, the first one will always be used, and so the second one will not be. On the router side, if the request comes from one IP address, it will be responded on the same IP address.

What you need is known as load-balancing. I do not know whether there is a package under Ubuntu for this. But such load-balancing and fault-tolerance setup is not meant for desktop. You may want to search for such packages, for Ubuntu/Debian, but it will more likely be for servers. This article:

http://www.informit.com/articles/article.aspx?p=1381888&seqNum=3

may put you on the right track.

2
  • Unless I either misunderstood the original question or your answer encompasses more than it sounds like it does, this doesn't answer the original question. It appears that if router wireless-A connects to the world, and router wired-B connects only to a few 10.x.x.x devices, Ubuntu should know to send 10.x.x.x traffic to B and everything else to A. Or does that not happen by default?
    – Steve
    Jun 21, 2016 at 21:31
  • As I see it, load balancing should only apply to a situation where one has both an A router and a B router that connect to the same set of machines, with traffic divided between A and B (if both are comparable network types) or with A as a back-up to B (such as if A is much slower than B). Does your load-balancing link also provide for connecting between the world and a strictly local network?
    – Steve
    Jun 21, 2016 at 21:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .