I'm trying to figure out if I need further configuration to allow outbound traffic to work on a different interface than inbound traffic.
My setup is two servers.
Server1 has eth1
on VLAN100 and eth2
on VLAN200.
Server2 has eth1
on VLAN100 and no interface on VLAN200.
Server1 eth1
's IP is 10.1.0.2 in the 10.1.0.0/24 subnet with gateway1 10.1.0.1.
Server1 eth2
's IP is 10.2.0.2 in the 10.2.0.0/24 subnet with gateway2 10.2.0.1.
Server2 eth1
's IP is 10.1.0.3 in the 10.1.0.0/24 subnet with gateway1 10.1.0.1.
Gateway1 (10.1.0.1) will route 10.2.0.0/24 traffic through gateway2 (10.2.0.1) and vice versa.
Server1 can ping Server2's eth1
interface (10.1.0.2 -> 10.1.0.3).
Server2 can ping Server1's eth1
interface (10.1.0.3 -> 10.1.0.2).
When Server2 pings Server1's eth2
IP (10.2.0.2), the Echo request is received on Server1, but Server1 does not respond.
The source of the ping is 10.1.0.3, so Server1 should route the return traffic through its eth1 interface (10.1.0.2). So I think the round trip for this ping should be:
Flow of Inbound ICMP Echo Request
Server2 eth1 (10.1.0.3 - VLAN100)
Gateway1 (10.1.0.1 - VLAN100)
Gateway2 (10.2.0.1 - VLAN200)
Server1 eth2 (10.2.0.2 - VLAN200)
Expected Flow of Outbound ICMP Echo Reply
Server1 eth1 (10.1.0.2 - VLAN100)
Gateway1 (10.1.0.1 - VLAN100)
Server2 eth2 (10.1.0.3 - VLAN100)
Via tcpdump
on Server1, I can see that the ICMP packets from Server2 are reaching Server1's eth2
interface, but the ICMP response is not leaving Server1 on any interface. I can't figure out why they are being dropped in Server1.
EDIT: Further information
Both subnets have netmask 255.255.255.0 and the interfaces have been confirmed to also have netmask 255.255.255.0.
Server1 has default gateway through 10.1.0.1
Server2 has default gateway through 10.1.0.1
Server1:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.1.0.1 0.0.0.0 UG 0 0 0 eth1
10.2.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
10.1.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
Server2:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.1.0.1 0.0.0.0 UG 0 0 0 eth1
10.1.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1