Detailed use of nmcli in CentOS8

Common command usage of nmcli based on RHEL8/CentOS8

# View ip (similar to ifconfig, ip addr)
nmcli
# Create connection, configure static ip (equivalent to configure ifcfg, where BOOTPROTO=none, and ifup starts)
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 connection, configure dynamic ip (equivalent to configure ifcfg, where BOOTPROTO=dhcp, and ifup starts)
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 (not effective 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
# Immediately effective connection, there are 3 methods
nmcli c up ethX
nmcli d reapply ethX
nmcli d connect ethX
# View device list
nmcli d
# View all device details
nmcli d show
# View detailed information of the specified device
nmcli d show ethX
# Activate the network card
nmcli d connect ethX
# Turn off wireless network (NM enables wireless network by default)
nmcli r all off
# View NM management status
nmcli n
# Turn on NM management
nmcli n on
# Close NM management (execute with caution)
nmcli n off
# Listen for events
nmcli m
# View the status of NM itself
nmcli
# Check if 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

to sum up

The above is the use of nmcli in CentOS8 introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message. The editor will reply to you in time. Thank you very much for your support to the ZaLou.Cn website!
If you think this article is helpful to you, welcome to reprint, please indicate the source, thank you!

Recommended Posts

Detailed use of nmcli in CentOS8
Use of Anaconda in Ubuntu
Detailed installation steps of CentOS6.4 system in virtual machine
Detailed explanation of CentOS7 network setting tutorial in vmware
CentOS 8 installation of MariaDB detailed tutorial
Use of numpy in Python development
CentOS7.3 install iptables and detailed use
Detailed usage of dictionary in Python
Detailed examples of Centos6 network configuration
Detailed explanation of the installation and use of SSH in the Ubuntu environment
Use NTP for time synchronization in CentOS 7
Installation and use of Mysql under CentOS
Detailed tutorial on installing MySQL 8 in CentOS 7
Centos7 installation and deployment of Airflow detailed
Simple practice of RHCS cluster in CentOS6
Detailed explanation of the use of pip in Python | summary of third-party library installation
Installation and configuration of JDK in CentOS 7 system
Install nginx in centos8 custom directory (detailed tutorial)
Centos7 installation of PHP and Nginx tutorial detailed
LVM disk expansion problem of Centos7 in Linux
Installation and configuration of CentOS 7 in VMware Workstation
Introduction to the use of Hanlp in ubuntu
Detailed explanation of building Hadoop environment on CentOS 6.5
Use command to clear specific hostname in CentOS7
Detailed tutorial of installing nginx on centos8 (graphic)
Installation and use of SSH in Ubuntu environment
Detailed explanation of static DNS configuration method in Ubuntu
Install MySQL5.7 in centos7
Install php in centos
Use Cobbler to automate batch deployment of CentOS / Ubuntu
Installation and use of GDAL in Python under Ubuntu
Use supervisor in ubuntu
Graphical installation of CentOS8
Python|The use of operators
Install redis5.0 in CentOS7
Build Hadoop in CentOS
Use RapidSVN on CentOS7
KVM virtualization in centos
Equal Insurance Evaluation: Detailed Explanation of Centos Timeout Exit
Rapid deployment of Kubernetes (k8s) cluster in CentOS7 environment
The problem of MySQL import file failure in CentOS environment
Detailed explanation of Spark installation and configuration tutorial under centOS7
Detailed method of installing Kernel 5.x kernel version on CentOS 8 system
Centos8 minimal deployment and installation of OpenStack Ussuri detailed tutorial
Detailed steps to install and configure k8s cluster in centos 7
Build zabbix monitoring zabbix4.2 in CentOS7.6
Build zabbix monitoring zabbix4.2 in CentOS7.6
Deployment of graphite on centos7
Graphical centos installation detailed process
centos7 kvm installation and use
Centos7 silent installation of Oracle11g
Use of mediawiki under ubuntu
Debug Kernel Panic in Centos
vmware install CentOS 7 detailed tutorial
CentOS7 postgresql installation and use
Implementation of CentOS8.0 Network Configuration
CentOS environment installation of Docker
Centos network settings in virtualbox
Update gcc to 6.4.0 in centos
Centos7 elk7.1.1 installation and use
Common exceptions and solutions in the use and development of Ubuntu system