1.修改

vim /etc/sysconfig/network-scripts/ifcfg-eth0

TYPE=Ethernet
DEVICE=eth0
ONBOOT=yes
IPADDR=10.0.42.211
NETMASK=255.255.255.0
GATEWAY=10.0.42.254
DNS1=223.5.5.5

2.重启网络

systemctl  restart network