This tutorial is based on the following:
https://medium.com/upinatoms-com/sharing-a-network-between-your-vmware-fusion-linux-guest-and-your-mac-os-x-host-70d98271f142
Therefore this configuration don't require any changes inside linux guest VM as it network interfaces will continue using BOOTPROTO=dhcp
sudo vim /Library/Preferences/VMware\ Fusion/vmnet1/dhcpd.conf
This will open the dhcp.conf w/ the default configuration created upon VMWare Fusion installation.
Open the guest settings:
Then, add a new "Network Adapter" device:
You'll end with 2 network adapters:
For the first network adapter, set as "Share with my Mac".
For the second one, set as "Private to my Mac"
cat /Users/{YOUR-USER}/Virtual\ Machines.localized/{YOUR-VM-IMAGE}.vmwarevm/{YOUR-VM-IMAGE}.vmx | grep "ethernet0.generatedAddress ="
This will output something like this:
ethernet0.generatedAddress = "00:0D:23:5B:A1:F1"
copy this address to the clipboard as will be used in the next steps.
grep range /Library/Preferences/VMware\ Fusion/vmnet8/dhcpd.conf
This will output something like:
range 172.16.201.128 172.16.201.254;
PS. Your guest VM must use a IP address that is outside from this range!
sudo vim /Library/Preferences/VMware\ Fusion/vmnet1/dhcpd.conf
Add the following at the end of the file:
####### VMNET DHCP Configuration. End of "DO NOT MODIFY SECTION" #######
host rhsso-host-01 {
hardware ethernet 00:0D:23:5B:A1:F1;
fixed-address 192.168.243.21; # this is the network provided after installation. Could be different in your host
option domain-name-servers 8.8.8.8, 8.8.4.4;
}
PS. Note that the guest will be configured to use the google DNS for resolution.
PS2. The host name will be the same as your guest image name without spaces!
sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --configure
sudo /Applications/VMware\ Fusion.app/Contents/Library/services/services.sh --stop
sudo /Applications/VMware\ Fusion.app/Contents/Library/services/services.sh --start
Voila! Now you can access WAN from guest VM and also SSH from host to guest.
If you want to change the default subnet .243 for .100 (for example):
sudo vim /Library/Preferences/VMware\ Fusion/vmnet1/dhcpd.conf
Example:
Change subnet 192.168.243.0
to subnet 192.168.100.0
PS. Override every occurrence in the file.
sudo vim /Library/Preferences/VMware\ Fusion/networking
And replace the following line:
answer VNET_1_HOSTONLY_SUBNET 192.168.243.0
to
answer VNET_1_HOSTONLY_SUBNET 192.168.100.0
sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --configure
sudo /Applications/VMware\ Fusion.app/Contents/Library/services/services.sh --stop
sudo /Applications/VMware\ Fusion.app/Contents/Library/services/services.sh --start