Common nmcli commands based on RHEL8/CentOS8 # View IP (similar to ifconfig, ip addr) nmcli # Create a connection, configure a static IP (equivalent to configuring ifcfg, where BOOTPROTO=none, and start it with ifup) nmcli c add type ethernet con-name ethX ifname ethX ipv4.addr 192.168.1.100/24 ipv4.gateway 192.168.1.1 ipv4.method manual # Create a connection and configure a dynamic IP (equivalent to configuring ifcfg, where BOOTPROTO=dhcp and ifup is used to start the connection) nmcli c add type ethernet con-name ethX ifname ethX ipv4.method auto # Modify ip (non-interactive) nmcli c modify ethX ipv4.addr '192.168.1.200/24' nmcli c up ethX # Modify ip (interactive) nmcli c edit ethX nmcli> goto ipv4.addresses nmcli ipv4.addresses> change Edit 'addresses' value: 192.168.1.200/24 Do you also want to set 'ipv4.method' to 'manual'? [yes]: yes nmcli ipv4> save nmcli ipv4> activate nmcli ipv4> quit # Enable connection (equivalent to ifup) nmcli c up ethX # Stop connection (equivalent to ifdown) nmcli c down # Delete connection (similar to ifdown and delete ifcfg) nmcli c delete ethX # View the connection list nmcli c show # View connection details nmcli c show ethX # Reload all ifcfg or route to connection (will not take effect immediately) nmcli c reload # Reload the specified ifcfg or route to connection (will not take effect immediately) nmcli c load /etc/sysconfig/network-scripts/ifcfg-ethX nmcli c load /etc/sysconfig/network-scripts/route-ethX # Connection takes effect immediately. There are three methods: nmcli c up ethX nmcli d reapply ethX nmcli d connect ethX # View the device list nmcli d # View all device detailed information nmcli d show # View detailed information about the specified device nmcli d show ethX # Activate the network card nmcli d connect ethX # Disable wireless network (NM enables wireless network by default) nmcli r all off # Check the NM management status nmcli n # Enable NM management nmcli n on # Disable NM management (execute with caution) nmcli n off #Monitoring events nmcli m # View the status of NM itself nmcli # Check whether NM is available online nm-online The ifcfg mentioned above refers to /etc/sysconfig/network-scripts/ifcfg-ethX and /etc/sysconfig/network-scripts/route-ethX Summarize The above is the introduction of nmcli usage in CentOS8 by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: The whole process of implementing the summary pop-up window with Vue+Element UI
>>: Detailed graphic description of the database installation process of MySQL version 5.7.24
For example, he enters: XML/HTML Code div#page>...
Lock classification: From the granularity of data...
Recently, I was adding a series of statistical fu...
In HTML, you need to specify the encoding used by...
In our daily business, form validation is a very ...
If you want to install some 64-bit applications (...
Alibaba Cloud Server installs and configures Tomc...
In MySQL, most indexes (such as PRIMARY KEY, UNIQ...
Environmental requirements: IP hostname 192.168.1...
1: Install SVN yum install -y subversion 2. Creat...
Friends who are learning HTML, CSS and JS front-e...
The specific method is as follows: CSS Code Copy ...
This article mainly introduces the installation/st...
This tutorial shares the installation and configu...
This article shares MYSQL logs and backup and res...