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 -.
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 could also use the "nmcli" tool to set DNS server as we can see below:
We can activate a connection using the below command: