I have a problem setting up iptables rules and routes on a Linux client for a scenario with DNAT and multiple gateways:
We have two gateways to the Internet. The first has a fixed IP, the second offers a better bandwidth. Both gateways do SNAT for outgoing traffic from our private network.
On the first gateway with the fixed IP I've set up port forwarding for port 22 so that all SSH traffic will be forwarded to my Linux client.
That works fine.
But only if I use this first gateway as default route on the Linux client.
When I switch the Linux client to the second gateway as default route, incoming SSH connections no longer work.
How can I setup the Linux client to send reply packets related to incoming SSH connections to the first gateway, but all other traffic to the second gateway?