I like to make it possible to access my Macs with Screen Sharing (or Remote Management) via a non-standard gateway, but when I try, I get only timeouts.
Here is my setup:
My LAN is connected thru a switch to all my Macs and to two routers, which each talk to a different internet provider. Each router has its own subnet (router 1: 192.168.1.1/24, router 2: 192.168.2.1/24).
The Macs in this network are set up with their main (default) interface to use router 1's subnet, but also have an additional virtual network accessing router 2.
Both routers have their incoming ports mapped to each particular Mac (using different incoming port numbers, which then get remapped to 5900 on each local Mac).
The problem I have is that I can reach my Macs from the outside only thru the router that is currently set as the default gateway on those Macs, while accessing the Macs thru the other router always times out. Of course, if I switch a Mac's default gateway to the other router, then I can access the Mac via that router from the outside, proving there's nothing wrong with the router's port mapping setup.
I'd think that it should be possible to have a service on computer respond via the same network interface from which its socket was contacted, right? But I guess Screen Sharing does not follow that standard behavior, somehow.
Is there a way around it without having to reconfigure the Macs to use the "right" default gateway?
The goal here is that should one of my routers or its internet provider fail to work, I still want to be able to access my Macs thru the other provider / router. All this has to work while I am not "at home", i.e. it has to work remotely.