I have a switch on which 4 modem/routers and 2 servers are connected. Each server has 2 processes running and 2 NICs connected. What I want is that each process is routed out of either one of the NICs, but having a different default gateway, so that the traffic goes to a different router for each process.
Essentially what I want to do is this: Control, on the process level, what NIC the traffic goes out of.
I know that with 'Network Namespaces" I can send traffic from a process out of a specific NIC. My issue here is that both NICs should be on the same subnet. At the same time, traffic from NIC-1 should be directed to ROUTER-1 and traffic from NIC-2 to ROUTER-2
I am asking this from a Linux perspective.