参考 nmcliコマンド説明・英文
https://www.freedesktop.org/software/ModemManager/man/1.14.0/mmcli.1.html
備忘
状態を参照
$ nmcli connection show
NAME UUID TYPE DEVICE
eth0-s d24efc82-c622-4a25-afe1-9b11832ad2ed ethernet eth0
lo 700f3868-a17f-452f-b4cb-611708033401 loopback lo
wifi-wlan0 056ee7a8-3a00-4bfc-902a-7534472d479c wifi wlan0
Wired connection 1 e28a7cca-8daf-3c89-9286-fe736ca0432b ethernet --
$ nmcli connection show eth0-s
connection.id: eth0-s
connection.uuid: d24efc82-c622-4a25-afe1-9b11832ad2ed
connection.stable-id: --
connection.type: 802-3-ethernet
以下略
$ nmcli device
DEVICE TYPE STATE CONNECTION
eth0 ethernet connected eth0-s
lo loopback connected (externally) lo
wlan0 wifi connected wifi-wlan0
p2p-dev-wlan0 wifi-p2p disconnected --
$ nmcli device show eth0
GENERAL.DEVICE: eth0
GENERAL.TYPE: ethernet
GENERAL.HWADDR: B8:27:EB:C8:15:09
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected)
GENERAL.CONNECTION: eth0-s
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/4
WIRED-PROPERTIES.CARRIER: on
IP4.ADDRESS[1]: 192.168.213.81/24
IP4.GATEWAY: --
IP4.ROUTE[1]: dst = 192.168.213.0/24, nh = 0.0.0.0, mt = 100
IP6.ADDRESS[1]: 2402:6b00:de24:3700:2b5d:1bc9:46ea:3701/64
IP6.ADDRESS[2]: fe80::a319:8e72:547:7b81/64
IP6.GATEWAY: fe80::1266:82ff:fec0:3404
IP6.ROUTE[1]: dst = fe80::/64, nh = ::, mt = 1024
IP6.ROUTE[2]: dst = 2402:6b00:de24:3700::/64, nh = ::, mt = 100
IP6.ROUTE[3]: dst = ::/0, nh = fe80::1266:82ff:fec0:3404, mt = 100
IP6.DNS[1]: 2402:6b00:de24:3700:1266:82ff:fec0:3404
接続設定を有効化
sudo nmcli connection reload
sudo nmcli connection up 接続名
接続を停止
sudo nmcli connection down 接続名
接続設定を削除
sudo nmcli connection delete 接続名
リンク
https://qiita.com/Saito5656/items/51502ff6b15a0411452c
https://densan-hoshigumi.com/server/centos-nmcli-operation
https://milestone-of-se.nesuke.com/sv-basic/linux-basic/nmcli/
https://qiita.com/tatsuya-k_net/items/e37fa463e51d1726a60c
https://endy-tech.hatenablog.jp/entry/2019/01/14/012743
https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/7/html/networking_guide/sec-configuring_ip_networking_with_nmcli
https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/9/html/configuring_basic_system_settings/configuring-an-ethernet-connection-by-using-nmcli_assembly_configuring-and-managing-network-access
https://raspida.com/networkmanager-wifi-ap