NetworkManager uses tethered Android phone as ethernet connection instead of wired ethernet connection

Bug #1975549 reported by Jeffrey Walton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
New
Low
Unassigned

Bug Description

I'm running Kubuntu 22.04 LTS, x86_64, fully patched. I've been having trouble the last week or two ssh'sing into the machine, and printing from the machine when I am sitting at the keyboard. I also could not connect to my external firewall when sitting at the keyboard.

I keep a Google Pixel 4a tethered to the USB hub for charging. The Android phone is running Android 12, and the phone is set to "USB Tethering". The phone is fully patched, too.

I found if I reboot the machine with the phone tethered, then the machine uses the Android phone as the ethernet connection. It literally calls the connection "ethernet", as if it was using the network adapter. This is new behavior over the last week or two.

This is unexpected behavior for three reasons. First, it is new behavior. Second, the wired gigabit ethernet connection is not used by default. And thrid, the Android phone's connection is called "ethernet" instead of something more meaningful like "USB" or "Android" or "wired hotspot".

The third item ("ethernet" name when using Android phone) was misleading enough to waste a lot of time troubleshooting the issue. I thought I had an odd firewall issue or a mDNS issue.

The reason I was having so many troubles, like printing and ssh, is the Android phone uses Wifi and it is on a different VLAN and subnet to keep traffic segregated from my trusted internal network.

-----

It looks like I am running network-manager via systemd:

# service systemd-networkd status
● systemd-networkd.service - Network Service
     Loaded: loaded (/lib/systemd/system/systemd-networkd.service; disabled; vendor prese>
     Active: inactive (dead)
       Docs: man:systemd-networkd.service(8)
# service network-manager status
● NetworkManager.service - Network Manager
     Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: >
     Active: active (running) since Mon 2022-05-23 21:16:52 EDT; 59min ago
       Docs: man:NetworkManager(8)
   Main PID: 928 (NetworkManager)
      Tasks: 3 (limit: 76693)
     Memory: 12.0M
     CGroup: /system.slice/NetworkManager.service
             └─928 /usr/sbin/NetworkManager --no-daemon
  ...
---
ProblemType: Bug
ApportVersion: 2.20.11-0ubuntu27.24
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: KDE
DistroRelease: Ubuntu 20.04
InstallationDate: Installed on 2022-02-05 (107 days ago)
InstallationMedia: Kubuntu 20.04.3 LTS "Focal Fossa" - Release amd64 (20210819.1)
IpRoute:
 default via 172.16.1.1 dev enp4s0 proto dhcp metric 100
 169.254.0.0/16 dev enp4s0 scope link metric 1000
 172.16.0.0/12 dev enp4s0 proto kernel scope link src 172.16.2.10 metric 100
Package: network-manager 1.22.10-1ubuntu2.3
PackageArchitecture: amd64
ProcVersionSignature: Ubuntu 5.13.0-44.49~20.04.1-generic 5.13.19
Tags: focal
Uname: Linux 5.13.0-44-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dialout dip lpadmin lxd plugdev sambashare sudo
_MarkForUpload: True
nmcli-con:
 NAME UUID TYPE TIMESTAMP TIMESTAMP-REAL AUTOCONNECT AUTOCONNECT-PRIORITY READONLY DBUS-PATH ACTIVE DEVICE STATE ACTIVE-PATH SLAVE FILENAME
 Ethernet 5d31ea14-c1cd-318f-a982-09ce6723dadb ethernet 1653403311 Tue 24 May 2022 10:41:51 AM EDT yes -100 no /org/freedesktop/NetworkManager/Settings/1 yes enp4s0 activated /org/freedesktop/NetworkManager/ActiveConnection/4 -- /etc/NetworkManager/system-connections/Ethernet.nmconnection
nmcli-nm:
 RUNNING VERSION STATE STARTUP CONNECTIVITY NETWORKING WIFI-HW WIFI WWAN-HW WWAN
 running 1.22.10 connected started full enabled enabled enabled enabled enabled
---
ProblemType: Bug
ApportVersion: 2.20.11-0ubuntu27.24
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: KDE
DistroRelease: Ubuntu 20.04
InstallationDate: Installed on 2022-02-05 (108 days ago)
InstallationMedia: Kubuntu 20.04.3 LTS "Focal Fossa" - Release amd64 (20210819.1)
IpRoute:
 default via 192.168.11.111 dev usb0 proto dhcp metric 100
 169.254.0.0/16 dev usb0 scope link metric 1000
 192.168.11.0/24 dev usb0 proto kernel scope link src 192.168.11.182 metric 100
Package: network-manager 1.22.10-1ubuntu2.3
PackageArchitecture: amd64
ProcVersionSignature: Ubuntu 5.13.0-44.49~20.04.1-generic 5.13.19
Tags: focal
Uname: Linux 5.13.0-44-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dialout dip lpadmin lxd plugdev sambashare sudo
_MarkForUpload: True
nmcli-con:
 NAME UUID TYPE TIMESTAMP TIMESTAMP-REAL AUTOCONNECT AUTOCONNECT-PRIORITY READONLY DBUS-PATH ACTIVE DEVICE STATE ACTIVE-PATH SLAVE FILENAME
 Ethernet 5d31ea14-c1cd-318f-a982-09ce6723dadb ethernet 1653492598 Wed 25 May 2022 11:29:58 AM EDT yes -100 no /org/freedesktop/NetworkManager/Settings/1 yes usb0 activated /org/freedesktop/NetworkManager/ActiveConnection/2 -- /etc/NetworkManager/system-connections/Ethernet.nmconnection
nmcli-nm:
 RUNNING VERSION STATE STARTUP CONNECTIVITY NETWORKING WIFI-HW WIFI WWAN-HW WWAN
 running 1.22.10 connected started full enabled enabled enabled enabled enabled

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report, could you do

$ apport-collect 1975549

on the machine at the time you are having the issue?

Changed in network-manager (Ubuntu):
status: New → Incomplete
Revision history for this message
Jeffrey Walton (noloader) wrote : CRDA.txt

apport information

tags: added: apport-collected focal
description: updated
Revision history for this message
Jeffrey Walton (noloader) wrote : Dependencies.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : IpAddr.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : IwConfig.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : NetDevice.enp4s0.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : NetDevice.lo.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : NetDevice.usb0.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : NetDevice.wlp3s0.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : NetworkManager.conf.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : PciNetwork.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : ProcEnviron.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : RfKill.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : WifiSyslog.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : nmcli-dev.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote :

> Thank you for your bug report, could you do
>
> $ apport-collect 1975549
>
> on the machine at the time you are having the issue?

Thanks Sebastien.

This caught my eye (from the apport generated files):

   Android phone:

   * ID_NET_LINK_FILE=/usr/lib/systemd/network/73-usb-net-by-mac.link

   NIC adapter:

   * ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link

I can envision a situation where 73 is given higher precedence than 99.

What I don't know is, why things changed recently (assuming they were the same way in the past).

Revision history for this message
Sebastien Bacher (seb128) wrote :

It's a bit weird, https://launchpadlibrarian.net/602981658/nmcli-dev.txt shows no connection associated to the usb device nor IP for it

Changed in network-manager (Ubuntu):
status: Incomplete → New
Revision history for this message
Jeffrey Walton (noloader) wrote :

> It's a bit weird, https://launchpadlibrarian.net/602981658/nmcli-dev.txt
> shows no connection associated to the usb device nor IP for it

Thanks again Sebastien.

This may be because I booted the machine with the phone unplugged.

I can run apport again with the phone plugged in (and then reboot) to duplicate the issue.

Would you like me to run apport again after booting with the phone plugged in?

Revision history for this message
Sebastien Bacher (seb128) wrote :

yes, the current details are about a working system but we want to work on the bug

Revision history for this message
Jeffrey Walton (noloader) wrote : CRDA.txt

apport information

description: updated
Revision history for this message
Jeffrey Walton (noloader) wrote : Dependencies.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : IpAddr.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : IwConfig.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : NetDevice.enp4s0.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : NetDevice.lo.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : NetDevice.usb0.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : NetDevice.wlp3s0.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : NetworkManager.conf.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : PciNetwork.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : ProcEnviron.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : RfKill.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : WifiSyslog.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote : nmcli-dev.txt

apport information

Revision history for this message
Jeffrey Walton (noloader) wrote :

> Sebastien Bacher wrote:
>
> yes, the current details are about a working system but we want to work on the bug

Thanks again Sebastien.

I rebooted the machine with the phone tethered and it used USB0 as the network adapter. I then ran 'apport-collect 1975549'.

Here is the current nmcli when running the command in its current state (boot with phone tethered):

$ nmcli
usb0: connected to Ethernet
        "Google Nexus 4/5/7/10"
        ethernet (rndis_host), 82:1F:DF:52:0B:39, hw, mtu 1500
        ip4 default
        inet4 192.168.11.182/24
        route4 0.0.0.0/0
        route4 192.168.11.0/24
        route4 169.254.0.0/16
        inet6 fe80::801f:dfff:fe52:b39/64
        route6 fe80::/64

enp4s0: disconnected
        "Qualcomm Atheros Killer E2400"
        1 connection available
        ethernet (alx), D8:9E:F3:92:24:60, hw, mtu 1500

wlp3s0: disconnected
        "Qualcomm Atheros QCA9377"
        wifi (ath10k_pci), 90:32:4B:76:E0:B9, hw, mtu 1500

p2p-dev-wlp3s0: disconnected
        "p2p-dev-wlp3s0"
        wifi-p2p, hw

lo: unmanaged
        "lo"
        loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536

DNS configuration:
        servers: 192.168.11.111
        interface: usb0

Use "nmcli device show" to get complete information about known devices and
"nmcli connection show" to get an overview on active connection profiles.

Consult nmcli(1) and nmcli-examples(7) manual pages for complete usage details.

Revision history for this message
Jeffrey Walton (noloader) wrote :

Sebastien, do you know how I can mark my ethernet connection as the default one? The ethernet connection I want to set as default is the wired ethernet, which is enp4s0 in the dumps shown above.

I cannot find a setting in the Settings program to set a default connection. I also cannot find a discussion of it in the docs.[1,2] The docs only say the program usually picks the right one:[1]

    In most cases the wired network connection will simply work
    without any changes to the default Kubuntu configuration.
    Wired network connections are selected as default when they
    are available.

(And it is not picking a wired connection as stated in the docs. It is picking a Wifi connection via the Android phone).

[1] https://userbase.kde.org/Kubuntu/Basic/en#Networking
[2] https://userbase.kde.org/NetworkManagement

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the details. I'm unsure about your question, you might have a better chance asking directly upstream on https://gitlab.freedesktop.org/NetworkManager/NetworkManager ?

Changed in network-manager (Ubuntu):
importance: Undecided → Low
To post a comment you must log in.