0. 虚拟机的编辑-》网络配置-》 wmnet0 桥接为你的真实网卡
1. 配置 ifcfg-eth0 , 注意gateway 192.168.42.2
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
#BOOTPROTO=dhcp
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.42.129
NETMASK=255.255.255.0
GATEWAY=192.168.42.2
2. /etc/resolv.conf 填写 dns
nameserver 202.106.196.115
nameserver 192.168.42.1
search localhost
3. NAT 模式,外部机器访问 本机的虚拟机 -- 端口映射
菜单- >edit -> virtual Network Editor - >VMnet8 ( TYPE = NAT的那个)
NAT Setting -> Add -> host port 是主机的 对外端口 ,下面 是 虚拟机的 ip 和端口,
然后配置一下虚拟机的端口,(参考apache 一些记录 )