redhat conf .net sys span chang class broadcast
安装了 centos6.5 虚拟机,使用的是桥接方式。把所有的配置已经写到 / etc/sysconfig/network-scripts/ifcfg-eth0 中后,发现内网可以 ping 通,外网却无法访问。
ping 了一下 dns 的 ip 也是不通的。最后按照一篇文章的说明,设置了默认网关后访问外网正常了。
我的 ifcfg-eth0 配置文件如下:
- DEVICE=eth0
- NM_CONTROLLED=yes
- TYPE=Ethernet
- BOOTPROTO=static
- IPADDR=192.168.1.103
- NETMASK=255.255.255.0
- # If you're having problems with gated making 127.0.0.0/8 a martian,
- # you can change this to something else (255.255.255.255, for example)
- BROADCAST=127.255.255.255
- ONBOOT=yes
- NAME=systemeth0
- DNS1=114.114.114.114
- DNS2=192.168.1.1
- GETWAY=192.168.1.1
- DEFROUTE=yes
- NETWORKING=yes
设置默认网关的命令:
- route add
- default gw 192.168.1.1 dev eth0
参考链接:
http://www.jb51.net/os/RedHat/156067.html
centos6.5 虚拟机无法访问外网解决办法
来源: http://www.bubuko.com/infodetail-2016487.html