Mac 添加vmware fusion nat网卡信息
进到vmware fusion目录
cd /Library/Preferences/VMware\ Fusion
➜ VMware Fusion ls
lastLocationUsed thnuclnt
license-fusion-120-e10-202001 vmnet1
networking vmnet2
networking.bak.0 vmnet8
➜ VMware Fusion
修改 networking
添加红色标记信息
根据自己需求设置网段
answer VNET_2_HOSTONLY_NETMASK 255.255.255.0
answer VNET_2_HOSTONLY_SUBNET 172.16.10.0
answer VNET_2_NAT yes
answer VNET_2_NAT_PARAM_UDP_TIMEOUT 30
answer VNET_2_VIRTUAL_ADAPTER yes
修改nat.conf
➜ vmnet2 pwd
/Library/Preferences/VMware Fusion/vmnet2
➜ vmnet2 ls
nat.conf nat.conf.bak
➜ vmnet2 head -n 12 nat.conf
# VMware NAT configuration file
# Manual editing of this file is not recommended. Using UI is preferred.
[host]
# Use MacOS network virtualization API
useMacosVmnetVirtApi = 1
# NAT gateway address
ip = 172.16.10.1
netmask = 255.255.255.0
修改虚拟机配置
在这里选择vmnet2
修改机器IP信息
修改SSH配置信息
修改完成后,重启ssh
需要修改下ssh允许root和使用密码登录