56

I am using Ubuntu 16.10 and recently I have not been able to connect to internet using Ethernet. The network manager shows device not managed. The WiFi network is working fine.

enter image description here

enter image description here

I've tried the solution from this questionn Ubuntu 16.04 Ethernet issues with no use.

My /etc/network/interfaces file:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

My /etc/NetworkManager/NetworkManager.conf file:

[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

[ifupdown]
managed=true

Output of nmcli d:

DEVICE  TYPE      STATE      CONNECTION 
wlp2s0  wifi      connected  eduroam    
enp8s0  ethernet  unmanaged  --         
lo      loopback  unmanaged  --   
martin49
  • 722
  • 1
  • 5
  • 9

5 Answers5

98

The following bug in Ubuntu 16.10 might be related: network-manager does not manage ethernet and bluetooth interfaces when Ubuntu 16.10 is installed using chroot/netboot method

First try running the following command:

sudo nmcli dev set enp8s0 managed yes

If you get the error message:

Error: Device 'enp8s0' not found.

Try running the command below:

ip link show

and look for a device name similar to enp8s0 and substitute it in the original command.


If the that didn't solve the problem, try running the following (backup orig file, and create 0 bytes file instead)

sudo mv /etc/NetworkManager/conf.d/10-globally-managed-devices.conf  /etc/NetworkManager/conf.d/10-globally-managed-devices.conf_orig
sudo touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf  

@datka reported a different location for The file 10-globally-managed-devices.conf so the commands should be:

sudo mv /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf  /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf_orig
sudo touch /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf

The reboot, or restart the Network Manager service:

sudo systemctl restart NetworkManager

or the old way:

sudo service network-manager restart
Zanna
  • 69,223
  • 56
  • 216
  • 327
Yaron
  • 12,828
  • 7
  • 42
  • 55
  • 6
    The second option with creating the blank file worked! Thank you! – martin49 Feb 13 '17 at 06:58
  • 2
    @martin49 - happy to hear that it solve the problem :) – Yaron Feb 13 '17 at 07:02
  • 1
    You saved me. The touch method worked – Max Małecki Mar 29 '17 at 22:06
  • 3
    The second option with creating the blank file worked! Thanks very much! – charybr Apr 06 '17 at 06:53
  • 12
    The second option worked for me too. However, the file `10-globally-managed-devices.conf` was located in `/usr/lib/NetworkManager/conf.d` and not in `/etc/NetworkManager/conf.d`. – datka Apr 11 '17 at 07:28
  • May I additionally point to this bug [No network connectivity after upgrade from 16.04 to 16.10](https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1676547) – user2543253 Apr 20 '17 at 10:04
  • 1
    @datka same for me, the file actually set all devices except WiFi to unmanaged, except the WiFi. This seems to be the default configuration of my Dell XPS13 developer edition, which caused a lot of headscratching for me.. thanks a lot Yaron for the fix! – Maxr1998 Aug 01 '17 at 14:39
  • 1
    @datka - thanks for the comment! I've updated my answer. – Yaron Aug 09 '17 at 06:13
  • Second option worked for me too, after quite some debugging. – Roel Van de Paar Jan 12 '18 at 23:26
  • 2
    Please note that this also applies to 18.04: https://askubuntu.com/questions/1036497/ubuntu-18-04-nmnetwork-manager-is-not-able-to-manage-network-devices/1057017#1057017 – G Koe Jul 17 '18 at 19:23
  • See [my answer](https://askubuntu.com/a/1169539/568304) for an alternative to fix this, extending instead of removing the rules for globally managed devices. – Murphy Aug 30 '19 at 08:57
  • On 18.04 the file needs to contain `[keyfile]\n unmanaged-devices=none`. – bviktor Mar 04 '20 at 11:15
  • Second option also worked for me, not first. Thank you! – pceccon May 14 '20 at 03:09
  • on ubuntu 20.04 the answer (first and second option) @Yaron provided didn't work. Same result with `[keyfile]\n unmanaged-devices=none` and `unmanaged-devices=*,except:type:wifi,except:type:wwan,except:type:ethernet` – dragonmnl Jul 29 '20 at 16:03
  • I confirm that second option worked for ubuntu 20.04 – cybersoft Nov 29 '21 at 14:50
39

In my case the 10-globally-managed-devices.conf just doesn't exist (from 16.04->16.10). All that is needed is to create it:

sudo touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf

Followed by a restart:

sudo service network-manager restart
pa4080
  • 29,351
  • 10
  • 85
  • 161
Vlada Kusbach
  • 391
  • 2
  • 2
  • 6
    I also got this problem when I upgraded to 16.10 from 16.04. This answer worked for me, but I needed to restart Network Manager as well. `sudo service network-manager restart` –  Apr 14 '17 at 22:16
  • 1
    Also a problem upgrading from 16.04 to 17.04. Cmon Ubuntu do better. Network errors are the worst. Thanks for the easy fix. Touch then [sudo service network-manager restart]. – moodboom Aug 30 '17 at 20:39
  • From answers on other questions, it may exist in `/usr/lib/NetworkManager/conf.d/` --on my machine (18.04) it appears that putting the empty one in `/etc/NetworkManager/conf.d/` will override that, and allow NM to manage the device. – jtniehof Aug 03 '18 at 12:11
10

While the advice to create an empty /etc/NetworkManager/conf.d/10-globally-managed-devices.conf file worked for me, I found another way to fix this.

Calling nmcli, I noticed that my ethernet device isn't classified as one of the types (wifi, wwan) that are excluded from the unmanaged-devices clause, in contrast to the WiFi device, but as ethernet:

$ sudo nmcli 
enp0s31f6: verbunden to Kabelgebundene Verbindung 1
        "Intel Ethernet Connection I219-V"
        ethernet (e1000e), 54:E1:AD:FC:E1:22, hw, mtu 1500
        ^^^^^^^^
        [...]

wlp5s0: nicht verfügbar
        "Intel Wireless 8260 (Dual Band Wireless-AC 8260)"
        wifi (iwlwifi), 28:C6:3F:CD:A1:9F, hw, mtu 1500
        ^^^^
        [...]

Adding that type to the exceptions in /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf did work for me:

unmanaged-devices=*,except:type:wifi,except:type:wwan,except:type:ethernet
                                                     ^^^^^^^^^^^^^^^^^^^^^

Strangely enough, the original setting worked for me for more than 6 months, until I decided to clean out the packages installed on my system. However I can't tell if it was the device type or the file contents that have changed with that.

Murphy
  • 1,617
  • 13
  • 24
  • This seems to be a new(er) bug that (IMHO) should get reported. I noticed it on a stripped down Ubuntu 18.04 installation that had network functional before stripping it down. So I assume there is some package that masks this error in the configuration. – stefanct Sep 13 '19 at 14:07
  • This resolved it for me. Thank you very much – 5et Jan 22 '23 at 00:29
  • fixed my issue with an "Qualcomm Atheros Killer E2400" network card, execute "sudo systemctl restart NetworkManager" to load the config changes – Bart De Boeck Feb 04 '23 at 11:43
6

Setting unmanaged-devices=none in {BASE}usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf worked for me in getting NetworkManager to manage the ethernet port, though I don't know if that messes anything else up. :^)

This was for a Ubuntu 16.10 hybrid USB build.

anonymous2
  • 4,268
  • 7
  • 33
  • 61
Paul
  • 61
  • 1
  • The only combination that worked for me was creating the file in `/etc/NetworkManager/conf.d/10-globally-managed-devices.conf` and then manually setting `unmanaged-devices=none` in the location you said. – tftd Mar 10 '18 at 04:05
  • 1
    Can you paste the full 10-globally-managed-devices.conf? I'm getting a `Failed to read configuration: /etc/NetworkManager/conf.d/10-globally-managed-devices.conf: Key file does not start with a group` error. – mpr Jan 14 '19 at 21:48
  • 1
    The contents of the file should be (on two lines): `[keyfile] unmanaged-devices=none` – Jonah Braun Apr 08 '19 at 00:53
4

Please be mindful that you may need to change the netplan renderer to NetworkManager.

In /etc/netplan/01-netcfg.yaml, or /etc/netplan/50-cloud-init.yaml, or (in my case) /etc/netplan/00-installer-config.yaml (it may be a different name but it should be the only file located in that directory) add renderer: NetworkManager after network:.

it should look something like this:

network:
  version: 2
  renderer: NetworkManager
  ethernets:
    enp0s3:
      dhcp4: yes

Please also be mindful that if you wish to add the exceptions tag to /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf make sure that you add a plugin tag such as [keyfile] to the top of the file as per what plugins you have listed in /etc/NetworkManager/NetworkManager.conf [main] plugins=ifupdown,**keyfile**

Hope I could help, I'm running Ubuntu 20.04 and this had me scratching my head for a while.

Charles
  • 51
  • 2