nmcli dev show ens16e查看网卡
nmcli connection add con-name ethe ifname ens160 type ethernet添加网卡配置配置名 ethe连接到网卡ens160类型是ethernet
nmcli connection show ethe查看网卡配置
nmcli c modify ethe ipv4.method manual ipv4.addresses 192.168.151.280/24对已有网卡配置,没置静态ip
nmcli c modify eth0 ipv4.gateway 192.168.151.2 ipv4.dns 114.114.114.114 autoconnect no配置网关dns
自动连接
nmcli device disconnect ens16e网卡断连
nmcliconupethe网卡配置ethe生效