centos/redhat 修改虚拟机IP

1.编辑网卡文件
vi /etc/sysconfig/network-scripts/ifcfg-eth0
2.修改参数:
ONBOOT=yes
BOOTPROTO=static
3.输入参数
IPADDR=192.168.1.70
GATEWAY=192.168.1.1
NETMASK=255.255.255.0
DNS1=202.106.46.151
DNS2=202.106.195.68
4.保存文件
5.重启网络服务
centos6: service network restart
centos7: systemctl restart network
centos8: service NetworkManager restart

猜你喜欢

转载自blog.csdn.net/qq_39181396/article/details/110539719