This is my first question on this forum. Hope I will be able to help others in the future.
I have two boxes with two NICs each. I know that using bonding I can have some degree of fault tolerance but I feel I need something else. What I want is different traffic (PING, LOGIN, etc..) following one path and the other traffic (DRBD, web, etc..) following the other one.
Just in the case that one of the links fail, I want part of the other traffic (in my case, just IP for a heartbeat mechanism) following the same path as DRBD and web do. Is this possible?, what do I need to monitor links status and acct accordingly?. I would know how to do this statically (iproute and so on), but need it dynamically...
You do not want what you're asking for in the Question. Use a single bond interface. Bonding has several different modes to accommodate various balances of throughput and fault tolerance. Be sure to put the time into configuring it correctly for your networks capability's and your application's requirements.
That said, you could create two bonding devices Bond0 and Bond1 which both have members Eth0 and Eth1, with Bond0 having Eth0 as primary and vice versa for Bond1, and configure the Bond interfaces for failover only. Then assign IPs to each of the Bond interfaces. And finally assign services to a particular IP. This would create a situation where traffic prefers one NIC or the other, but is an administrative nightmare and likely to cause many more problems than you perceive it to solve.
This tutorial on load-balancing links shows how to mark packets and dynamically choose a route. Instead of marking every nth packet, mark the packets based on port instead.
It's also my instinct that you don't need to use the conditional tagging, but rather just enter redundant routes in each table and set the route priority correctly. Example:
Default:
DRBD tagged: