How do I put a bridge on top of a bonded interface?

10,832

This is how I configured a Ubuntu 10.04 LTS system for bridging on top of bonded interfaces:

iface eth0 inet manual
iface eth5 inet manual

# eth0 & eth5 form bond0 for the x.y.z.0/25 subnet
auto bond0
iface bond0 inet static
        bond_miimon 100
        bond_mode active-backup
        bond_downdelay 200
        bond_updelay 200
    address x.y.z.35
    netmask 255.255.255.128
    network x.y.z.0
    post-up ifenslave bond0 eth0 eth5
    pre-down ifenslave -d bond0 eth0 eth5

auto br0
iface br0 inet static
    bridge_ports bond0
    address x.y.z.35
    netmask 255.255.255.128
    network x.y.z.0
    gateway x.y.z.126
Share:
10,832

Related videos on Youtube

Taymon
Author by

Taymon

I'm a university student and developer interested in programming languages, educational technology, Web accessibility, and computational logic.

Updated on September 18, 2022

Comments

  • Taymon
    Taymon almost 2 years

    I'm setting up a Ubuntu Server 11.10 box with multiple Ethernet interfaces that are bonded for redundancy. I'm planning to use it as a KVM host, so I'll need a network bridge.

    To accomplish this, I installed ifenslave and bridge-utils, then wrote my /etc/network/interfaces file. The relevant portion is as follows:

    auto br0
    iface br0 inet static
        address 10.1.254.101
        netmask 255.255.255.0
        network 10.1.254.0
        broadcast 10.1.254.255
        gateway 10.1.254.50
        dns-nameservers 10.1.254.252
        bridge_ports bond0
        bridge_stp off
    
    iface bond0 inet manual
        bond-slaves eth0 eth3
        bond_mode balance-rr
        bond_miimon 100
    

    Unfortunately, this isn't giving me connectivity. ifup br0 gives me "can't add bond0 to bridge br0: Invalid argument", and ifdown br0 gives me "device bond0 is not a slave of br0". If I modify my interfaces file to get rid of the bridge, I have full connectivity—but I'm going to need the bridge.

    I think something in my interfaces file is wrong, but I don't know how to make it right. Does anyone know? Thanks!

    • hookenz
      hookenz over 12 years
      Did you actually find a satisfactory answer or get this working? If so please provide your solution. I'm wanting to do exactly the same thing but with DHCP
    • Taymon
      Taymon over 12 years
      Sorry, the project ended up being abandoned for awhile. I'll look back into it.
    • Diablo-D3
      Diablo-D3 about 9 years
      The answer you're looking for, several years late, is you're missing an auto statement. Your file should look like auto bond0, the bond0 definition, auto br0, then the br0 definition.
    • eos
      eos over 8 years
      @diablo-D3, auto doesnt help. I have the same problem.
    • Diablo-D3
      Diablo-D3 about 8 years
      @eos In the example op gave, there are also no matching lines to bring the bridge members up. This is also a common configuration error. Listing bond-slaves doesn't up them.
    • RDP
      RDP almost 8 years
      @eos did you install bridge-utils?