6

So after upgrading from Ubuntu 16.04 to 16.10 I noticed that my eth0 device had disappeared. My machine also doesn't connect to the network by default, and the connection is not shown in gnome's NetworkManager.

dmesg output reveals that the device has been renamed:

[    1.109498] igb 0000:26:00.0 enp38s0: renamed from eth0

and I can get the connection working by running ifconfig enp38s0 0.0.0.0 0.0.0.0 && dhclient.

From here, how do I

  • persist this so the connection is established automatically
  • get the device to show in NetworkManager

Already had a look in /etc/network/interfaces and neither eth0 nor enp38s0 are listed there.

6 Answers 6

18

A fresh install, to server 17.10 with LXDE had this issue reading all over and trying everything. This also prevented me from using openvpn via network manager.

The following fixed the issue:

My /etc/network/interfaces file: removed all lines except:

auto lo
iface lo inet loopback

Then I edited /etc/NetworkManager/NetworkManager.conf from:

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=true

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

Add in [keyfile] string

[keyfile]
unmanaged-devices=*,except:type:wifi,except:type:wwan,except:type:ethernet

Current /etc/NetworkManager/NetworkManager.conf

[main]
plugins=ifupdown,keyfile

[keyfile]  
unmanaged-devices=*,except:type:wifi,except:type:wwan,except:type:ethernet

[ifupdown]
managed=true

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

Last run command:

sudo service network-manager restart 

and all showed correctly in the network manger after a couple hours of fighting! This is for a home server, it may have been caused me configuring the IP during setup, which added values for a static IP in /etc/network/interfaces .

6
  • For me, all the interfaces in network manager disappeared. My system won't DHCP after reboot, although would run "dhclient" manually just fine. I tried reinstalling network manager, purging all the config files - nothing helped! Finally, this solution helped. Apr 18, 2019 at 2:33
  • Worked on Ubuntu 18.04 Feb 17, 2020 at 10:25
  • Thank you! It worked perfectly on a freshly installed Ubuntu 20.04 as well.
    – Gui Ambros
    May 26, 2020 at 3:10
  • Thank you. it did the magick!
    – kikea
    Oct 8, 2020 at 14:57
  • 1
    after hours of searching, this did the trick. thank you!
    – Wboy
    Jun 24, 2021 at 9:00
5

I had the same problem and just add ,except:type:ethernet to /etc/NetworkManager/NetworkManager.conf

result is :

[main]
plugins=ifupdown,keyfile

[keyfile]
unmanaged-devices=*,except:type:wifi,except:type:wwan,except:type:ethernet

[ifupdown]
managed=true
2
  • I don't have a [keyfile] section in my conf file. Would it still help to add this, or is the default likely to be OK?
    – mwfearnley
    May 7, 2019 at 9:19
  • Yes I think you can, if it cause problem just remove it. I'm running 18.04 and I don't use that anymore
    – yannux
    May 10, 2019 at 15:03
3

So I desperately tried to find the config issues in /etc/NetworkManager/ but didn't realise that /usr/lib/NetworkManager exists as well.

The problem was in /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf:

[keyfile]
unmanaged-devices=*,except:type:wifi,except:type:wwan

I ended up removing the file completely, quick reboot and all is working again.

1
  • My Ubuntu (16.04) doesn't seem to have a conf.d subfolder in the /usr/lib location, and the only file in the /etc conf.d folder is default-wifi-powersave-on.conf. Perhaps we're using different versions/distros?
    – mwfearnley
    May 7, 2019 at 9:17
0

Performing sudo apt update caused ethernet to not show in networks widget, but network connections via ethernet continued to work. This was when /var/log/apt showed:

Preparing to unpack .../linux-firmware_1.187.10_all.deb ...
Unpacking linux-firmware (1.187.10) over (1.187.9) ...
Preparing to unpack .../python3-pil_7.0.0-4ubuntu0.3_amd64.deb ...
Unpacking python3-pil:amd64 (7.0.0-4ubuntu0.3) over (7.0.0-4ubuntu0.2) ...
Setting up linux-firmware (1.187.10) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-66-generic
update-initramfs: Generating /boot/initrd.img-5.4.0-65-generic
Setting up python3-pil:amd64 (7.0.0-4ubuntu0.3) ...
Log ended: 2021-03-11  13:11:10

I edited /etc/NetworkManager/NetworkManager.conf from:

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=true      #Fixed this: This was "false" <<<<<<<<<

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

And I Added the missing [keyfile] plus devices string <<<<<<:

[keyfile]
unmanaged-devices=*,except:type:wifi,except:type:wwan,except:type:ethernet

then I restarted NetworkManager and problem resolved. Problem was caused by linux-firmware update

0

[keyfile] unmanaged-devices=*,except:type:wifi,except:type:wwan,except:type:ethernet

This solved the problem for me.

Ubuntu 20.04.3 LTS, AMD Ryzen 3900 in a Laptop.

Cheers

0
0

A lack of the [keyfile] entry seemed to be the issue for me on Kali 2022 running on a RasPi 4, exactly as suggested by other answers here (so kudos to the answers above!).

However, editing the NetworkManager.conf file can only be considered a short-term solution as that file might be replaced/updated in a package update. Even though your package manager may alert you to the conflict - apt usually does - rather play it safe. The more stable solution would be to use the existing /etc/NetworkManager/conf.d directory and place your custom configuration in there. (Note: This is the configuration directory for a modern version of NetworkManager and yours may not be the same! Run NetworkManager --print-config to see where your NetworkManager configuration files are)

Call the file whatever you want, I opted for 99-keyfile-fix.conf, just make sure it ends in .conf. All you need to add in there is the [keyfile] lines, so:

[keyfile]
unmanaged-devices=*,except:type:wifi,except:type:wwan,except:type:ethernet

Save the file and issue systemctl restart NetworkManager (or service NetworkManager restart if you are still using that) and when NetworkManager re-ups, you should see your connections in there again.

As a little extra tip, if you're doing this on a desktop you can omit except:type:wifi if your desktop doesn't have a WiFi device. Similarly, if you don't have an Ethernet-capable device (in which case you might have landed on the wrong AskUbuntu answer anyway!) you can omit the except:type:ethernet.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .