






















1> 查看设备和信息
nmcli device status
nmcli connection show
nmcli connection show --active
nmcli -f NAME,FILENAME connection show
2> 修改 connection-id
nmcli connection modify "Wired connection 1" connection.id net_eth0
nmcli connection modify "Wired connection 2" connection.id net_eth1
3> 通过connection-id 修改 等参数
nmcli connection modify net_eth0 ipv4.addresses "192.168.82.15/24"
nmcli connection modify net_eth0 ipv4.addresses "192.168.81.12/24" ipv4.gateway "192.168.81.1" ipv4.dns "8.8.8.8,1.1.1.1" ipv4.method manual 802-3-ethernet.speed 100 802-3-ethernet.duplex full 802-3-ethernet.auto-negotiate no
注意修改之后,需要重启才能生效
sudo nmcli connection down net_eth0
sudo nmcli connection up net_eth0
查看 脚本内容
# cat /etc/NetworkManager/system-connections/xx.nmconnection [connection] id=eth0-connection uuid=d46876b6-14d7-4ef4-a7a2-d323fc66c695 type=ethernet interface-name=eth0 permissions= timestamp=1651364936 [ethernet] mac-address-blacklist= [802-3-ethernet] speed=100 duplex=full auto-negotiate=false [ipv4] address1=192.168.1.20/24 dns-search= method=manual [ipv6] addr-gen-mode=stable-privacy dns-search= method=auto [proxy] #
4> 命令
ethtool -s eth0 autoneg off speed 1000 duplex full
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。