Creating a keyfile Connection Profile Using nmcli
To illustrate the different uses of the nmcli command, this procedure describes an example of adding and configuring a new Ethernet connection for the enp0s2
device. For more information about the command, see the nmcli(1)
manual page.
Tip:
Before adding the connection, prepare the information you would need for the configuration, such as the following:- Connection name, for example,
My Work Connection
. The nmcli command works by referring to the connection name rather than the device name. If you don't set a connection name, then the device's name is used as the connection name. - IP addresses (IPv4 and, if needed, IPv6)
- Gateway addresses
- Other relevant data you want to set for the connection
After you have created the connection, a corresponding profile is created. For more information on connection profiles, see NetworkManager Connection Profiles.
ls -lrt /etc/NetworkManager/system-connections/
...
-rw-r--r--. 1 root root 266 Aug 6 11:03 /etc/sysconfig/network-scripts/ifcfg-My_Work_Connection