I have the following setup:
- My Lan is 10.56.8.0/23
- I have a gateway with internet access(INETIP-A) and the LAN IP 10.56.9.1
- I have another gateway with internet access(INETIP-B) and the LAN IP 10.56.9.15
- I have a PC used as default gateway for every host on the network with the IP 10.56.9.5. I want to do all my changes here.
The default internet connection is via 10.56.9.15 (it's faster), but I only have control over 10.56.9.1, so for some specific hosts this should be the route. To achieve this in a general way, I set up 10.56.9.5 as a router establishing 10.56.9.15 as default GW and adding specific routes for the hosts that need to be accessed via 10.56.9.1.
I now need to open access from the internet to a host VNC server. I have this problem.
- I forward 5900 port on 10.56.9.1 to the VNC server
- Some internet host A tries to connect to 10.56.9.1 external interface (INETIP-A), port 5900
- The VNC server has as default GW 10.56.9.5, which also has as default GW 10.56.9.15, so the answer to the connection gets routed back via 10.56.9.15 external interface (INETIP-B).
- When the answer package reaches its destination (the internet host A) it's discarded because it's coming from a different host than intended (INETIP-B instead of INETIP-A)
Is there a way to route back packets through a specific gateway without declaring the source ip and without making any specific setup on the end hosts (only on routers and gateways)?