We have a network mostly set up with a redundant pair of Linux Iptables firewalls/routers, but we're missing a crucial piece of the puzzle. Any local traffic destined to the secondary router succeeds in the same subnet, but fails to the "main" router ip. Here's an example:
Router1 and Router2 both have interfaces on 10.0.0.0/24 (Subnet0) and 10.0.1.0/24, (Subnet1) with a VIP 10.0.1.1 shared via ucarp.
Webserver1 has IP 10.0.1.11, and its default gateway is 10.0.1.1
Pings are successful from Webserver1 to Router1 on the Subnet0 and Subnet1 interfaces
Pings are successful, as expected, from Webserver1 to Router2 on the Subnet1 interface. (no routing involved)
However, pings fail from Webserver1 to Router2 on the Subnet0 interface. Router1 receives the echo request on the Subnet1 interface and forwards it out the Subnet0 interface, as expected, but when the echo requests arrive at Router2 on the correct (Subnet0) interface, Router2 does not send a reply.
Router2 logs a martian packet each time this occurs. Jul 31 21:39:33 Router2 kernel: [2772508.610259] martian source 10.0.0.3 from 10.0.1.11, on dev bond0.1000
We think the martian log line is caused by the packet arriving on a different interface from a network that the router already has a different interface on, which the system considers an invalid source interface. What is the solution to this problem? Should we be doing something like SNAT when Router1 sends to Router2?