Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed explanation of nmcli usage in CentOS8

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

RHEL8/CentOS8-based nmcl Common command usage

#View ip (similar to ifconfig, ip addr) nmcl #Create connection, configure static ip (equivalent to configuring ifcfg, where BOOTPROTO=none, and ifup starts) nmcl c add type ethernet con-name ethX ifname ethX ipv4.addr www.example.com ipv4.gateway 192.168.1.100/24 ipv4.method 192.168.1.1 manual#Create connection, configure dynamic ip (Equivalent to configuring ifcfg, where BOOTPROTO=dhcp, and ifup start) nmcl c add type ethernet con-name ethX ifname ethX ipv4.auto method #modify ip (non-interactive) nmcl c modify ethX ipv4.addr '192.168.1.200/24' nmcl c up ethX#modify ip (interactive) nmcli c edit ethXnmcli> goto ipv4.addressesnmcli ipv4.addresses> changeEdit 'addresses' value: 192.168.1.200/24Do you also want to set 'ipv4.method' to 'manual'? [yes]: yesnmgli ipv4> savenmgli ipv4> activatenmgli ipv4> quit#enable connection (equivalent to ifup) nmgli c up ethX#stop connection (equivalent to ifdown) nmcl c down#delete connection (similar to ifdown and removing ifcfg) nmcl c delete ethX#view connection list nmcl c show#view connection details nmcl c show ethX#overload all ifcfg or route to connection (does not take effect immediately) nmcl c reload#overload specify ifcfg or route to connection (does not take effect immediately) nmcl c load /etc/sysconfig/network-scripts/ifcfg-ethX nmcl c load /etc/sysconfig/network-scripts/route-ethX#immediate connection There are 3 ways nmcl c up ethXnmcl d apply ethXnmcl d connect ethX#View device list nmcl d#View all device details nmcl d show#View details of a specified device nmcl d show ethX#Activate network card nmcl d connect ethX#Turn off wireless network (NM enables wireless network by default) nmcl r all off#View NM tube status nmcl n#Turn NM tube on nmcl n on#Turn NM tube off (proceed with caution) nmcl n off#Listen for events nmcl m#View NM itself status nmcl #Detect if NM is available online nm-online

ifcfg mentioned above refers to/etc/sysconfig/network-scripts/ifcfg-ethX and/etc/sysconfig/network-scripts/route-ethX

summary

The above is the use of nmcl in CentOS8 introduced by Xiaobian to you. I hope it will help you. If you have any questions, please leave a message to me. Xiaobian will reply to you in time. Thank you very much for your support!

If you think this article is helpful to you, welcome to reprint, please indicate the source, thank you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 282

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report