查看centos网关是否设置正确
[root@localhost ethan]# grep GATEWAY /etc/sysconfig/network-scripts/ifcfg*
/etc/sysconfig/network-scripts/ifcfg-eth0:GATEWAY=192.168.199.1
不正确就设置:
[root@localhost ethan]#vim /etc/resolv.conf 如下:
nameserver 192.168.15.1 --此处为VMWare中配置的网关
search localdomain
设置网关:
[root@localhost ethan]#vim /etc/sysconfig/network 如下:
NETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=192.168.15.1
[root@localhost ethan]# vim /etc/sysconfig/network-scripts/ifcfg-eth0 如下:
TYPE=Ethernet
BOOTPROTO=static
DEVICE=eth0
IPADDR=192.168.199.213
NETMASK=255.255.255.0
ONBOOT=yes
GATEWAY=192.168.199.1
4.最后重启网络服务
service network restart
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)