Setting my default gateway no longer works in MacOS

Hello. I'm having difficulty with some simple IP routing. This used to work with Yosemite (probably later versions, too, but I don't recall) and absolutely does not work in Big Sur-onwards on my newer Apple Silicon MacBook Pro.


Scenario: I have a virtual network provided by Desktop Parallels or some other VM. This VM has internet access. I want the host Mac OS to have internet access, therefore I setup the host VM as a router. With this setup on older MacOS versions I could get internet access merely by setting the VM's IP as the gateway.


Current behavior: When I use the same setup on this Mac, I can set the gateway (as reported by netstat -nr) and I can ping the gateway, but MacOS refuses to use it as the gateway. Other VMs on the same virtual network have no difficulty using the exact same gateway on the exact same IP. This is why I know the router is 100% working.


I even setup a NetworkService in /Library/Preferences/SystemConfiguration/preferences.plist and it also sets the default gateway correctly (again, confirmed with netstat -nr). Still, it refuses to route. Everything looks identical to the old setup; the only difference is the OS version and the ISA.


I'll include some screen shots:





MacBook, macOS 10.14

Posted on Sep 23, 2023 1:54 PM

Reply

Similar questions

7 replies

Jan 8, 2024 9:23 AM in response to Mac_SE

Hi @Mac_SE, did you manage to solve the issue?

I'm trying to do something similar and it is also not working for me:

  • start a qemu virtual machine with 2 interfaces to act as a router for the MacOS host
    • the VM's "WAN" interface is using MacOS "vmnet-bridged" backend, bridged to host's eth7 physical interface and internet access is working perfectly fine in VM.
    • the VM's "LAN" interface is using MacOS "vmnet-shared" backend, 172.**3 address assigned to it.
    • "bridge101" device is created on the host, 172.**1 address assigned to it
    • IPv4 forwarding is enabled inside VM
    • masquerading is set for connections leaving through VM's "WAN" interface.
    • no firewall of any kind is running in VM
  • I'm then creating a new static route on the host: "sudo route add default 172.**3"
  • I'm deleting the host's existing default route
  • I can connect from host to VM through the "LAN" interface
  • I can connect from VM to internet hosts through the "WAN" interface
  • however, connecting from host to internet addresses doesn't work; packet capture doesn't show any TCP traffic on VM lan interface
  • Additionally I see strange behavior on the host - it thinks it has direct ethernet link to the internet hosts, it sends ARP requests to internet hosts and it creates cloned routes for these hosts in the routing table.


[Edited by Moderator]

Sep 23, 2023 2:30 PM in response to Mac_SE

Hello. I'm having difficulty with some simple IP routing. This used to work with Yosemite (probably later versions, too, but I don't recall) and absolutely does not work in Big Sur-onwards on my newer Apple Silicon MacBook Pro.


Scenario: I have a virtual network provided by Desktop Parallels or some other VM. This VM has internet access. I want the host Mac OS to have internet access, therefore I setup the host VM as a router. With this setup on older MacOS versions I could get internet access merely by setting the VM's IP as the gateway.


Current behavior: When I use the same setup on this Mac, I can set the gateway (as reported by netstat -nr) and I can ping the gateway, but MacOS refuses to use it as the gateway. Other VMs on the same virtual network have no difficulty using the exact same gateway on the exact same IP. This is why I know the router is 100% working.


I even setup a NetworkService in /Library/Preferences/SystemConfiguration/preferences.plist and it also sets the default gateway correctly (again, confirmed with netstat -nr). Still, it refuses to route. Everything looks identical to the old setup; the only difference is the OS version and the ISA.


I'll include some screen shots:






As proof that the router works this is from another VM (only the router VM has internet):





This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Setting my default gateway no longer works in MacOS

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.