linux 网络配置
[root@master ~]# nmcli connection modify eth0 ipv4.method manual ipv4.addresses “192.168.31.80/24”
[root@master ~]# ifdown eth0 && ifup eth0
nmcli connection modify ens33 ipv4.addresses “192.168.11.120/24” ipv4.method manual
[root@riyimei ~]# [root@riyimei ~]# nmcli connection modify ens32 ipv4.method manual ipv4.addresses "192.168.31.160" [root@riyimei ~]# nmcli connection modify ens32 ipv4.method manual gw4 "192.168.31.2" [root@riyimei ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens32 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=none DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=ens32 UUID=1d0f9991-746e-4230-94f2-0b2cbe8c8a97 DEVICE=ens32 ONBOOT=yes IPADDR=192.168.31.160 PREFIX=24 GATEWAY=192.168.31.2 [root@riyimei ~]#
[root@riyimei ~]# nmcli connection show NAME UUID TYPE DEVICE ens32 1d0f9991-746e-4230-94f2-0b2cbe8c8a97 ethernet ens32 [root@riyimei ~]# systemctl restart network.service