{"id":1578,"date":"2021-04-26T11:51:01","date_gmt":"2021-04-26T03:51:01","guid":{"rendered":"https:\/\/www.strongd.net\/?p=1578"},"modified":"2021-04-26T11:57:29","modified_gmt":"2021-04-26T03:57:29","slug":"nmcli%e7%bd%91%e7%bb%9c%e9%85%8d%e7%bd%ae%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/www.strongd.net\/?p=1578","title":{"rendered":"nmcli\u7f51\u7edc\u914d\u7f6e\u547d\u4ee4"},"content":{"rendered":"<p>nmcli\u4f7f\u7528\u65b9\u6cd5\u975e\u5e38\u7c7b\u4f3clinux ip\u547d\u4ee4\u3001cisco\u4ea4\u6362\u673a\u547d\u4ee4\uff0c\u5e76\u4e14\u652f\u6301tab\u8865\u5168\uff0c\u4e5f\u53ef\u5728\u547d\u4ee4\u6700\u540e\u901a\u8fc7-h\u3001&#8211;help\u3001help\u67e5\u770b\u5e2e\u52a9\u3002\u5728nmcli\u4e2d\u67092\u4e2a\u547d\u4ee4\u6700\u4e3a\u5e38\u7528\uff1a<\/p>\n<p>nmcli\u8bed\u6cd5\uff1a<br \/>\nnmcli [ OPTIONS ] OBJECT { COMMAND | help }<br \/>\nOBJECT\u548cCOMMAND\u53ef\u4ee5\u7528\u5168\u79f0\u4e5f\u53ef\u4ee5\u7528\u7b80\u79f0\uff0c\u6700\u5c11\u53ef\u4ee5\u53ea\u7528\u4e00\u4e2a\u5b57\u6bcd\uff0c\u5efa\u8bae\u7528\u5934\u4e09\u4e2a\u5b57\u6bcd\u3002OBJECT\u91cc\u9762\u6211\u4eec\u5e73\u65f6\u7528\u7684\u6700\u591a\u7684\u5c31\u662fconnection\u548cdevice\uff0c\u8fd8\u6709\u5176\u4ed6\u7684\u9009\u9879\u5728\u91cc\u6682\u65f6\u4e0d\u4ecb\u7ecd\uff0c\u8fd9\u91cc\u9700\u8981\u7b80\u5355\u533a\u5206\u4e00\u4e0bconnection\u548cdevice<\/p>\n<p>\u8be6\u7ec6\u7684\u4ecb\u7ecd\u8bf7\u770b\u8fd9\u7bc7\u6587\u7ae0\uff1a<a id=\"cb_post_title_url\" class=\"postTitle2\" href=\"https:\/\/www.strongd.net\/?p=1578\">RHEL\/CentOS\u7cfb\u5217\u53d1\u884c\u7248nmcli\u547d\u4ee4\u6982\u8ff0<\/a><\/p>\n<p>\u8fd9\u91cc\u4e3b\u8981\u4ecb\u7ecd\u547d\u4ee4\u7684\u4f7f\u7528<\/p>\n<p>1\u3001\u67e5\u770b\u7f51\u7edc\u63a5\u53e3\u4fe1\u606f<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nnmcli\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000##\u67e5\u770bip\uff08\u7c7b\u4f3c\u4e8eifconfig\u3001ip addr\uff09<\/p>\n<p>nmcli device status\u3000\u3000\u3000\u00a0 \u00a0##\u6240\u6709\u63a5\u53e3\u7684\u7b80\u7565\u4fe1\u606f<\/p>\n<p>nmcli device show \u3000\u3000\u3000\u00a0 \u00a0##\u6240\u6709\u63a5\u53e3\u7684\u8be6\u7ec6\u4fe1\u606f<\/p>\n<p>nmcli device show interface-name \u3000\u3000\u3000\u3000##\u7279\u5b9a\u63a5\u53e3\u7684\u8be6\u7ec6\u4fe1\u606f<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>2\u3001\u67e5\u770b\u8fde\u63a5\u4fe1\u606f<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nnmcli connection show \u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000##\u6240\u6709\u8fde\u63a5\u7684\u7b80\u7565\u4fe1\u606f<\/p>\n<p>nmcli connection show &#8211;active\u3000\u3000\u3000\u3000\u00a0\u00a0##\u663e\u793a\u6fc0\u6d3b\u7684\u8fde\u63a5<\/p>\n<p>nmcli connection show inteface-name\u3000\u3000\u00a0##\u67d0\u4e2a\u63a5\u53e3\u7684\u8be6\u7ec6\u8fde\u63a5\u4fe1\u606f<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>3\u3001\u6fc0\u6d3b\u8fde\u63a5\u4e0e\u53d6\u6d88\u6fc0\u6d3b\u94fe\u63a5<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n#\u6fc0\u6d3b\u8fde\u63a5<br \/>\nnmcli connection up connection-name<br \/>\nnmcli device connect interface-name<\/p>\n<p>#\u53d6\u6d88\u6fc0\u6d3b\u94fe\u63a5<br \/>\nnmcli connection down connection-name\u3000\u3000\u3000\u3000##\u8fd9\u4e2a\u64cd\u4f5c\u5f53\u53d6\u6d88\u4e00\u4e2a\u6fc0\u6d3b\u540e\uff0c\u5982\u679c\u6709\u5176\u5b83\u8fde\u63a5\u4f1a\u81ea\u52a8\u6fc0\u6d3b\u5176\u5b83\u8fde\u63a5<br \/>\nnmcli device disconnect interface-name \u3000\u3000\u3000\u3000##\u8fd9\u4e2a\u64cd\u4f5c\u4f1a\u53d6\u6d88\u63a5\u53e3\u4e0a\u7684\u6fc0\u6d3b\uff0c\u5982\u679c\u6709\u5176\u5b83\u8fde\u63a5\u4e5f\u4e0d\u4f1a\u81ea\u52a8\u6fc0\u6d3b\u5176\u5b83\u8fde\u63a5<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n\u5efa\u8bae\u4f7f\u7528 nmcli device disconnect(connect) interface-name\uff0c\u56e0\u4e3a\u8fde\u63a5\u65ad\u5f00\u53ef\u5c06\u8be5\u63a5\u53e3\u653e\u5230\u201c\u624b\u52a8\u201d\u6a21\u5f0f\uff0c\u8fd9\u6837\u505a\u7528\u6237\u8ba9 NetworkManager \u542f\u52a8\u67d0\u4e2a\u8fde\u63a5\u524d\uff0c\u6216\u53d1\u751f\u5916\u90e8\u4e8b\u4ef6\uff08\u6bd4\u5982\u8f7d\u6ce2\u53d8\u5316\u3001\u4f11\u7720\u6216\u7761\u7720\uff09\u524d\uff0c\u4e0d\u4f1a\u542f\u52a8\u4efb\u4f55\u81ea\u52a8\u8fde\u63a5\u3002<\/p>\n<p>4\u3001\u521b\u5efa\u52a8\u6001\u83b7\u53d6ip\u5730\u5740\u7684\u8fde\u63a5<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nnmcli connection add type ethernet con-name connection-name ifname interface-name<\/p>\n<p>add\u8868\u793a\u6dfb\u52a0\u8fde\u63a5,type\u540e\u9762\u662f\u6307\u5b9a\u521b\u5efa\u8fde\u63a5\u65f6\u5019\u5fc5\u987b\u6307\u5b9a\u7c7b\u578b\uff0c\u7c7b\u578b\u6709\u5f88\u591a\uff0c\u53ef\u4ee5\u901a\u8fc7nmcli c add type -h\u770b\u5230\uff0c\u8fd9\u91cc\u6307\u5b9a\u4e3aethernet\u3002con-name\u540e\u9762\u662f\u6307\u5b9a\u521b\u5efa\u8fde\u63a5\u7684\u540d\u5b57\uff0cifname\u540e\u9762\u662f\u6307\u5b9a\u7269\u7406\u8bbe\u5907\uff0c\u7f51\u7edc\u63a5\u53e3<\/p>\n<p>\u4f8b\u5b50\uff1anmcli connection add type ethernet con-name dhcp-ens33 ifname ens33<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>5\u3001\u521b\u5efa\u9759\u6001ip\u5730\u5740\u8fde\u63a5<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nnmcli connection add type ethernet con-name connection-name ifname interface-name ipv4.method manual ipv4.addresses address ipv4.gateway address<\/p>\n<p>ipv4.addresses\u540e\u9762\u6307\u5b9a\u7f51\u5361ipv4\u7684\u5730\u5740\uff0cipv4.gateway\u540e\u9762\u6307\u5b9a\u7f51\u5361\u7684ipv4\u7f51\u5173<\/p>\n<p>\u4f8b\u5b50\uff1anmcli connection add type ethernet con-name static-enp0s3 ifname enp0s3 ipv4.method manual ipv4.addresses 192.168.1.115\/24 ipv4.gateway 192.168.1.1<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n\u6ce8\u610f\uff1a\u521b\u5efa\u8fde\u63a5\u540e\uff0cNetworkManager \u81ea\u52a8\u5c06 connection.autoconnect \u8bbe\u5b9a\u4e3a yes\u3002\u8fd8\u4f1a\u5c06\u8bbe\u7f6e\u4fdd\u5b58\u5230 \/etc\/sysconfig\/network-scripts\/connection-name \u6587\u4ef6\u4e2d\uff0c\u4e14\u81ea\u52a8\u5c06 ONBOOT \u53c2\u6570\u8bbe\u5b9a\u4e3a yes\u3002<\/p>\n<p>6\u3001\u5e38\u7528\u53c2\u6570\u548c\u7f51\u5361\u914d\u7f6e\u6587\u4ef6\u53c2\u6570\u7684\u5bf9\u5e94\u5173\u7cfb\u8fd9\u4e2a\u53ea\u4f7f\u7528RHEL\u7cfb\u5217\u7684\u53d1\u884c\u7248\uff0c\u4e0d\u9002\u5408Debian\u7cfb\u5217\u53d1\u884c\u7248<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n<img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/i-beta\/1273933\/202003\/1273933-20200325211914161-1280908985.png\" alt=\"\" \/><\/p>\n<p>7\u3001\u4fee\u6539\u8fde\u63a5\u914d\u7f6e<\/p>\n<p><em id=\"__mceDel\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n<\/em>#\u6dfb\u52a0\u4e00\u4e2aip\u5730\u5740<br \/>\nnmcli connection modify connection-name ipv4.addresses 192.168.0.58 \u3000\u3000\u3000\u3000##\u5982\u679c\u5df2\u7ecf\u5b58\u5728ip\u4f1a\u66f4\u6539\u73b0\u6709ip<\/p>\n<p>#\u7ed9eth0\u6dfb\u52a0\u4e00\u4e2a\u5b50\u7f51\u63a9\u7801\uff08NETMASK\uff09<br \/>\nnmcli connection modify connection-name ipv4.addresses 192.168.0.58\/24<\/p>\n<p>#\u83b7\u53d6\u65b9\u5f0f\u8bbe\u7f6e\u6210\u624b\u52a8\uff08BOOTPROTO=static\/none\uff09<\/p>\n<p>nmcli connection modify connection-name ipv4.method manual<\/p>\n<p>#\u83b7\u53d6\u65b9\u5f0f\u8bbe\u7f6e\u6210\u81ea\u52a8\uff08BOOTPROTO=dhcp\uff09<\/p>\n<p>nmcli connection modify connection-name ipv4.method auto<\/p>\n<p>#\u6dfb\u52a0DNS<\/p>\n<p>nmcli connection modify connection-name ipv4.dns 114.114.114.114<\/p>\n<p>#\u5220\u9664DNS<\/p>\n<p>nmcli connection modify connection-name -ipv4.dns 114.114.114.114 \uff08\u6ce8\u610f\u8fd9\u91cc\u7684\u51cf\u53f7\uff09<\/p>\n<p>#\u6dfb\u52a0\u4e00\u4e2a\u7f51\u5173\uff08GATEWAY\uff09<\/p>\n<p>nmcli connection modify connection-name ipv4.gateway 192.168.0.2<\/p>\n<p>#\u53ef\u4e00\u5757\u5199\u5165\uff1a<\/p>\n<p>nmcli connection modify connection-name ipv4.dns 114.114.114.114 ipv4.gateway 192.168.0.2<\/p>\n<p>#\u4fee\u6539\u8fde\u63a5\u662f\u5426\u968f\u5f00\u673a\u6fc0\u6d3b<br \/>\nnmcli connection modify connection-name connection.autoconnect no\/on<\/p>\n<p>#\u914d\u7f6e\u9759\u6001\u8def\u7531\uff0c\u91cd\u542f\u7cfb\u7edf\u4f9d\u7136\u751f\u6548<\/p>\n<p>nmcli connection modify connection-name +ipv4.routes &#8220;192.168.12.0\/24 10.10.10.1&#8221;<\/p>\n<p>\u8fd9\u6837\u4f1a\u5c06 192.168.122.0\/24 \u5b50\u7f51\u7684\u6d41\u91cf\u6307\u5411\u4f4d\u4e8e 10.10.10.1 \u7684\u7f51\u5173,\u540c\u65f6\u5728 \/etc\/sysconfig\/network-scripts\/\u76ee\u5f55\u4e0b\u751f\u4ea7\u4e00\u4e2aroute-connection-name\u7684\u6587\u4ef6\uff0c\u8fd9\u91cc\u8bb0\u5f55\u4e86\u8fd9\u4e2a\u8fde\u63a5\u7684\u8def\u7531\u4fe1\u606f<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>8\u3001\u91cd\u8f7dconnection<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n#\u91cd\u8f7d\u6240\u6709ifcfg\u5230connection\uff08\u4e0d\u4f1a\u7acb\u5373\u751f\u6548\uff0c\u5728\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\u66f4\u6539\u540e\u9700\u8981\u505a\u8fd9\u4e2a\u64cd\u4f5c\u8ba9NM\u77e5\u9053\u4f60\u505a\u4e86\u66f4\u6539\uff0c\u91cd\u65b0\u6fc0\u6d3b\u8fde\u63a5\u6216\u91cd\u542fNM\u670d\u52a1\u540e\u751f\u6548\uff09<br \/>\nnmcli connection reload<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n#\u91cd\u8f7d\u6307\u5b9aifcfg\u5230connection\uff08\u4e0d\u4f1a\u7acb\u5373\u751f\u6548\uff0c\u91cd\u65b0\u6fc0\u6d3b\u8fde\u63a5\u6216\u91cd\u542fNM\u670d\u52a1\u540e\u751f\u6548\uff09<br \/>\nnmcli connection load \/etc\/sysconfig\/network-scripts\/ifcfg-connection-name<br \/>\nnmcli connection load \/etc\/sysconfig\/network-scripts\/route-connection-name<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>9\u3001\u5220\u9664connection<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nnmcli connection delete connection-name<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>10\u3001\u8bbe\u7f6e\u4e3b\u673a\u540d<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n#\u67e5\u8be2\u5f53\u524d\u4e3b\u673a\u540d<br \/>\nnmcli general hostname<\/p>\n<p>#\u4fee\u6539\u4e3b\u673a\u540d<br \/>\nnmcli general hostname new-hostname<\/p>\n<p>#\u91cd\u542fhostname(\u4e3b\u673a\u540d)\u670d\u52a1<br \/>\nsystemctl restart systemd-hostnamed<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n\u6ce8\u610f\uff1aCentOS7 \/ Redhat7 \u4e0b\u7684\u4e3b\u673a\u540d\u7ba1\u7406\u662f\u57fa\u4e8e\u7cfb\u7edf\u670d\u52a1systemd-hostnamed\uff0c\u670d\u52a1\u81ea\u8eab\u63d0\u4f9b\u4e86hostnamectl\u547d\u4ee4\u7528\u4e8e\u4fee\u6539\u4e3b\u673a\u540d\uff0c\u63a8\u8350\u8fd9\u79cd\u65b9\u5f0f\u8fdb\u884c\u4fee\u6539\uff1b<br \/>\n\u4f7f\u7528nmcli\u547d\u4ee4\u66f4\u6539\u4e3b\u673a\u540d\u65f6\uff0csystemd-hostnamed\u670d\u52a1\u5e76\u4e0d\u77e5\u6653 \/etc\/hostname \u6587\u4ef6\u88ab\u4fee\u6539\uff0c\u56e0\u6b64\u9700\u8981\u91cd\u542f\u670d\u52a1\u53bb\u8bfb\u53d6\u914d\u7f6e\uff1b<\/p>\n","protected":false},"excerpt":{"rendered":"<p>nmcli\u4f7f\u7528\u65b9\u6cd5\u975e\u5e38\u7c7b\u4f3clinux ip\u547d\u4ee4\u3001cisco\u4ea4\u6362\u673a\u547d\u4ee4\uff0c\u5e76\u4e14\u652f\u6301tab\u8865\u5168\uff0c\u4e5f\u53ef\u5728\u547d\u4ee4\u6700\u540e\u901a\u8fc7-h\u3001&#8211;help\u3001help\u67e5\u770b\u5e2e\u52a9\u3002\u5728nmcli\u4e2d\u67092\u4e2a\u547d\u4ee4\u6700\u4e3a\u5e38\u7528\uff1a nmcli\u8bed\u6cd5\uff1a nmcli [ OPTIONS ] OBJECT { COMMAND | help } OBJECT\u548cCOMMAND\u53ef\u4ee5\u7528\u5168\u79f0\u4e5f\u53ef\u4ee5\u7528\u7b80\u79f0\uff0c\u6700\u5c11\u53ef\u4ee5\u53ea\u7528\u4e00\u4e2a\u5b57\u6bcd\uff0c\u5efa\u8bae\u7528\u5934\u4e09\u4e2a\u5b57\u6bcd\u3002OBJECT\u91cc\u9762\u6211\u4eec\u5e73\u65f6\u7528\u7684\u6700\u591a\u7684\u5c31\u662fconnection\u548cdevice\uff0c\u8fd8\u6709\u5176\u4ed6\u7684\u9009\u9879\u5728\u91cc\u6682\u65f6\u4e0d\u4ecb\u7ecd\uff0c\u8fd9\u91cc\u9700\u8981\u7b80\u5355\u533a\u5206\u4e00\u4e0bconnection\u548cdevice \u8be6\u7ec6\u7684\u4ecb\u7ecd\u8bf7\u770b\u8fd9\u7bc7\u6587\u7ae0\uff1aRHEL\/CentOS\u7cfb\u5217\u53d1\u884c\u7248nmcli\u547d\u4ee4\u6982\u8ff0 \u8fd9\u91cc\u4e3b\u8981\u4ecb\u7ecd\u547d\u4ee4\u7684\u4f7f\u7528 1\u3001\u67e5\u770b\u7f51\u7edc\u63a5\u53e3\u4fe1\u606f &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; nmcli\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000##\u67e5\u770bip\uff08\u7c7b\u4f3c\u4e8eifconfig\u3001ip addr\uff09 nmcli device status\u3000\u3000\u3000\u00a0 \u00a0##\u6240\u6709\u63a5\u53e3\u7684\u7b80\u7565\u4fe1\u606f nmcli device show \u3000\u3000\u3000\u00a0 \u00a0##\u6240\u6709\u63a5\u53e3\u7684\u8be6\u7ec6\u4fe1\u606f nmcli device show interface-name \u3000\u3000\u3000\u3000##\u7279\u5b9a\u63a5\u53e3\u7684\u8be6\u7ec6\u4fe1\u606f &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; 2\u3001\u67e5\u770b\u8fde\u63a5\u4fe1\u606f &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; nmcli connection show \u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000##\u6240\u6709\u8fde\u63a5\u7684\u7b80\u7565\u4fe1\u606f nmcli connection show &#8211;active\u3000\u3000\u3000\u3000\u00a0\u00a0##\u663e\u793a\u6fc0\u6d3b\u7684\u8fde\u63a5 nmcli connection show inteface-name\u3000\u3000\u00a0##\u67d0\u4e2a\u63a5\u53e3\u7684\u8be6\u7ec6\u8fde\u63a5\u4fe1\u606f &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; 3\u3001\u6fc0\u6d3b\u8fde\u63a5\u4e0e\u53d6\u6d88\u6fc0\u6d3b\u94fe\u63a5 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; #\u6fc0\u6d3b\u8fde\u63a5 nmcli connection &hellip; <a href=\"https:\/\/www.strongd.net\/?p=1578\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">nmcli\u7f51\u7edc\u914d\u7f6e\u547d\u4ee4<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[21,245],"class_list":["post-1578","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux-2","tag-nmcli"],"_links":{"self":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/1578","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1578"}],"version-history":[{"count":1,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/1578\/revisions"}],"predecessor-version":[{"id":1579,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/1578\/revisions\/1579"}],"wp:attachment":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}