6

When I am on wifi and then plug in the Ethernet cable the internet connection switches to the latter (three-box symbol), but after pause it is back to wifi and I do not know how to return to Ethernet (which I want since much faster). Unplugging and reconnecting the cable doesn't affect the selection of wifi. I only found older (pre-18.04) recipes that do not work.

I switched wifi off, took USB-C adapter out and back in, got network icon symbol, am on network (500 Mbps download) but the icon symbol changed to ?.

Output of sudo lshw -C network

  *-network DISABLED        
       description: Wireless interface
       product: Wireless 8265 / 8275
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlp2s0
       version: 78
       serial: f8:34:41:49:8c:e3
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=5.0.0-29-generic firmware=36.9f0a2d68.0 latency=0 link=no multicast=yes wireless=IEEE 802.11
       resources: irq:135 memory:d0000000-d0001fff
  *-network:0 DISABLED
       description: Ethernet interface
       physical id: 3
       logical name: wwp0s20f0u2i12
       serial: 12:c1:b8:08:68:e9
       capabilities: ethernet physical
       configuration: broadcast=yes driver=cdc_mbim driverversion=22-Aug-2005 firmware=CDC MBIM link=no multicast=yes
  *-network:1
       description: Ethernet interface
       physical id: 4
       logical name: enx0050b692363f
       serial: 00:50:b6:92:36:3f
       size: 1Gbit/s
       capacity: 1Gbit/s
       capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8152 driverversion=v1.09.9 duplex=full ip=192.168.178.10 link=yes multicast=yes port=MII speed=1Gbit/s
  • If you right click on the Network symbol does it not give you options? – graham Sep 28 '19 at 09:28
  • 2
    This question was already answered here. – joelac Sep 28 '19 at 09:32
  • 4
    the problem is likely something else: if the wired network drops it will automatically switch to wireless. So I would assume you got a network related problem when wired. This has nothing to do with "priority": priority only kicks in when 2 or more methods are available. You seem to end up with ONE: wireless. – Rinzwind Sep 28 '19 at 09:32
  • @Graham: both left and rightclick on wifi symbol gives no ethernet options, only wifi + poweroff etc. – Rob Rutten Sep 28 '19 at 18:32
  • @joelac: I installed and restarted but still route is unknown. – Rob Rutten Sep 28 '19 at 18:40
  • @rinzwind: can it be my Toshiba Travel Adaptor connecting Ethernet to USB-C? My coax server improved to 500 Mbps recently. The wireless from the same cable is utterly stable but 10x slower in download. – Rob Rutten Sep 28 '19 at 18:43
  • usb? usb can turn itself off. maybe check your bios on that :) – Rinzwind Sep 28 '19 at 19:02
  • Bios checking is beyond me but I found question 905552 and followed that: sudo emacs -nw /etc/network/interface, added line: auto eth0 iface eth0 inet dhcp. That seems to work! Got "wired connected" back in the connection symbol which is now back to the three-box cable one. After pause (laptop closure) it is still there. Speed indeed 500 Mbps. Maybe I lost this line sometime when tinkering with VPN? I do hope this is it! ps - sorry, I can't type returns in here apparently. – Rob Rutten Sep 28 '19 at 19:36
  • No, this wasn't it. Now, 15 min later, it went back to wifi all by itself and the wifi symbol dropdown doesn't show network anymore. Alas. – Rob Rutten Sep 28 '19 at 19:50
  • @Rob Rutten The changes you do with ifmetric are not keept after restart. – joelac Sep 28 '19 at 18:58
  • @user68186 Should I? It was a genuine question bothering me much for two months and had useful reactions. Won't others have the same and so get pointed at their hardware? – Rob Rutten Dec 02 '19 at 18:26
  • 1
    @RobRutten If you don't delete the question. Please accept your answer as the correct one by clicking on the check mark and make it green. You may have to wait a few hours. This will help others. – user68186 Dec 02 '19 at 18:58
  • @user68186. I tried but got flag "you can't vote on your own question". What now? Delete? – Rob Rutten Dec 03 '19 at 20:34
  • Not question but post. 5-min limit killed me again. Can you add it was hardware? – Rob Rutten Dec 03 '19 at 20:41
  • 1
    @user68186. Sorry! Done now. – Rob Rutten Dec 04 '19 at 10:17

3 Answers3

14

Open the terminal application and type:

nm-connection-editor

On the window that opens, select your Wired Connection and click the gear icon at the bottom of the window to edit it. You need to select the General tab, enable "Connect automatically with priority", and change the priority to 1. This will prioritize the ethernet connection.

Understand that:

  • Ubuntu normally auto-selects the connection with the best performance.

  • If you have an ethernet connectivity problem, that would explain why your connections keep on switching.

  • Check that your USB-C port doesn't power itself down at idle... you may have to check BIOS settings for that.

enter image description here

heynnema
  • 70,711
  • thanks! But the nm-connection-editor window only shows wifi (current and past names). The ethernet light on the connector on my Toshiba Travel Aadaptor is green. Seems I should suspect that box? – Rob Rutten Sep 29 '19 at 09:20
  • @heyennema: Aha, I now restarted the laptop (Toshiba) and now have Wired connection in the manager window. I followed your recipe; the priority setting was -999, changed it to 1. The icon remained the curved wifi symbol but the speed is 500 Bps so via the cable. Now hope it stays! Aha, now (minutes later) the icon became the three-box cable one. – Rob Rutten Sep 29 '19 at 09:37
  • @RobRutten remember to undo the changes you made to /etc/network/interfaces. Also, please accept my answer if it was helpful. Thanks! – heynnema Sep 29 '19 at 14:59
  • @heyennema: next morning here. Reopen laptop. Laptop is on wifi, wifi symbol does not show network. I had removed that line in /etc/network/interfaces. I restarted laptop, again on wifi but now showing "network connected", after two minutes it switched to network. I checked nm-connection-editor, changes still there. Not there yet... – Rob Rutten Sep 30 '19 at 08:02
  • By the way, in case some Stack overseer sees this, I find typing such comments very hard. I have emacs habits and type returns all the time. I then get thrown out with an incomplete comment. Luckiily I may edit but often 5 min is too short for me. – Rob Rutten Sep 30 '19 at 08:07
  • @RobRutten Since your ethernet adapter is connected via your USB-C port, check your BIOS for a USB power setting. There should be one that keeps power to that port all the time. If you disconnect the wi-fi, disconnect the ethernet adapter, plug in the ethernet adapter, how long does it take to actually connect you to the Internet? – heynnema Sep 30 '19 at 14:36
  • @RobRutten status please... – heynnema Oct 03 '19 at 13:00
  • Sorry for silence. Two nightly halts after restart it went back to wireless and stayed there without mentioning network. I was waiting for an expert family member visit to check the bios (I don't dare ). But my moise shares that adaptor and works without interruptions. Your tirck above: switch wifi off, adaptor out, adaptor in: immediately on network! This is quick and esay to do, better than restart, so I will rely on this for now. Thanks! – Rob Rutten Oct 05 '19 at 08:23
  • Again thrown out at 5 min editing. moise = mouse, tirck = trick, esay = easy. – Rob Rutten Oct 05 '19 at 08:30
  • alas - network went off after 20 min. Wireless still off so my internet connection died. Plug adaptor out-in restored network immediately - but so still too flaky. – Rob Rutten Oct 05 '19 at 08:49
  • Hour later I again lost network, after adaptor out and in I now also lost my mouse and that also didn't work with another (USB multiplier) adaptor in the other USB-C port. Restart didn't work, needed hard kill per power button. Your BIOS idea gets more likely... – Rob Rutten Oct 05 '19 at 10:49
  • @RobRutten when the ethernet is working, edit your question and show me sudo lshw -C network. – heynnema Oct 05 '19 at 14:12
  • @RobRutten what is the wwp0s20f0u2i12 interface? Its got a driver from 2005. – heynnema Oct 24 '19 at 13:25
  • Our expert son visited and checked your suggestions. wwp0s20f0u2i12 is for gsm but I don't use that, no sim card. He found nothing in the BIOS. He enabled USB power on sleep, no difference. When on network cable with wifi off ethernet goes off after a few minutes, switches itself on after a second at request for website. Every few hours goes dead altogether, needing USB adapter pull-out and back in. The cable is cat3a, I tried another one, no difference. Now wonder about the Toshiba USB-C adapter (PA5272U-2PRP). Hesitate on a new one, they are expensive. – Rob Rutten Oct 28 '19 at 09:13
  • @heynnema It looks like OP found the problem to be hardware related. See answer below. – user68186 Dec 04 '19 at 16:02
2

It was hardware: my Toshiba USB-C Travel adaptor (PA5272U-2PRP). The problem persisted many weeks in which I worked mostly on wifi. After much hesitation (expense) I bought a similar adaptor: Goobay USB-C Premium Multiport dock. It works flawlessly.

0

When you plug in your Ethernet cable, turn on Airplane Mode. The wireless network will not be used. When you unplug the Ethernet cable, turn off Airplane Mode.

Airplane Mode is a setting that is easily toggled on and off in Ubuntu using just a few clicks.

For GNOME, open your Wi-Fi settings and switch "Airplane Mode" to ON

See also: Turn Airplane Mode on/off via terminal

You are probably searching for an automated solution, but this is a solution nonetheless that will work 100% (and there's nothing automated about physically connecting and disconnecting an Ethernet cable anyway)

Nmath
  • 12,333