On 12/28/2015 01:54 PM, Александр Кириллов wrote:
> By the gateway I mean a host with 2 public ips on separate interfaces
> connected to lan via the third interface. My undestanding of the OP is
> that all traffic coming to some other host in the lan through one of
> the public interfaces on the gateway must be routed back out that same
> interface.
Joey said that he had a server, not a router, so I did not get the same
impression as you. However, even in the situation you describe, where a
Linux router has two WAN links and one LAN, you can use "ip rule" to
manage multi-homed routing without using iptables to mark packets based
on MAC addresses, or any other exotic solutions.