1

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...

Jeff Ferland
  • 20,239
  • 2
  • 61
  • 85
kankamuso
  • 485
  • 6
  • 14

2 Answers2

1

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.

Chris S
  • 77,337
  • 11
  • 120
  • 212
  • Thanks a lot for your response. I had a look at bonding and did not find a mode that would fit my needs, or did I?. Perhaps I am not able tu fully understand which one of the modes fits them... may be xor?. Also, I did not mention I only have two NICS and no possibility to add another one... so I cannot have a backup, idle slave. – kankamuso Jan 19 '12 at 14:13
  • What specifically did you think it did not fit? – Chris S Jan 19 '12 at 14:13
  • The fact that I did not find the way to adapt it dynamically depending on the traffic nature. I mean, I don't want to use the "data" connection to send "management" traffic unless strictly necessary. I have been reading about bonding and all goes in the MAC-MAC direction, no traffic-level... – kankamuso Jan 19 '12 at 14:18
  • Why do you think you don't want data and management co-mingling? I can see why you would want to logically separate them with a vLAN or similar, but they're both hitting the same switched Ethernet fabric anyway. – Chris S Jan 19 '12 at 14:27
  • Because I have two wireless links and one of them is now carrying VoIP traffic so I must reroute DRBD (high load) traffic using the other one. But I can still accomodate management (low traffic, some PINGS, etc..) using the VoIP connection. – kankamuso Jan 19 '12 at 14:31
  • To be clear, you're running a cluster over two "wireless links" and looking for some sort of redundancy? Would this happen to be WiFi? – Chris S Jan 19 '12 at 14:36
  • Yes I am. As I have a fencing mechanism, I don't want to fence a node if the problem is just in the link supporting the "PING" for the heartbeat. Therefore, I want to be able to re-route the PING traffic (and other clustering-associated protocols) in case of link failure. – kankamuso Jan 19 '12 at 14:38
  • DRBD and heartbeat over wifi is probably not a good idea...unless that is an extremely lightly used server with little to no critical status in the business. – Bart Silverstrim Jan 19 '12 at 14:46
  • I know, I know, but there was no other alternative (although we have a 600 mbit connection and in our tests 100 Mbits proved to be ok). Let's see. Thanks!. – kankamuso Jan 19 '12 at 14:55
1

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:

default via 10.0.0.1 dev eth0 metric 100
default via 10.0.0.1 dev eth1 metric 110

DRBD tagged:

default via 10.0.0.1 dev eth0 metric 110
default via 10.0.0.1 dev eth1 metric 100
Jeff Ferland
  • 20,239
  • 2
  • 61
  • 85