您的位置:首页 > 文旅 > 旅游 > 酒泉地网站推广_莱州人才招聘网_合肥seo报价_汕头百度推广公司

酒泉地网站推广_莱州人才招聘网_合肥seo报价_汕头百度推广公司

2025/5/1 11:21:14 来源:https://blog.csdn.net/cici_new_1987/article/details/147609873  浏览:    关键词:酒泉地网站推广_莱州人才招聘网_合肥seo报价_汕头百度推广公司
酒泉地网站推广_莱州人才招聘网_合肥seo报价_汕头百度推广公司
具体命令解释用法可参见man nmcli
 
NAMEnmcli - command-line tool for controlling NetworkManagerSYNOPSISnmcli [OPTIONS...] {help | general | networking | radio | connection | device | agent | monitor} [COMMAND] [ARGUMENTS...]DESCRIPTIONnmcli is a command-line tool for controlling NetworkManager and reporting network status. It can be utilized as areplacement for nm-applet or other graphical clients.  nmcli is used to create, display, edit, delete, activate, anddeactivate network connections, as well as control and display network device status. See nmcli-examples(7) for ready to runnmcli examples.Typical uses include:•   Scripts: Utilize NetworkManager via nmcli instead of managing network connections manually.  nmcli supports a terseoutput format which is better suited for script processing. Note that NetworkManager can also execute scripts, called"dispatcher scripts", in response to network events. See NetworkManager(8) for details about these dispatcher scripts.•   Servers, headless machines, and terminals: nmcli can be used to control NetworkManager without a GUI, includingcreating, editing, starting and stopping network connections and viewing network status.
GENERAL COMMANDSnmcli general {status | hostname | permissions | logging | reload} [ARGUMENTS...]Use this command to show NetworkManager status and permissions. You can also get and change system hostname, as well asNetworkManager logging level and domains.statusShow overall status of NetworkManager. This is the default action, when no additional command is provided for nmcligeneral.hostname [hostname]Get and change system hostname. With no arguments, this prints currently configured hostname. When you pass a hostname,it will be handed over to NetworkManager to be set as a new system hostname.Note that the term "system" hostname may also be referred to as "persistent" or "static" by other programs or tools. Thehostname is stored in /etc/hostname file in most distributions. For example, systemd-hostnamed service uses the term"static" hostname and it only reads the /etc/hostname file when it starts.permissionsShow the permissions a caller has for various authenticated operations that NetworkManager provides, like enable anddisable networking, changing Wi-Fi and WWAN state, modifying connections, etc.logging [level level] [domains domains...]Get and change NetworkManager logging level and domains. Without any argument current logging level and domains areshown. In order to change logging state, provide level and, or, domain parameters. See NetworkManager.conf(5) foravailable level and domain values.reload [flags...]Reload NetworkManager's configuration and perform certain updates, like flushing caches or rewriting external state todisk. This is similar to sending SIGHUP to NetworkManager but it allows for more fine-grained control over what toreload through the flags argument. It also allows non-root access via PolicyKit and contrary to signals it issynchronous. Available flags are:confReload the NetworkManager.conf configuration from disk. Note that this does not include connections, which can bereloaded through nmcli connection reload instead.dns-rcUpdate DNS configuration, which usually involves writing /etc/resolv.conf anew. This is equivalent to sending theSIGUSR1 signal to the NetworkManager process.dns-fullRestart the DNS plugin. This is for example useful when using dnsmasq plugin, which uses additional configuration in/etc/NetworkManager/dnsmasq.d. If you edit those files, you can restart the DNS plugin. This action shortlyinterrupts name resolution.With no flags, everything that is supported is reloaded, which is identical to sending a SIGHUP. See NetworkManager(8)for more details about signals.

NETWORKING CONTROL COMMANDSnmcli networking {on | off | connectivity} [ARGUMENTS...]Query NetworkManager networking status, enable and disable networking.on, offEnable or disable networking control by NetworkManager. All interfaces managed by NetworkManager are deactivated whennetworking is disabled.connectivity [check]Get network connectivity state. The optional check argument tells NetworkManager to re-check the connectivity, else themost recent known connectivity state is displayed without re-checking.Possible states are:nonethe host is not connected to any network.portalthe host is behind a captive portal and cannot reach the full Internet.limitedthe host is connected to a network, but it has no access to the Internet.fullthe host is connected to a network and has full access to the Internet.unknownthe connectivity status cannot be found out.
本机情况查询
root@bogon:/sys/kernel/debug/block/nvme0n1/hctx0# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope host noprefixroute valid_lft forever preferred_lft forever
2: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000link/ether 8c:32:23:02:74:1e brd ff:ff:ff:ff:ff:ffaltname enx8c322302741e
3: wlp0s20f3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000link/ether b0:dc:ef:8d:bd:fa brd ff:ff:ff:ff:ff:ffaltname wlxb0dcef8dbdfainet 192.168.1.13/24 brd 192.168.1.255 scope global dynamic noprefixroute wlp0s20f3valid_lft 85471sec preferred_lft 85471secinet6 2408:8207:846a:ef10:6001:fea9:e1d:fb38/64 scope global dynamic noprefixroute valid_lft 259066sec preferred_lft 172666secinet6 fe80::6753:91ac:f755:da19/64 scope link noprefixroute valid_lft forever preferred_lft forever
nmcli命令的一些文件
root@bogon:/etc/NetworkManager/system-connections# ll
总计 44
-rw-------. 1 root root 272  4月 5日 18:49  BACKUP.nmconnection
-rw-------. 1 root root 295  3月25日 11:56  ChinaUnicom-1901.nmconnection
-rw-------. 1 root root 261  4月21日 21:00  CU_7P2s.nmconnection
-rw-------. 1 root root 280  3月25日 11:56  CU_gbY3_5G.nmconnection
-rw-------. 1 root root 261  4月22日 23:45 'CU_gbY3_主-5G 1.nmconnection'
-rw-------. 1 root root 320  3月28日 19:43  CU_gbY3_主-5G.nmconnection
-rw-------. 1 root root 294  4月 2日 20:01  CU_gbY3_主.nmconnection
-rw-------. 1 root root 274  3月25日 11:56  CU_gbY3.nmconnection
-rw-------. 1 root root 419  3月25日 13:54 'DESKTOP-S4HMEEB 8082.nmconnection'
-rw-------. 1 root root 384  3月29日 18:03  enp2s0.nmconnection
-rw-------. 1 root root 267  3月28日 19:42  GUEST_gbY3.nmconnection
man nmcli中提到的NetworkManager
root@localhost:/usr/lib/udev/rules.d# find / -name "NetworkManager"|xargs -n 1 file -i
/run/NetworkManager: inode/directory; charset=binary
/var/lib/NetworkManager: inode/directory; charset=binary
/etc/NetworkManager: inode/directory; charset=binary
/usr/share/licenses/NetworkManager: inode/directory; charset=binary
/usr/share/doc/NetworkManager: inode/directory; charset=binary
/usr/sbin/NetworkManager: application/x-pie-executable; charset=binary
/usr/lib64/NetworkManager: inode/directory; charset=binary
/usr/lib/NetworkManager: inode/directory; charset=binaryroot@localhost:/var/lib/NetworkManager# cd /etc/NetworkManager/
###NetworkManager.conf这个文件没有仔细研究
root@localhost:/etc/NetworkManager# ll
总计 8
drwxr-xr-x. 2 root root    6  4月29日 09:59 conf.d
drwxr-xr-x. 5 root root   57  3月 3日 08:00 dispatcher.d
drwxr-xr-x. 2 root root    6  4月29日 11:08 dnsmasq.d
drwxr-xr-x. 2 root root    6  3月 3日 08:00 dnsmasq-shared.d
-rw-r--r--. 1 root root 2263  3月 3日 08:00 NetworkManager.conf
drwxr-xr-x. 2 root root 4096  4月22日 23:45 system-connections
一些基本用法实际输出
 
root@localhost:/etc/NetworkManager# nmcli general status
STATE   CONNECTIVITY  WIFI-HW  WIFI    WWAN-HW  WWAN    METERED    
已连接   完全           已启用   已启用   missing   已启用   否(猜测) 
root@localhost:/etc/NetworkManager# nmcli general hostnameroot@localhost:/etc/NetworkManager# env|grep hostname
root@localhost:/etc/NetworkManager# set |grep hostname
_=hostnameCOMPREPLY+=($(compgen -A hostname -P "$prefix" -S "$suffix" -- "$cur"));
root@localhost:/etc/NetworkManager# export |grep hostname
root@localhost:/etc/NetworkManager# export |grep host
declare -x HOSTNAME="localhost"
root@localhost:/etc/NetworkManager# 
root@localhost:/etc/NetworkManager# nmcli general permissions
PERMISSION                                                        VALUE 
org.freedesktop.NetworkManager.checkpoint-rollback                是    
org.freedesktop.NetworkManager.enable-disable-connectivity-check  是    
org.freedesktop.NetworkManager.enable-disable-network             是    
org.freedesktop.NetworkManager.enable-disable-statistics          是    
org.freedesktop.NetworkManager.enable-disable-wifi                是    
org.freedesktop.NetworkManager.enable-disable-wimax               是    
org.freedesktop.NetworkManager.enable-disable-wwan                是    
org.freedesktop.NetworkManager.network-control                    是    
org.freedesktop.NetworkManager.reload                             是    
org.freedesktop.NetworkManager.settings.modify.global-dns         是    
org.freedesktop.NetworkManager.settings.modify.hostname           是    
org.freedesktop.NetworkManager.settings.modify.own                是    
org.freedesktop.NetworkManager.settings.modify.system             是    
org.freedesktop.NetworkManager.sleep-wake                         是    
org.freedesktop.NetworkManager.wifi.scan                          是    
org.freedesktop.NetworkManager.wifi.share.open                    是    
org.freedesktop.NetworkManager.wifi.share.protected               是    
root@localhost:/etc/NetworkManager# 
root@localhost:/etc/NetworkManager# nmcli general reload conf 
root@localhost:/etc/NetworkManager# nmcli general reload dns-rc 
root@localhost:/etc/NetworkManager# nmcli general reload dns-full
root@localhost:/etc/NetworkManager# 
root@localhost:/etc/NetworkManager# nmcli radio all
WIFI-HW  WIFI    WWAN-HW  WWAN   
已启用   已启用  missing  已启用 
root@localhost:/etc/NetworkManager# nmcli radio wifi
enabled
root@localhost:/etc/NetworkManager# nmcli radio wwan
enabled
root@localhost:/etc/NetworkManager# 

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com