Taylorbyte.com

Documentation Wiki

bridge-interface

Command line method works on most distros

Bring down network

dhclient -r eth0

Create bridge interface and add ethernet interfaces to it

brctl addbr br0
brctl addif br0 eth0
brctl addif br0 eth1

Bring up ethernet interfaces

ifconfig eth0 up
ifconfig eth1 up

Bring up bridge.

dhclient -v br0

Optionally you can statically assign the MAC address of the bridge before bringing up the interface because it will change each time it comes up

ifconfig br0 hwaddr [mac]

Debian method (interfaces file)

/etc/network/interfaces

auto br0
iface br0 inet static
  address 192.168.0.1
  netmask 255.255.255.0
  network 192.168.0.0
  broadcast 192.168.0.255
  pre-up ifconfig eth0 down
  pre-up ifconfig wlan0 down
  pre-up brctl addbr br0
  pre-up brctl addif br0 eth0
  pre-up brctl addif br0 wlan0
  pre-up ifconfig eth0 0.0.0.0
  pre-up ifconfig wlan0 0.0.0.0
  pre-up ifconfig eth0 up
  pre-up ifconfig wlan0 up
  post-down ifconfig eth0 down
  post-down ifconfig wlan0 down
  post-down brctl delbr br0