23

I am using Ubuntu 17.04 but I don't know why my Ethernet interface was disabled.

I tried lshw -C network and it shows this:

WARNING: you should run this program as super-user.
  *-network DISABLED        
       description: Ethernet interface
       product: 82579LM Gigabit Network Connection
       vendor: Intel Corporation
       physical id: 19
       bus info: pci@0000:00:19.0
       logical name: enp0s25
       version: 04
       serial: 00:21:cc:cd:28:8f
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k firmware=0.13-3 latency=0 link=no multicast=yes port=twisted pair
       resources: irq:28 memory:f2500000-f251ffff memory:f253b000-f253bfff ioport:6080(size=32)

How I can enable it?

minhky
  • 353

6 Answers6

49

Here is how to fix this problem.

Edit file /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf and change it's content from :

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

To :

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

And then run :

sudo service network-manager restart

That's all.

  • 1
    In case /usr/lib/NetworkManager doesnt exist, you have to install network-manager first – Wax Cage Aug 06 '17 at 22:01
  • 1
    If this doesn't work for you, try to check NetworkManager.conf for managed=false and change it to true as described in this answer https://askubuntu.com/a/1043244/277898 – jave.web Jun 13 '20 at 00:45
  • 1
    On newer Ubuntu versions the original line is different. I would suggest not to replace the line but to append ,except:type:ethernet to the end of the line to get ethernet back! – MF.OX Jan 05 '21 at 09:53
  • Thanks, this helped me to fix the "Unmanaged" device problem. I had to restart the service manager differently, though: sudo systemctl restart NetworkManager. I'm on ubuntu 21.10, but I'm pretty sure that this is the right syntax for current LTS, and probably 1 or 2 versions behind. Cheers – funder7 Jan 30 '22 at 16:00
  • Thanks, this has fixed it for me... twice. After some updates (presumably) this fix undid itself. – James Bradbury Feb 09 '22 at 11:29
  • This issue was driving me nuts, and I finally typed the correct search terms to bring me to this answer. Thanks! – grfrazee Jul 28 '22 at 13:19
10

My Ethernet was also disabled after I upgraded from LTS 16.04 to 16.10 then to 17.04. I was able to resolve by manually doing the following:

sudo ifconfig eth0 up 
sudo dhclient eth0
anonymous2
  • 4,325
  • 1
    This helped! But after reboot I again have to type this to get a connection. Is there a proper way to configure this automatically? – Socrates Apr 22 '17 at 17:24
  • @Socrates The first solution has worked for me to make it automatically https://askubuntu.com/a/909185/170833 . AFAIK it's doing internally a similar thing (starting the interface and calling dhcp client after it) – morhook Apr 30 '17 at 23:53
  • @morhook This requires installing additional software 'network-manager' which is not installed by default on ubuntu server – rtaft Oct 31 '17 at 13:41
  • 1
    I'm not sure how to schedule this commands via configuration on ubuntu server without network-manager – morhook Nov 01 '17 at 13:21
  • On 18.04 server (new install) the NIC was disabled... this allowed me to bring the NIC up and get on the network without network-manager being installed, but the NIC would get disabled again on reboot. Once I was online I installed network-manager and used this solution for a permanent fix: https://askubuntu.com/a/909185/283005 –  Jun 18 '18 at 02:55
4
  1. Delete all in /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf

  2. Change [ifupdown] managed=false to true in /etc/NetworkManager/NetworkManager.conf

  3. restart with sudo service network-manager restart

David
  • 41
1

When I upgraded to 17.04 this network manager file was blocking my system from automatically managing my devices.

/usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf

Content:

[keyfile]

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

I commented it all out, rebooted, and everything works fine now. It can also be deleted.

Reference: Network Manager refusing to manage wired interfaces

kristof
  • 11
1

Other's replies solve the problem, but you should not edit the system file /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf since your changes could be overwritten during the next upgrade, and you probably won't remember which is the file involved.

Create a new file instead: /etc/NetworkManager/conf.d/10-globally-managed-devices.conf which overrides the first one. Make it empty or comment its content with the hash symbol:

[keyfile]
# unmanaged-devices=*,except:type:wifi,except:type:wwan
Demis Palma ツ
  • 801
  • 10
  • 12
0

A bit more general answer is sudo lshw -class network, then look for the content after the field logical name, because in my case it was enp5s0, so with this then you proceed to sudo ifconfig enp5s0 up and sudo dhclient enp5s0.