通过在网上查资料和自己摸索,现将自己的配置步骤和大家分享:
1.mac 系统版本 10.11.6
2.vmvare fusion版本 8.5.3
3.虚拟机镜像 centos6.9
步骤一、
前提:已经安装好虚拟机。
$ cd /Library/Preferences/VMware\ Fusion/
$ cat networking
VERSION=1,0
answer VNET_1_DHCP yes
answer VNET_1_DHCP_CFG_HASH 7552DDA4EDAF6009007459861FB4E46A441F437D
answer VNET_1_HOSTONLY_NETMASK 255.255.255.0
answer VNET_1_HOSTONLY_SUBNET 172.16.58.0
answer VNET_1_VIRTUAL_ADAPTER yes
answer VNET_8_DHCP no
answer VNET_8_DHCP_CFG_HASH 0977F207EEBF2CC8F1BD290E2FE569C96BD58FB6
answer VNET_8_HOSTONLY_NETMASK 255.255.255.0
answer VNET_8_HOSTONLY_SUBNET 192.168.200.0
answer VNET_8_NAT yes
answer VNET_8_VIRTUAL_ADAPTER yes
answer VNET_8_VIRTUAL_ADAPTER_ADDR 192.168.200.1
步骤二、
$ cd vmnet8/
$ cat nat.conf
# VMware NAT configuration file
[host]
# NAT gateway address
ip = 192.168.200.2
netmask = 255.255.255.0
# VMnet device if not specified on command line
device = vmnet8
# Allow PORT/EPRT FTP commands (they need incoming TCP stream ...)
activeFTP = 1
步骤三、
[root@localhost network-scripts]# cat ifcfg-eth0
DEVICE=eth0
HWADDR=
TYPE=Ethernet
UUID=
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=192.168.200.13
NETMASK=255.255.255.0
GATEWAY=192.168.200.2
PREFIX=24
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
DNS1=192.168.200.2
DNS2=8.8.8.8
步骤一、二在本机操作,步骤三在虚拟机操作。
这只是我自己摸索的,虽然实现了结果,但是肯定配置的不是很好,如有其它见解,欢迎不吝赐教!