参考资料:http://blog.csdn.net/iamfafa/article/details/6209009
安装虚拟机的时候 就直接选择桥接,可以直接 使用
查看此状态下的配置如下 :
虚拟环境--
虚拟机网卡--
虚拟机IP配置文件
vim /etc/sysconfig/network-scripts/ifcfg-eth0 //IP配置
EVICE="eth0"
BOOTPROTO="dhcp"
HWADDR="00:0C:29:88:0B:13"
IPV6INIT="yes"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="3800e300-7a59-4201-ae9f-9a16a280705f"
vi /etc/resolv.conf //DNS配置
# Generated by NetworkManager # No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
vi /etc/sysconfig/network //网关的配置文件
NETWORKING=yes
HOSTNAME=localhost.localdomain
~