Linux 101 : Networking with the "nmcli" command



When we are talking about the Linux Network Manager, a connection is a group of parameters that are applied to a network interface.
A network interface could have one or more connections attached to it.
We could give these different connections different priorities called - 
autoconnect priority -.

If we have a number of connection set to autoconnect, connections that have a higher priority will have precedence - for example a dhcp over a static connection or ethernet over a wifi connection -.

Remark:

The "autoconnect-priority" parameter is used to set the priority of a connection.
If the connection's parameter autoconnect is set to "FALSE", the user is in charge of starting the connection using the MetworkManager.

The auto mode - dhcp - and the manual mode -static IP address - are the mode available to us to set the IP address of a connection.


We can add a new connection - con1 to an interface -ethernet - using the below command:


We can modify the IP address of an interface using the below command:


We set the connection to manual - static IP address - using the below command:


We set the default gateway for an interface using the below command:


We could also use the "nmcli" tool to set DNS server as we can see below:


We can activate a connection using the below command:


To display all the devices on a system along with their status, we use:


To display a connections its name, type, the interface it is tied to, ..., we use the below command:


To list all active connections, we use the below command:

Comments

Leave as a comment:

Archive