Configure network interface using NMCLI on Ubuntu 22.04 LTS

By default Ubuntu 22.04 LTS Jammy Jellyfish enabled with netplan network configuration using YAML format.

If you are comfortable with using nmcli we need to install Network Manager packages using apt and configure network interfaces with nmcli or nmtui commands.

We may encounter with below error while trying to use Network Manager on Ubuntu servers, it can be rectified by adding a exception.

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

Install required packages

# apt install network-manager -y

Adding Exception for Ethernet Type

Make sure to add the exception by editing global config file.

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

Add the exception after a comma (,) as follows.
In my case ethernet, similarly add the required type.


Restart the Network Manager to make it effective.

# systemctl restart NetworkManager

Verify Network Status

Now the status of interface will be in active.

# nmcli device
# nmcli connection

Configure Interface

Configure the interface with an IP, gateway and DNS.

# nmcli connection add type ethernet ifname ens160 con-name prod ipv4.addresses ipv4.gateway ipv4.dns ipv4.dns-search linuxsysadmins.lan ipv4.method manual ipv6.method ignore autoconnect yes

That’s it.