Networking 101 : nmcli devices, interfaces and connections



For nmcli (Network Management Command Line Interface) an interface and a connection are two different things.

The interface is "eth0" for example for an Ethernet device and "connection" is the profile or the config file that contains all the characteristics of the device.
nmcli creates a configuration an interface.

Showing the connections:


As we can see above, the device is one of the "characteristics" of the connection.

creating a connection:


The system will give a random name to the connection. The connection is associated with the interface "eth0".

Setting up a connection:



After "activating" a connection and associating an IP address to it, we would need to bring the interface down and then bring it up again for the changes to take effect.
Bringing down the interface: 


Then setting it up:


 Showing the devices:


Showing the status of the devices:


The results show device "eth0" and its connection (profile) "Wired con".

Adding an IP address to a connection:

As we have seen above the "con modify" can be used to add and IP address to an interface.


It can also be used to add a gateway address or a DNS address,...

Showing the details of a connection:

To show the detail of the device eth0 profile "Wired con", we use the below:



We get the "id" of a connection with the "nmcli con show" command.

Which interface corresponds to which connection:

We could use the below command to know which interface is associated with which connection:


Remark:

All the connections file on the systems live in the following directory "/etc/NetworkManager/system-connections".

Comments

Leave as a comment:

Archive