11

I'm new to nmcli and trying to figure out how to create an eth0 connection. sudo nmcli con prints the following:

NAME       UUID     TYPE      DEVICE
MyWlan0    ...      wifi      wlan0
MyEth0     ...      ethernet  --

No matter what command I give, my MyEth0 connection will not show eth0 under DEVICE above (just '--') and, as a result, I'll get the following error when I try sudo nmcli con up MyEth0:

Error: Connection activation failed: No suitable device found for this connection (device lo not available because device is strictly unmanaged).

This is how I created the connection:

sudo nmcli con add con-name MyEth0 type ethernet ifname eth0

I've also tried modifying it with the following sorts of commands:

sudo nmcli con mod MyEth0 connection.interface-name eth0

Running sudo nmcli con show MyEth0 connection | grep eth0 does indicate that the connection.interface-name is eth0, but it does not appear this way according to the behavior described above.

Any ideas?

Edit:

Here is the output of sudo lshw -C network:

  *-network:0
       description: Ethernet interface
       physical id: 2
       logical name: eth0
       serial: dc:a6:32:27:84:45
       size: 100Mbit/s
       capacity: 1Gbit/s
       capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=bcmgenet driverversion=v2.0 duplex=full link=yes multicast=yes port=MII speed=100Mbit/s
  *-network:1
       description: Wireless interface
       physical id: 3
       logical name: wlan0
       serial: dc:a6:32:27:84:46
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=brcmfmac driverversion=7.45.18 firmware=01-6a2c8ad4 ip=192.168.1.201 multicast=yes wireless=IEEE 802.11
Magnus
  • 293

4 Answers4

8

This is because since Ubuntu 18.04, the network configuration file has changed from interfaces to netplan, and you need to use apt install network-manager again modify /etc/netplan/00-installer-config.yamllike this

network:
  renderer: NetworkManager

This allows the network configuration to point to NetworkManager,then use netplan apply load this file. you can use nmcli device status check if the configuration is in effect.gook luck!

1

This worked for me:

Therefore:

iface enp0s3 inet dhcp

Followed by:

/etc/init.d/networking start
Ole Tange
  • 1,742
0

Your networking might be disabled. to solve the issue run nmcli networking on. This will enable networking control by NetworkManager and make your network interface manageable. All interfaces managed by NetworkManager are deactivated when networking is disabled.

abdou_dev
  • 101
-3

Network manager normally only manages wifi connections.

change in /etc/NetworkManager/NetworkManager.conf

[ifupdown]
managed=false

to

[ifupdown]
managed=true

Restart NetworkManager.service and nm-applet

and try again.

nobody
  • 5,792