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
To achieve CSS screen size adaptation, we must fi...
Part 3: ❤Three ways to overlook backend data rece...
Table of contents Question: answer: Reality: Know...
Regarding the issue that JavaScript strict mode d...
Table of contents 1.Vue.js features: 2.Observer.j...
Introduction I will write about the problem I saw...
Generally, on national days of mourning, days of ...
Preface In the development process, defining vari...
Table of contents 1. Description 2. Installation ...
The format of textarea can be saved to the databas...
Table of contents Preface 1. Basic knowledge of f...
In MySQL 8.0.18, a new Hash Join function was add...
Table of contents Layout part: <div id="a...
The following example code introduces the princip...
Table of contents 1. Import files using script ta...