3

I make heavy use of Linux Bridges (brctl) as I have a Xen environment. At the minute, only one physical NIC is connected to the bridge (There are many virtual NICs for the Xen VMs though). In order to get some redundancy working, what steps would I need to take to add another physical NIC to the bridge? This second NIC will be connected to a different switch. Do I need to run a cable between the 2 switches and enable STP?

Please note that the NIC do not have IP assigned to them (however the bridges do).

I do know the commands to add NICs to bridges; my question related to the redundancy aspect of it.

Caleb
  • 11,583
  • 4
  • 35
  • 49
jtnire
  • 777
  • 2
  • 7
  • 15

2 Answers2

2

I think the answer is that you would need to create a bonded interface using a failover configuration where whatever NIC work get's the connection. Then you can make your bridges on top of the bond interfaces instead of directly on the nics.

Caleb
  • 11,583
  • 4
  • 35
  • 49
  • And no cable needed between switched? And no STP? – jtnire Apr 25 '11 at 20:58
  • No, I don't think [STP](http://en.wikipedia.org/wiki/Spanning_Tree_Protocol) is needed on the switch if you just setup a fail-over bond handled on the linux end. Only one physical interface will be brought up at a time. I can't make out what your first question is asking. – Caleb Apr 25 '11 at 21:23
  • Sorry i typoed the first question. I'm asking weather I need to run a cable between the 2 switches. I think I do though, as in case some servers have flipped over to the second NIC while some are on the first (Due to NIC failure, rather than switch failure). Thanks – jtnire Apr 25 '11 at 21:28
  • If you are going to use a bonded interface make sure you read the [bonding documentation](http://www.kernel.org/doc/Documentation/networking/bonding.txt) and choose the correct mode. I believe `mode=1` is the only mode that provides HA without configuration on the switches. – Zoredache Apr 25 '11 at 21:32
2

Add both interfaces to the bridge, and make sure that spanning tree is not disabled on your switches. Spanning tree should be enabled on Linux by default, but make sure that is not disabled brctl showstp <bridge>.

Zoredache
  • 128,755
  • 40
  • 271
  • 413
  • Since my switches don't actually support STP (I just found that out), would Caleb's solution work without needing STP? – jtnire Apr 25 '11 at 21:34
  • Yes, assuming you configure the bonding properly. See my comment with a link to the docs which cover various different configurations. – Zoredache Apr 25 '11 at 21:38
  • Thanks. Yes, I think the trick is to make sure that each server only ever appears on one switch port on the network – jtnire Apr 25 '11 at 21:49