为网卡添加一个会话static,在此会话配置ip地址为x.x.x.123
route -n
cd /etc/sysconfig/network-scripts/
nmcli connection add type ethernet ifname ens160 con-name static autoconnect yes
nmcli connection modify static ipv4.addresses 192.168.37.123 ipv4.dns92.168 .37.2 ipv4.gateway 192.168.37.2 ipv4 .method manual
cat ifcfg-static