I've got a setup like:
|<-->|---> server 1 <---|
clients <-| <--> proxy <-->
|<-->|---> server 2 <---|
Hope my ASCII art works :)
On my proxy I would like to be able to route back via the server, the original packet came from.
Right now I can make static rules like:
ip rule add from 10.0.0.0/10 table back_to_server
ip route add default via server1-IP-ADDRESS dev eth0 back_to_server
But I have to hardcode the server1-IP-ADDRESS
.
Is it possible to have this dynamic, so it will use the IP address, or mac-address, from where it last saw a packet come from?