I'm trying to create ip rules for multiple WAN links and keep connectivity across multiple local networks.
I have currently two network cards each connected to a different gateway to the internet and I'm routing based on the interface that the packet came in. Would it be possible to change that so that I would recieve packets from two gateways on the same network (one ethernet card instead of two) and answer back to the same gateway if the packet came from that gateway?
I'm not exaclty sure if this can be done with ip rule or maybe with iptables in the prerouting chain to set a connection mark? Where can I find help about the "ip rule" command? I only saw examples on the web but I haven't been able to find out for example what exactly does "ip rule from x.x.x.x" mean? Is it for incoming packets coming from exactly that IP/net or can I somehow address packets based on the previous hop?
yes, it would. You can use alias if you have static ip addresses. Moreover you can use vlan
you can start from LARTC