I have the following host, with one interface and two GRE tunnels. It thinks it is locally connected to three networks.
eth0:
inet 10.1.0.123/16
gre1:
inet 172.16.0.123/16
gre2:
inet 192.168.0.123/16
The two GRE tunnels both have connections to a fourth network 10.0.0.0/16
(this is unrelated to eth0's network). I'd like to configure the routing tables on this host such that requests from the 10.0.0.0/16
network that come in via gre1
to 172.16.0.123/16
are responded to via gre1
as well. And vice-versa for the gre2
tunnel.
- If I don't configure a route for
10.0.0.0/16
, then the packets are filtered due torp_filter
. - If I disable
rp_filter
but don't configure a route for10.0.0.0/16
then the response packets go outeth0
due to thedefault
route. - I can set a route to
10.0.0.0/16
to eithergre1
orgre2
, but I can't set them both.
$ sudo ip route add 10.0.0.0/16 dev gre2
RTNETLINK answers: File exists
gre1
andgre2
networks mucking with things. Middleboxes being middleboxes. The syn,ack looks unsolicited and gets eaten by a firewall if it takes a different return path. This isn't so much an XY question as it's a "someone is paying me to deal with crappy networks" question. – Huckle Oct 04 '20 at 21:07