1

I'm using a Thinkpad docking station with a Thinkpad T480s, which runs Ubuntu 20.04.

The docking station is connected via Ethernet.

I have wired connection, wifi and also mobile broadband configured to connect automatically via sudo nm-connection-editor. Also, I give the wired connection priority 2, the wifi priority 1 and the broadband connection priority 0.

When I'm connected to the docking station, it usually runs on wired, but all of a sudden it changes to wifi and then back after a couple of seconds, always resulting in a short connection loss, which is especially annoying when on a video call. I also have the feeling that it happens more often during video calls, but here I might be biased.

How could that be? It happens at home and also in the office, at both places I'm using the same docking station.

Haven't tried connecting the Ethernet cable directly to the laptop though..

UPDATE: Here's a view of the logs (sudo journalctl -b 0 -u NetworkManager -p 7):

Feb 17 10:53:24 xxx-5 NetworkManager[357866]: <info>  [1645091604.0138] policy: set 'Sunrise' (wwan0) as default for IPv4 routing and DNS
Feb 17 10:53:24 xxx-5 NetworkManager[357866]: <info>  [1645091604.7573] manager: NetworkManager state is now CONNECTED_GLOBAL
Feb 17 10:53:24 xxx-5 NetworkManager[357866]: <info>  [1645091604.7590] policy: set 'xxx-x' (wlp61s0) as default for IPv4 routing and DNS
Feb 17 10:58:44 xxx-5 NetworkManager[357866]: <info>  [1645091924.3914] manager: NetworkManager state is now CONNECTED_SITE
Feb 17 10:58:44 xxx-5 NetworkManager[357866]: <info>  [1645091924.3926] manager: NetworkManager state is now CONNECTED_LOCAL
Feb 17 10:58:44 xxx-5 NetworkManager[357866]: <info>  [1645091924.3929] manager: NetworkManager state is now CONNECTED_SITE
Feb 17 10:58:44 xxx-5 NetworkManager[357866]: <info>  [1645091924.3931] policy: set 'Sunrise' (wwan0) as default for IPv4 routing and DNS
Feb 17 10:58:53 xxx-5 NetworkManager[357866]: <info>  [1645091933.8794] manager: NetworkManager state is now CONNECTED_GLOBAL
Feb 17 10:58:53 xxx-5 NetworkManager[357866]: <info>  [1645091933.8809] policy: set 'xxx-x' (wlp61s0) as default for IPv4 routing and DNS
Feb 17 10:59:55 xxx-5 NetworkManager[357866]: <info>  [1645091995.6824] policy: set 'xxx-x ethernet via usb-c' (enx083a885a6802) as default for IPv4 routing and DNS

So in this period depicted above (~6mins), the network switched from mobile broadband to Wifi to mobile broadband to Wifi and then to Ethernet. But that's all the info I get, no errors or anything. There doesn't seem to be any debug messages.

UPDATE: I made sure my Thunderbolt 3 Dock runs the latest available firmware. According to fwupdmgr, I'm running version 56.00

20L7001NMZ
│
├─ThinkPad Thunderbolt 3 Dock:
│ │   Device ID:          c1ab0998129c6116e14b27922063a6285c110599
│ │   Current version:    56.00
│ │   Vendor:             Lenovo (THUNDERBOLT:0x0108, TBT:0x0108)

If I run fwupdmgr get-updates, I see that it is the latest available:

Devices with no available firmware updates: 
 • ThinkPad Thunderbolt 3 Dock

However there seem to be a couple of newer firmware updates which are not yet available through fwupdmgr: https://download.lenovo.com/pccbbs/mobiles/trdockfw3180_readme.txt None of them mention anything wrt Ethernet though.

7
  • Look at the logs! sudo journalctl -b 0 -u NetworkManager. Read man journalctl.
    – waltinator
    Feb 16, 2022 at 14:33
  • Thanks - I'll note down when it happens and post here what the log says.
    – grssnbchr
    Feb 16, 2022 at 16:06
  • Check for a firmware update for the docking station.
    – heynnema
    Feb 16, 2022 at 16:35
  • I updated the post with the logs. Anything useful? (not to me...)
    – grssnbchr
    Feb 17, 2022 at 10:05
  • Did you check the firmware as I suggested two days ago?
    – heynnema
    Feb 19, 2022 at 15:03

4 Answers 4

1

I had a problem last year:

The solution there could work for you:


A script that automatically disables WiFi when Ethernet (Network) is connected:

#!/bin/bash
export LC_ALL=C

enable_disable_wifi ()
{
    result=$(nmcli dev | grep "ethernet" | grep -w "connected")
    if [ -n "$result" ]; then
        nmcli radio wifi off
    else
        nmcli radio wifi on
    fi
}

if [ "$2" = "up" ]; then
    enable_disable_wifi
fi

if [ "$2" = "down" ]; then
    enable_disable_wifi
fi

The script has to be created in a specific directory. After creation mark it executable:

chmod a+x /etc/NetworkManager/dispatcher.d/70-wifi-wired-exclusive.sh
1
  • This seems like to be the best and pragmatic solution. It works out of the box. I first tried a hack that would detect whether I'm connected to the dock, but that only worked half-way. gist.github.com/seanf/e3be5bf745395d50e975 Let me thoroughly test and then I'll accept your answer. Thanks!
    – grssnbchr
    Feb 23, 2022 at 14:17
0

Do you have a WiFi with 2.4GHz and 5GHz active on the same name / SSID? Had a similar issue (without the broadband) where it switched from wireless to wired because it tried to switch from 2.4GHz to 5GHz. But somehow the driver and/or hardware got a timeout and the network manager switched to wired instead. --> I now use two separate SSIDs for the wireless networks

0

Under normal use in most cases Ubuntu will prioritize the connection with the best bandwidth and latency: assumed Ethernet first, then WiFi, then Wlan. If for some reason one of these connections are not stable enough; as in the example mentioned by Raven above, it will switch to the connection that is stable. Do check the routing table to see the priorities of what interface is used (sudo apt install net-tools then use the route command). Please note that you can simply turn off WiFi in the Gnome settings or in the Gnome drop down menu in the upper right corner; alternatively in the KDE panel's network icon: witch would force the use of the Ethernet. Same goes for the Wlan. I you do not want to operate like this; at least this would let you see if the Ethernet connection may have an issue intermittently, that could simply be a hardware fault.

-1

Are you trying to get wireless, or wired. If you want wireless, try connecting to wired then going to additional drivers and installing a wireless driver. If you want wired, try going to the file /etc/NetworkManager/NetworkManager.conf, then change managed=false to managed=true. After that, run sudo service network-manager restart in the terminal.

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.