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.
UPDATE 1:
Essentially what I want to do is this: Control, on the process level, what NIC the traffic goes out of.
UPDATE 2:
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
UPDATE 3:
I am asking this from a Linux perspective.
Since your question isn't spesific for any OS, I'll answer in some general way too.
This can be done two ways:
Update: my answer still stands after both of your updates. :P
Still doable for Linux: LARTC is a good place to start. First, you create multiple routing tables, second, you create rules to assign specific kinds of traffic to these routing tables.