0

I would like to be able to connect to a local ethernet network and a wifi internet connection at the same time. I have a local network connected through ethernet and a network for internet that I am connected to wirelessly.

For the local one, I am using the Manual Method in the IPv4 Settings.

I have already tried choosing "Use this connection only for resources on its network" and this makes what I need to do locally not work.

I want to be able to use the internet to surf in my browser as well as do things with the local network outside of the browser.

  • I may just not be understanding correctly, but you could actually do what you want all from the same network. You didnt say so, but I'm guessing you are using different subnets for your home network? If so, your router should be able to handle that for you and still give you WAN access as well. – jwcooper Apr 30 '19 at 19:08
  • I have to use two networks. The ethernet cable connects to a device which has it's own network, of which my computer is a component. I cannot do it all from the same network for what I want to do. – user168226 Apr 30 '19 at 19:17
  • That being the case, this answer seems to describe everything you need to make it work: askubuntu.com/questions/809533/having-two-different-networks – jwcooper Apr 30 '19 at 19:23
  • I just tried that. It didn't work, although it is probably something that I am doing wrong. – user168226 May 1 '19 at 13:12
0

You need to add a static route for the local network.

First install nmcli, if it isn't installed already. From a terminal run:

sudo apt install nmcli

Now create the static route:

sudo nmcli connection modify <name> +ipv4.routes <destination> ipv4.gateway <gateway>

Where name can be found by running nmcli c show, destination is the local subnet and gateway would most likely be the router.

For example, say I have a local network of 10.0.20.0/24 connected to router3 (10.0.20.1). Router1 (192.168.1.1) is my wireless connection gateway and Router2 (172.31.1.1) is my ethernet connection gateway. I would run the following to gain connectivity to the 10.0.20.0/24 network. Also, the name of the lan interface is enp0s3:

sudo nmcli connection modify enp0s3 +ipv4.routes 10.0.20.0/24 ipv4.gateway 172.31.1.1

You may not have such a complex network and the local network may be all you need to access, in this case the command would look like:

sudo nmcli connection modify enp0s3 +ipv4.routes 172.31.1.0/24 ipv4.gateway 172.31.1.1

| improve this answer | |
  • Unfortunately, this did not work for me. I tried it exactly as you described. When the Ethernet network is connected, I simply cannot get on the internet. – user168226 May 2 '19 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.