nmcli connection show #查看网卡启用状态
nmcli connection modify enp216s0f0 ipv4.method manual ipv4.addresses 10.10.1.12/24 ipv4.gateway 10.10.1.10 ipv4.dns 8.8.8.8 #设置ip,掩码,网关,dns
对应的网卡配置文件
IPADDR=10.10.1.12
PREFIX=24
GATEWAY=10.10.1.10
DNS1=8.8.8.8
nmcli connection modify enp216s0f0 ipv4.method manual +ipv4.addresses 192.168.1.12/28 +ipv4.dns 114.114.114.114
对应的网卡配置文件
IPADDR1=192.168.1.12
PREFIX=28
DNS2=114.114.114.114
nmcli connection reload enp216s0f0 #重新加载网卡
nmcli connection down enp216s0f0 #停用网卡
nmcli connection up enp216s0f0 #启用网卡
systemctl restart NetworkManager #重启NetworkManager服务
标签:1.12,nmcli,enp216s0f0,NetwoekManger,网卡,connection,ipv4 From: https://www.cnblogs.com/santia-god/p/16935839.html