I've got a Linux VMware virtual machine (guest) configured with a NAT adapter on a 192.168.56.0 subnet. Its IP address is 192.168.56.128 and my Mac (host) got 192.168.56.1. Guest's default gateway is automatically set to 192.168.56.2 and is able to ping google from the guest. Host's Wi-Fi IP is 192.168.0.2,
I've configured my Wi-Fi router with following routing table to forward packets of 192.168.56.0 to 192.168.0.2 (my Mac)
pi@raspberrypi ~ $ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 172.16.4.1 0.0.0.0 UG 0 0 0 eth0
172.16.4.0 * 255.255.252.0 U 0 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 wlan0
192.168.56.0 192.168.0.2 255.255.255.255 UGH 0 0 0 wlan0
192.168.57.0 192.168.0.2 255.255.255.255 UGH 0 0 0 wlan0
But I'm unable to ping guest from any other device on the Wi-Fi network (192.168.0.0). So it's obvious that my Mac running OS X El Capitan is not forwarding the packets from 192.168.0.0 to 192.168.56.0
Best Answer
Your router is not responsible to route packets from 192.168.0.0 to 192.168.56.0, but the VM host is. You have to keep the static route 192.168.56.0 -> 192.168.0.2 on the router though. I don't know what's the purpose of the second route 192.168.57.0 -> 192.168.0.2 - probably a second NAT adapter on the host.
To reach your VM from other OS X devices in your 192.168.0.0 network you have to set up a static route on each of the 192.168.0.x machines to the VM host:
To make this route persistent add a launch daemon on each of the machines:
with the content
save the file (ctrl-O) and quit nano (ctrl-X).
Load the launch daemon with:
If the other devices in the 192.168.0.0 network are Linux/Windows/Android hosts use the respective commands to add a route:
Windows (persistent):
Linux:
To add a persistent route in Linux check your Linux distro documentation.