Score:0

Running multiple network connection simultaneously on Linux

in flag

Hello and I'm a very new user of Linux and I'm trying to learn about this brand new environment.

Today I ran into a problem. I have a wired broadband connection with my computer. I do also have a WiFi dongle with my PC which helps me to transfer files between my other devices. but when I connect the WiFi with other computers or phone, the connection is fine but I lose my Internet connection through the wired broadband.

I understand this as a multiple network connection error happening in Linux but I am not aware of how to solve the problem. I used to configure the metric levels of networks in windows system but I am not able to do the same on Linux. How to do that ?

I'm actually running Lubuntu 20.04 , a light-weight port of Ubuntu.

in flag
Welcome to Linux and AskUbuntu! Could you [edit] your question to include the version of Ubuntu you’re running? This will make it easier to offer a complete answer
in flag
@matigo I've updated my question .
Score:1
br flag

Maybe it is routing problem. In case two interfaces are active in the same time (and both are leaved with dynamic IP assignment) then two default routes are in collision. This command could you help to check the situation:

ip route

Search for routes starting "default" in command response. A problem is if more then one such routes (i.e. lines) are listed. Example of unwanted state:

jiri@b01x:~$ ip route
default via 10.1.1.1 dev br0 proto dhcp metric 600 
default via 192.168.1.1 dev wlan0 proto dhcp metric 425 
... 
jiri@b01x:~$

Testing: Remove default route attached to Wi-Fi interface. Temporary way how to do it is by command:

sudo ip route del default via 192.168.1.1 dev wlan0

Correct IP address and interface name must be copied from your previous "ip route" command output.

Now re-check routes by "ip route". Only one route should remain in list. Then check the internet connection. If all is OK, you have found solution. Use one of these possibilities:

  1. Modify Wi-Fi interface setting in IPv4 section (e.g. using GUI system setting). Change Wi-Fi IP address assignment from Automatic to Manual, set own IP address, but leave default route empty!
  2. Create small script containing "sudo route del ..." command and run it in case you use both interfaces. The script must be started AFTER Wi-Fi interface is activated.

In case you will lost connection to your other devices connected via Wi-Fi, you should add or modify static routes. I will try to help you to solve this secondary problem, but more details and command outputs are needed.

in flag
What Subnet mask should I give ?
netbat avatar
br flag
Do you mean mask for manually set Wi-Fi network? Use the same mask and address as you see in case dynamic address assignment (DHCP). Probably mask will be 255.255.255.0 Does help "route del" command?
in flag
Even without defining all those configuration just by `sudo ip route del default via 192.168.1.1 dev wlan0` command everything is solved. But problem is sometimes not happening even I didn't run the command I would be also happy to know what causes this. Thanks a lot for your answer !
netbat avatar
br flag
IP addresses, routes, their metrics etc. on both interfaces are set dynamically, therefore can vary. A final routing decision concerning each packet sent out of system depends on more factors including route metrics and is not still same if parameters are changed. Similar situation is in the IP neighbor table (ARP table), which is very dynamic. IP address of default route is member of this table too.Etc. The change occurs typically if interfaces are disabled or enabled. Sometimes the situation is positive without the route deletion. Problem is that it is unstable, not reliable.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.