Professional Documents
Culture Documents
RH124 - ch11s05
RH124 - ch11s05
The NetworkManager service manages network devices and connections. A device is a physical or virtual network interface that provides for network
traffic. A connection has related configuration settings for a single network device. A connection can also be known as a network profile. Each
connection must have a unique name or ID, which can match the device name that it configures.
A single device can have multiple connection configurations and switch between them, but only one connection can be active per device. For example,
a laptop wireless device might configure a fixed IP address for use at a secure work site in a connection, but might configure a second connection with
an automated address and a virtual private network (VPN) to access the same company network from home.
Important
Starting in Red Hat Enterprise Linux 8, ifcfg format configuration files and the /etc/sysconfig/network-scripts/ directory are
deprecated. NetworkManager now uses an INI-style key file format, which is a key-value pair structure to organize properties.
NetworkManager stores network profiles in the /etc/NetworkManager/system-connections/ directory. For compatibility with earlier
versions, ifcfg format connections in the /etc/sysconfig/network-scripts/ directory are still recognized and loaded.
[root@host ~]# nmcli con add con-name eno4 type ethernet ifname eno4 \
ipv6.addresses 2001:db8:0:1::c000:207/64 ipv6.gateway 2001:db8:0:1::1 \
ipv6.method manual ipv4.addresses 192.0.2.7/24 ipv4.gateway 192.0.2.1 \
ipv4.method manual
The nmcli device disconnect command disconnects the network device and brings down the connection.
Important
Use nmcli device disconnect to stop traffic on a network interface and deactivate the connection.
Because most connections enable the autoconnect parameter, the nmcli connection down command is ineffective for stopping traffic.
Although the connection deactivates, autoconnect immediately reactivates the connection if the device is up and available. Autoconnect is
a desired behavior, because it maintains connections through temporary network outages.
By disconnecting the device under the connection, the connection is forced to be down until the device is connected again.
To list the current settings for a connection, use the nmcli connection show command. Settings in lowercase are static properties that the
https://rha.ole.redhat.com/rha/app/courses/rh124-9.0/pages/ch11s05/85223ae4-a208-4a0c-8807-f8580dad018f 2/5
administrator can change. Settings in uppercase are active settings in temporary use for this connection instance.
26/8/23, 18:13 RH124 - ch11s05
then load the final configuration when ready. The following example loads all connection profiles.
Non-privileged users that are logged in on the physical or virtual console can also make most network configuration changes. If a person is on the
system's console, then the system is likely being used as a workstation or laptop where the user needs to configure, activate, and deactivate
connections. Non-privileged users that log in with ssh must switch to the root user to change network settings.
Use the nmcli general permissions command to view your current permissions. The following example lists the root user's NetworkManager
permissions.
Command Purpose
nmcli con mod name Modify the connection name.
nmcli con reload Reload the configuration files, after manual file editing.
nmcli con up name Activate the connection name.
nmcli dev dis dev Disconnect the interface, which also deactivates the current connection.
nmcli con del name Delete the specified connection and its configuration file.
References
For more information, refer to the Getting Started with nmcli chapter at https://access.redhat.com/documentation/en-
us/red_hat_enterprise_linux/9/html-single/configuring_and_managing_networking/index#getting-started-with-nmcli_configuring-and-managing-
networking
https://rha.ole.redhat.com/rha/app/courses/rh124-9.0/pages/ch11s05/85223ae4-a208-4a0c-8807-f8580dad018f 5/5