8

A few days ago my ethernet connection was not working on Ubuntu 20.04 on my computer. I was using two routers: the main one was / is in the living room and connected to the second router which was / is in bridge mode and the second router was connected to my computer. Thanks to @heynnema, I found out the cause of the problem was the second router. When I connected the main router directly to my computer, the ethernet worked.

Yesterday, my father and I connected the second router to another PC at home. (The main router and my computer is still directly connected together but the other PC is connected to the second one and the second router is connected to the main one.) But then the ethernet on my computer started not working again. It only works when the second router isn't connected altogether. I want the second router to work because I can't connect to WiFi in my bedroom without it because the WiFi range of the main one is too small. What should I do? I have no problem with the connection on Windows 10.

Edit: sudo lshw -c network output: https://i.stack.imgur.com/HMLAd.jpg

Edit 2: I installed Linux Bash Shell on Windows 10 and wrote sudo lshw -c network again. Here is the output: https://i.stack.imgur.com/Ly509.jpg And the output of ip a: https://i.stack.imgur.com/T8zNw.jpg

  • It actually looks like it should be working, but you may have a cabling problem, as the connection is only 100Mbs instead of 1Gbs. Are you using cat 5e or cat 6 cables? Describe your network cabling from the computer all the way to the router/modem. Start comments to me with @heynnema or I'll miss them. – heynnema Aug 15 '20 at 15:17
  • @heynnema I use two routers/modems. The main one is in the living room, The second one is next to my PC in my bedroom and in bridge mode. (So that I can connect to WiFi with my phone, otherwise I can't because the wifi range of the main one is too small) And the routers/modems and my PC are connected together with a Cat5e ethernet cable.

    Is that clear? I probably couldn't describe it well but these're all I can say.

    –  Aug 15 '20 at 17:40
  • Does the computer go directly to the main router via a cat 5e cable? Are the router ports 1G? – heynnema Aug 15 '20 at 17:42
  • To eliminate a software problem, boot to a Ubuntu Live DVD/USB and see if ethernet works that way. Report back. – heynnema Aug 15 '20 at 17:46
  • Are you running Ubuntu Desktop or Ubuntu Server? – heynnema Aug 15 '20 at 17:49
  • @heynnema The main router is connected to the second router and the second router is connected to the PC. So it's not direct I suppose. Also, how do I check if the router ports are 1G?

    Edit: Ethernet still doesn't work when I boot to a live USB and I'm running Ubuntu Desktop.

    –  Aug 15 '20 at 17:51
  • Look up the model # of your router(s) and look at the specs to see if the ports are 1G. Since the network didn't work when booting to a Ubuntu Live USB, then the problem is external to your computer. Try connecting the cat 5e cable from the computer, directly to the main router, and see if ethernet works then. Report back. – heynnema Aug 15 '20 at 17:55

3 Answers3

8

Router/cabling problem

modem--> main router--> secondary bridged router--> PC

Your ethernet link speed is only 100Mbs. It's capable of 1Gbs. Check that you're using cat 5e or cat 6 cables. Check that your routers support 1G LAN ports.

After moving the cat 5e cable from computer directly to your main router, from the secondary bridged router, ethernet now works. Check your configuration of the secondary router.

Netplan

Change your /etc/netplan/01-network-manager-all.yaml file to look like this:

network:
  version: 2
  renderer: NetworkManager

sudo netplan generate

sudo netplan apply

reboot

Then use the NetworkManager applet to connect to the "Wired Connection".

heynnema
  • 70,711
  • I connected the main router directly to the computer and it worked. Thanks –  Aug 15 '20 at 18:56
  • @EkremGulcan So the problem is with the configuration of the 2nd router. I'll update my answer. Go ahead and do the netplan part. Check your 2nd router config. – heynnema Aug 15 '20 at 19:16
  • 1
    Even when I connect the second router to another PC at home, the ethernet still doesn't work on my main computer. The cabling is like this: https://imgur.com/a/K5tKERg –  Aug 23 '20 at 09:01
  • @EkremGulcan Your Aug 15 comment indicated that when the second PC was connected to the main router, instead of the secondary router, it worked fine. Is the current problem with the second PC when connected to the secondary router? If so, we proved that there's probably a configuration problem on the secondary router. Please explain if I've got it wrong. – heynnema Aug 23 '20 at 10:19
  • The current problem is with the main PC again. –  Aug 23 '20 at 10:24
  • @EkremGulcan When connected to the main router? Edit your question and show me sudo lshw -C network from the main computer again. Did you try to manually reinstall the ethernet driver, as per the other answer? – heynnema Aug 23 '20 at 10:28
  • I updated the question and added the output of sudo lshw -C network And no, I didn't try to manually reinstall the ethernet driver. –  Aug 23 '20 at 10:44
  • And there is one more thing. It isn't much important but when I open a game on Windows I get a "Strict NAT detected" error. –  Aug 23 '20 at 11:03
  • I installed Linux Bash Shell on Windows 10 and wrote sudo lshw -c network again. The output: https://imgur.com/a/5gHODNr Also the output of ip a: https://imgur.com/a/cVcO5cC –  Aug 23 '20 at 13:00
  • @EkremGulcan Do you get the "Strict NAT detected" error when the 2nd router is not connected? The main PC only fails when the 2nd router is connected, correct? I'd check your uPnP, NAT, and DHCP settings. Your router configuration problem is very difficult to troubleshoot long distance. – heynnema Aug 23 '20 at 14:48
  • I get the "Strict NAT detected" error and the main PC only fails when the 2nd router is connected. –  Aug 23 '20 at 15:51
  • @EkremGulcan I'd check your uPnP, NAT, and DHCP settings. Your router configuration problem is very difficult to troubleshoot long distance. – heynnema Aug 23 '20 at 16:03
  • @EkremGulcan Google "how to connect two routers together"... see https://support.bluos.net/hc/en-us/articles/360000220927-Can-I-connect-two-routers-to-the-same-network-with-the-same-network-name- as an example. – heynnema Aug 23 '20 at 16:09
  • I changed the default getaway from "192.168.0.1" to "192.168.0.2", turned off dhcp, set up the wireless connection and did not set the router to bridge mode. Ethernet worked on Ubuntu, on my phone, on the second PC but I still get the "Strict NAT detected" error on the game on Windows. Did I do something wrong? –  Aug 23 '20 at 16:50
  • These are the second router's settings by the way –  Aug 23 '20 at 17:22
  • @EkremGulcan Sounds like you're getting closer. These 2nd router's static (or reserved DHCP in the main router) IP should be 192.168.0.2, and its gateway should point to 192.168.0.1 (main router IP). Bridge mode should be on. Is uPnP enabled on both routers? Google "strict NAT detected". – heynnema Aug 23 '20 at 17:27
  • How do I reserve DHCP? I don't have a static IP. –  Aug 23 '20 at 18:26
  • @EkremGulcan Google "dhcp reservation". In the main router, find the DHCP reservation page, and add the 2nd router's MAC address and the IP address that you wish to assign to it... 192.168.0.2. – heynnema Aug 23 '20 at 18:30
1

Try this:

Go to Settings-Network. With the Ethernet wire plugged in, on the Wired section, toggle the switch on.

Click on the little gear next to the switch and make sure that "Connect Automatically" is toggled on. You can find it on the Details tab.

Diatrix
  • 36
  • They're already toggled on. –  Aug 14 '20 at 16:48
  • Are you sure that it's properly plugged in? Is the internet router working properly? Do you have internet access on your windows partition with the same cable?

    Is there any change on the top right of your screen when you connect/disconnect the cable? Any errors?

    – Diatrix Aug 14 '20 at 16:53
  • I'm sure it's properly plugged in. As I stated in my question, I have no problem with the internet on Windows. –  Aug 14 '20 at 16:56
  • post the result of dmesg | grep wlan and then nmcli please – darth_epoxy Aug 15 '20 at 02:01
  • @darth_epoxy https://imgur.com/a/JD1CkcK –  Aug 15 '20 at 08:35
  • Try some of these answers https://askubuntu.com/questions/650953/intel-e1000e-ethernet-not-working although old the e1000e driver is still available from the official intel website if you need it. – darth_epoxy Aug 15 '20 at 09:30
  • @darth_epoxy They didn't work. Some solutions required me to use the command make install but it said I needed to install it first with sudo apt install make and I couldn't since I don't have an internet connection. –  Aug 15 '20 at 13:44
  • You need to transfer it from another PC then, https://packages.ubuntu.com/focal/make then make install in the src folder, then rmmod e1000e then modprobe e1000e and to make the new driver survive a reboot update-initramfs -u – darth_epoxy Aug 15 '20 at 22:10
1

I had the same exact issue as you did and this what I did to fix my problem.

Setup: First off, let me explain my setup. I have two routers, (Netgear R6400 and Netgear WNDR4000). My main router is the R6400 and my secondary router (WNDR4000) is setup as access point. My laptop running Ubuntu 20.04 is connected via ethernet to the secondary router (WNDR4000).

As you mentioned, your machine isn't able to connect to the internet when connected via ethernet to your secondary router, but when connected by ethernet to your main router, it works. I have this same exact issue with my setup. However, if I connect my windows laptop via ethernet to my secondary router, there are no problems.

What I found out is that its probably due to the DHCP in the router not being able to setup a ip address for your ubuntu machine. For some reason, ubuntu and my old router does not play along very well with my setup.

Fix: You will have to setup a static ip address on your ubuntu laptop. Its pretty simple. Just go to Settings > Network and under "Wired", click the settings icon. Select IPv4 and choose the "manual" option. Then fill in your static ip address. If you don't know what to put in for static ip address, then jump to the bottom paragraph. Don't forget to enter values for the routes field. Here are the values I used below (Yours will most likely be different):

Addresses: Address: 192.168.1.33 Netmask: 255.255.255.0 Gateway: 192.168.1.1

DNS: 192.168.1.25 (Your dns will be different)

Routes: Address: 192.168.1.1 Netmask: 0.0.0.0 Gateway: 192.168.1.1

After that, its not required, but I recommend going into your MAIN router settings and adding your static ip address into the address reservations to prevent it from possibly changing or taking the ip address you're using.

Static IP: For determining a static IP address, this can be done a number of ways. What I found worked for me was to first connect via wifi to my router and then going to the router settings (192.168.1.1) and grabbing the ip address of the laptop. Then you can disconnect from wifi and start entering the ip address into your ubuntu machine.

  • To the last answer the person put down... Here is a little FYI: Routers do not interlink with each other via LAN/USB, they only interlink if you set them up as a Network Hub. I just found this article about compatible routers, apparently my router that I currently have is 20 years old yet it still worked, I'll be upgrading that in time... – DJ Irish Panda May 16 '21 at 19:48