I've got a Linux VMware virtual machine (guest) configured with a NAT adapter on a subnet. Its IP address is and my Mac (host) got Guest's default gateway is automatically set to and is able to ping google from the guest. Host's Wi-Fi IP is,

I've configured my Wi-Fi router with following routing table to forward packets of to (my Mac)

pi@raspberrypi ~ $ route

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         UG    0      0        0 eth0      *        U     0      0        0 eth0     *        U     0      0        0 wlan0 UGH   0      0        0 wlan0 UGH   0      0        0 wlan0

But I'm unable to ping guest from any other device on the Wi-Fi network ( So it's obvious that my Mac running OS X El Capitan is not forwarding the packets from to

2 Answers 2


Your router is not responsible to route packets from to, but the VM host is. You have to keep the static route -> on the router though. I don't know what's the purpose of the second route -> - probably a second NAT adapter on the host.

To reach your VM from other OS X devices in your network you have to set up a static route on each of the 192.168.0.x machines to the VM host:

sudo route add -net

To make this route persistent add a launch daemon on each of the machines:

sudo nano /Library/LaunchDaemons/local.staticroute.vm.plist

with the content

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

save the file (ctrl-O) and quit nano (ctrl-X).

Load the launch daemon with:

sudo launchctl load -w /Library/LaunchDaemons/local.staticroute.vm.plist

If the other devices in the network are Linux/Windows/Android hosts use the respective commands to add a route:

Windows (persistent):

route add -p mask 


route add -net netmask gw

To add a persistent route in Linux check your Linux distro documentation.

  • 1
    what is this xml? This is the sickest use of XML i've ever come across!
    – Necktwi
    Feb 3, 2016 at 18:48
  • This is to reach from other Macs on the network
    – Necktwi
    Feb 4, 2016 at 4:19
  • I'm unable to reach my VM even from my router!
    – Necktwi
    Feb 4, 2016 at 4:20
  • Yes my VM host is responsible for routing packets from to So how to make the host(Mac) to do that?
    – Necktwi
    Feb 5, 2016 at 6:37
  • @neckTwi Please implement my solution. Report back if you still have trouble. I tested it in a similar environment as yours and it works. Please change the default gateway on the Linux VM to (because this is the host's=gateway internal address).
    – klanomath
    Feb 5, 2016 at 12:54

This didn't survive reboot for me in 10.11. I followed these instructions:

sudo networksetup -setadditionalroutes Wi-Fi

where Wi-Fi is found using networksetup -listallnetworkservices.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .