1

The issue is that when I add a usb ethernet device, network manager doesn't create a new connection for the added device. It correctly manages it but it is stuck in the disconnected state until you manually add a connection with network manager. This is not how a regular install behaves which has network manager creating connections in memory and attaching it to the device you just plugged in.

I installed ubuntu using the alternative installer and use a preseed file to set up the machine. In the preseed file we install all the packages for the ubuntu desktop and a few others. This may be related to the issues. Possibly relevant sections of the preseed file, everything else is related to partitioning and encryption.

d-i netcfg/choose_interface select auto
tasksel tasksel/first multiselect ubuntu-desktop
d-i pkgsel/include string ssh build-essential python-minimal ubuntu-desktop vim

The reason for installation this way is beyond this question. It can be changed but this bug effects devices that have already been setup this way and fixing them can't be "reinstall".

An example of nmcli output when there is a ethernet connection on the motherboard and two usb ethernet connections.

eno1: connected to netplan-eno1

enx8cae4cfea138: connected to Wired connection 1

enx00e08f005933: disconnected
        "Realtek USB 10/100/1000 LAN"
        1 connection available
        ethernet (r8152), 00:E0:8F:00:59:33, hw, mtu 1500

It seems somewhere during the install, network manager creates 'Wired Connection 1' in /etc/NetworkManager/system-connections/ which it then applies it to any connected usb device. eno1 seems to be using something that netplan generates. I'm not sure where I should be looking for all of this, the mix of netplan, networkmanager and systemd-networkd that this Frankenstein machine results in is a bit confusing but here are some relevant config files. These are untouched from a fresh install.

/etc/NetworkManager/NetworkManager.conf

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

[device]
wifi.scan-rand-mac-address=no

/etc/NetworkManager/system-connections/Wired connection 1

[connection]
id=Wired connection 1
uuid=5da83520-ee6d-4e0a-a21d-27d0c9eb5b77
type=802-3-ethernet

[802-3-ethernet]

[ipv4]
method=auto

[ipv6]
method=auto
ip6-privacy=2

/etc/netplan/01-netcfg.yml

# This file describes the network interfaces available on your system
# For more information, see netplan(5)
network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: yes

/etc/netplan/01-network-manager-all.yaml

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

/var/run/NetworkManager/system-connections/netplan-eno1

[connection]
id=netplan-eno1
type=ethernet
interface-name=eno1

[ethernet]
wake-on-lan=0

[ipv4]
method=auto

[ipv6]
method=ignore

/etc/network/interface

source-directory /etc/network/interfaces.d

and interfaced.d is an empty directory.

NetworkManager is an enabled service and systemd-networkd is not enable.

Journalctl from network manager when I plug the usb ethernet into the device when it fails to assign it a connection.

Aug 09 15:06:25 <computer> NetworkManager[1011]: <info>  [1565388385.0741] manager: (eth0): new Ethernet device (/org/freedesktop/NetworkManager/Devices/8)
Aug 09 15:06:25 <computer> NetworkManager[1011]: <info>  [1565388385.1246] devices added (path: /sys/devices/pci0000:00/0000:00:14.0/usb2/2-8/2-8.1/2-8.1:1.0/net/enx8cae4ce9dc04, iface: enx8cae4ce9dc04)
Aug 09 15:06:25 <computer> NetworkManager[1011]: <info>  [1565388385.1246] device added (path: /sys/devices/pci0000:00/0000:00:14.0/usb2/2-8/2-8.1/2-8.1:1.0/net/enx8cae4ce9dc04, iface: enx8cae4ce9dc04): no ifupdown configuration found.
Aug 09 15:06:25 <computer> NetworkManager[1011]: <info>  [1565388385.1247] device (enx8cae4ce9dc04): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Aug 09 15:06:28 <computer> NetworkManager[1011]: <info>  [1565388388.4869] device (enx8cae4ce9dc04): carrier: link connected
Aug 09 15:06:28 <computer> NetworkManager[1011]: <info>  [1565388388.4897] device (enx8cae4ce9dc04): state change: unavailable -> disconnected (reason 'carrier-changed', sys-iface-state: 'managed')

Journalctl from network manager when I plug the usb device into my own destkop.

Aug 09 15:04:25 <computer> NetworkManager[2382]: <info>  [1565388265.0379] manager: (eth0): new Ethernet device (/org/freedesktop/NetworkManager/Devices/11)
Aug 09 15:04:25 <computer> NetworkManager[2382]: <info>  [1565388265.0961] devices added (path: /sys/devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0/net/enx8cae4ce9dc04, iface: enx8cae4ce9dc04)
Aug 09 15:04:25 <computer> NetworkManager[2382]: <info>  [1565388265.0961] device added (path: /sys/devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0/net/enx8cae4ce9dc04, iface: enx8cae4ce9dc04): no ifupdown configuration found.
Aug 09 15:04:25 <computer> NetworkManager[2382]: <info>  [1565388265.0964] device (enx8cae4ce9dc04): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Aug 09 15:04:25 <computer> NetworkManager[2382]: <info>  [1565388265.4268] keyfile: add connection in-memory (15600b6f-63ad-37ae-9f6c-2f2e28f05489,"Wired connection 4")
Aug 09 15:04:25 <computer> NetworkManager[2382]: <info>  [1565388265.4272] settings: (enx8cae4ce9dc04): created default wired connection 'Wired connection 4'
Aug 09 15:04:28 <computer> NetworkManager[2382]: <info>  [1565388268.5839] device (enx8cae4ce9dc04): carrier: link connected
Aug 09 15:04:28 <computer> NetworkManager[2382]: <info>  [1565388268.5877] device (enx8cae4ce9dc04): state change: unavailable -> disconnected (reason 'carrier-changed', sys-iface-state: 'managed')
Aug 09 15:04:28 <computer> NetworkManager[2382]: <info>  [1565388268.5899] policy: auto-activating connection 'Wired connection 4'
Aug 09 15:04:28 <computer> NetworkManager[2382]: <info>  [1565388268.5926] device (enx8cae4ce9dc04): Activation: starting connection 'Wired connection 4' (15600b6f-63ad-37ae-9f6c-2f2e28f05489)
Aug 09 15:04:28 <computer> NetworkManager[2382]: <info>  [1565388268.5935] device (enx8cae4ce9dc04): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Aug 09 15:04:28 <computer> NetworkManager[2382]: <info>  [1565388268.5949] device (enx8cae4ce9dc04): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Aug 09 15:04:28 <computer> NetworkManager[2382]: <info>  [1565388268.5961] device (enx8cae4ce9dc04): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Aug 09 15:04:28 <computer> NetworkManager[2382]: <info>  [1565388268.5972] dhcp4 (enx8cae4ce9dc04): activation: beginning transaction (timeout in 45 seconds)
Aug 09 15:04:28 <computer> NetworkManager[2382]: <info>  [1565388268.6012] dhcp4 (enx8cae4ce9dc04): dhclient started with pid 25848
Aug 09 15:04:28 <computer> dhclient[25848]: DHCPREQUEST of 10.15.1.104 on enx8cae4ce9dc04 to 255.255.255.255 port 67 (xid=0x46cb0eef)

It's the "Creating connection in memory" line that is missing from the device logs. Is there some setting I'm missing to set for network manager that enables it to do that?

1
  • Is this a bug? It seems like a misconfiguration on my part. – Erik Aug 9 '19 at 22:50
1

I was also getting the "carrier-changed" error causing frequent disconnects to my Ethernet connection.

I solved the issue by upgrading a CAT5 cable to a CAT7 cable (10 meter run)

Apparently, the old CAT5 cable couldn't handle my ISP's upgraded speeds (Virgin Media, UK). The new CAT7 cable has not only stopped the dropouts, but also now allows the speed to auto-configure from 100Mb/s to 1000Mb/s. Hope that helps anyone looking to fix "carrier-changed" errors.

0

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.