How to fix nmcli connection up Error: unknown connection issue in Linux CentOS/RHEL

by Jay

If you are facing Error:unknown connection when trying to change network interface in Linux using nmcli. Please follow below steps to troubleshoot it and fix the same.

Checking the Network interface details.

Let’s check the available connections.

[root@TechArticles ~]# nmcli connection show
NAME             UUID                                  TYPE      DEVICE
enp0s3           b972dea7-b72d-4e48-a838-bda20615e189  ethernet  enp0s3
ethernet-enp0s8  e7dd02fc-f36d-48d7-92a8-30f9be275970  ethernet  enp0s8
virbr0           cf62a28b-1744-4754-9e28-1c23b7783406  bridge    virbr0

As per above connection details lets suppose you want to start the device enp0s8.

Please Note: In your case device name might be different.

Trying to activate the connection

[root@TechArticles ~]# nmcli connection up enp0s8
Error: unknown connection 'enp0s8'.
[root@TechArticles ~]#

As you see in above command output, device is available but still getting Error: unknown connection 'enp0s8'.

Basicly getting this error because the command nmcli connection up enp0s8 is looking for a connection NAME: enp0s8to up but there is no connection with NAME: enp0s8 however we do have a connection with NAME: ethernet-enp0s8.

I hope you can now tell the difference between “NAME” and “DEVICE” while seeing the connection listings.

To start the device, please follow the steps provided below.

There are two choices. You can either fix the name or start the device with the UUID.

Activating connection using UUID

Let’s try starting the connection using the UUID.

[root@TechArticles ~]# nmcli connection up e7dd02fc-f36d-48d7-92a8-30f9be275970
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/5)

[root@TechArticles ~]# nmcli connection show
NAME             UUID                                  TYPE      DEVICE
enp0s3           b972dea7-b72d-4e48-a838-bda20615e189  ethernet  enp0s3
ethernet-enp0s8  e7dd02fc-f36d-48d7-92a8-30f9be275970  ethernet  enp0s8
virbr0           cf62a28b-1744-4754-9e28-1c23b7783406  bridge    virbr0

[root@TechArticles ~]# ip address show enp0s8
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:c2:15:90 brd ff:ff:ff:ff:ff:ff
    inet 192.168.111.77/24 brd 192.168.111.255 scope global noprefixroute enp0s8
       valid_lft forever preferred_lft forever
    inet6 fe80::4705:63f9:c16e:7cb0/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

You can see the same connection activated using the UUID and you can see the connection up using the correct connectionNAME : ethernet-enp0s8. Let’s see if we can start the interface or not.

Activating connection using connection NAME

[root@TechArticles ~]# nmcli connection up ethernet-enp0s8
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6)

As you can see above we are able to start the connection using NAME as well.

We can start the interface sing device by using DEVICE also.

Activating using DEVICE interface

Check the device status by running below command and verify.

[root@TechArticles ~]# nmcli device status
DEVICE  TYPE      STATE                   CONNECTION
enp0s3  ethernet  connected               enp0s3
virbr0  bridge    connected (externally)  virbr0
enp0s8  ethernet  disconnected            --
enp0s9  ethernet  disconnected            --
lo      loopback  unmanaged               --

To start the device enp0s8 run below command and verify.

[root@TechArticles ~]# nmcli device up enp0s8
Device 'enp0s8' successfully activated with 'e7dd02fc-f36d-48d7-92a8-30f9be275970'.
[root@TechArticles ~]# nmcli device status
DEVICE  TYPE      STATE                   CONNECTION
enp0s3  ethernet  connected               enp0s3
enp0s8  ethernet  connected               ethernet-enp0s8
virbr0  bridge    connected (externally)  virbr0
enp0s9  ethernet  disconnected            --
lo      loopback  unmanaged               --

How to disconnect a interface using nmcli command.

To disconnect the interface by Device use below command.

[root@TechArticles ~]# nmcli device disconnect enp0s8
Device 'enp0s8' successfully disconnected.

How to rename the connection name using nmcli command.

Lets checked the existing device name

[root@TechArticles ~]# nmcli connection show
NAME             UUID                                  TYPE      DEVICE
enp0s3           b972dea7-b72d-4e48-a838-bda20615e189  ethernet  enp0s3
ethernet-enp0s8  e7dd02fc-f36d-48d7-92a8-30f9be275970  ethernet  enp0s8
virbr0           cf62a28b-1744-4754-9e28-1c23b7783406  bridge    virbr0

Use below command to rename the connection name

[root@TechArticles ~]# nmcli connection modify ethernet-enp0s8 con-name enp0s8-newname

[root@TechArticles ~]# nmcli connection show
NAME            UUID                                  TYPE      DEVICE
enp0s8-newname  e7dd02fc-f36d-48d7-92a8-30f9be275970  ethernet  enp0s8
enp0s3          b972dea7-b72d-4e48-a838-bda20615e189  ethernet  enp0s3
virbr0          cf62a28b-1744-4754-9e28-1c23b7783406  bridge    virbr0

Above you can see connection name modified from ethernet-enp0s8 to enp0s8-newname

Was this article of use to you? Post your insightful thoughts or recommendations in the comments section if you don’t find this article to be helpful or if you see any outdated information, a problem, or a typo to help this article better.

Related Posts

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.