bridge on bond

Setup a bridge on a bond

Debian 5 or later: /etc/network/interfaces

# The bridge interface.
# The lines with pre-up and post-down are to bring up the
# bond before the bridge. The '--allow "$IFACE"' parameter to
# ifup/ifdown and the corresponding "allow-br0 bond0" line aren't
# really needed, but I like them.

auto br0
iface br0 inet static
    bridge_ports bond0
    bridge_maxwait 0
    pre-up ifup --allow "$IFACE" bond0 
    post-down ifdown --allow "$IFACE" bond0

# The bond interface
# notice it's set as manual to allow the scripts in ifenslave-2.6
# package to create the master interface and enslave the slaves.

allow-br0 bond0
iface bond0 inet manual
    bond_slaves eth0 eth1
    bond_miimon 100
    bond_mode 802.3ad
    bond_lacp_rate fast

# Alternative modes: 
    #  balance-rr or 0
    #  active-backup or 1
    #  balance-xor or 2
    #  broadcast or 3
    #  802.3ad or 4
    #  balance-tlb or 5
    #  balance-alb or 6

# Physical interfaces.
# Notice they are set as manual to permit you to add up/down commands
# and special directives such as wifi configurations.
# Lines beginning with allow-bond0 are required if you want to do
# something with these interfaces, otherwise you can remove both of
# them as they are brought up when they are enslaved to their master.

allow-bond0 eth0
iface eth0 inet manual

allow-bond0 eth1
iface eth1 inet manual

thx to Marco Nenciarini

bridge as gateway

Using a Bridge as a Gateway

If you want to use bridge as a gateway for other hosts you don't need to use the usual iptables nat, but you have to disable the iptableusage of the bridge altogether:

net.ipv4.ip_forward = 1

net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0

all pages tagged bridge

bridge on bond
bridge as gateway