My server has two interfaces.
First interface is directly connected to local ISP and second interface is connected to other region that connected with GRE tunnel.
So it looks like:
┌──────────────────┐ ────────────────── ISP 1
│ Server (x.x.x.1) │
└──────────────────┘ ─── GRE Tunnel ─── ISP 2
Each ISP, we announce same prefix(anycast) so each interface has same IP address. (x.x.x.1)
Our default route is ISP 1, so currently, all traffic is routed to ISP 1(Interface 1), regardless of incoming interface is Interface 1 or Interface 2.
I want to configure it so that packets coming in from Interface 1 are sent out through Interface 2, and packets coming in from Interface 2 are sent out through Interface 2. (Like sticky session in load balancer)
Our operating system is CentOS 7. Is there any way to configure this? I tried to import route table from ISP 2 and override route to ISP 2 that matches ISP 2 route table, but it failed, because ISP 2's route table is asymmetric. (So I sent packet to ISP 1 but it returns from ISP 2.)