1. The difference between CentOS 7 and CentOS 8 network configuration:
CentOS 8.0.1905 is installed in VMware Workstation 15 Pro, but network.service is not found in the process of configuring the IP address, and there is no script file in the /etc/sysconfig/network-scripts directory. CentOS 7 also supports network. There are two ways to configure the network: service and NetworkManager.service (NM for short), but network.service has been deprecated in CentOS 8. You must configure the network through NetworkManager.service.
**2. Simple instructions for use of NetworkManager's command line tool nmcli: **
1、 View IP (similar to ifconfig, ip a): # nmcli
2、 3 ways to activate the network card (equivalent to ifup):
(1)# nmcli c up ens33
Remarks: nmcli c | connection, connection, can be understood as a configuration file, equivalent to ifcfg-ethX or ifcfg-ensX
(2)# nmcli d connect ens33
Remarks: nmcli d | device, device, can be understood as the actual network card (including physical network card and virtual network card)
(3)# nmcli d reapply ens33
3、 Disable the network card (equivalent to ifdown): # nmcli c down ens33
4、 View the connection list: # nmcli c show
5、 View connection details: # nmcli c show ens33
6、 Reload all ifcfg or route to connection (will not take effect immediately): # nmcli c reload
7、 View the device list: # nmcli d
Remarks: device has 4 states
(1) connected: It has been managed by NM and currently has an active connection
(2) disconnected: has been managed by NM, but there is no active connection currently
(3) unmanaged: not managed by NM
(4) unavailable: unavailable, NM cannot manage, usually when the network card link is down (eg: ip link set ethX down)
8、 View all device details: # nmcli d show
9、 View detailed information of the specified device: # nmcli d show ens33
10、 View NM management status: # nmcli n
11、 Open NM management: # nmcli n on
12、 Check whether NM is available online: # nm-online
Note: For detailed instructions on nmcli commands, please refer to # man nmcli or # nmcli -h. For specific object usage such as device, please refer to # man nmcli d or # nmcli d -h
The above is the whole content of this article, I hope it will be helpful to everyone's study.
Recommended Posts