For a detailed tutorial see: http://blog.csdn.net/liukun321/article/details/6662950
1, the CentOS system in the virtual machine to connect the external network, we need to use the bridge network
2, normal configuration eth0 network port
Device=eth0hwaddr=00:0c:29:ef:00:83type=ethernetuuid=7493ecea-c1d2-4edc-a4f1-8381956c87cconboot=yes # Boot nm_controlled=yesbootproto=static #使用静态ipIPADDR =192.168.0.222 #主机所在网络中的ip地址NETMASK = 255.255.255.0network=192.168.0.1dns1=8.8.8.8
3. Service Network restart
4, route add default GW 192.168.0.1 #这里根据局域网网络ip的不同, Gateway different
5. Route View
Kernel IP Routing tabledestination Gateway genmask Flags Metric Ref use Iface192.168.0.0 * 255.255.255.0 u 0 0 0 eth0link-local * 255.255.0.0 u 1002 0 0 Eth0default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
And then we can.
There is a problem that will accompany
Workaround for Ping:unknown host www.baidu.com problem under Linux--ubuntu configuration of local area network
Connect Network is unreachable solution