Bridge

References

http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge#Does_bridging_work_on_2.2.3F

Basics

Bridge works on Ethernet layer (level 2) so is protocol independent

Linux bridge can also do firewall (as is software based) with ebtables.

Function in kernels from 2.4 above and administration utilities are in 'bridge-utils' package.

Run 'brctl', if shows a list of commands, then the kernel and utilities are ready.

Configuration

Manual configuration:

  1. make NICs work but not configured (not manual assigned IP nor from DHCP, ifconfig shows cards DOWN)
  2. A bridge is a group of devices (interfaces)
  3. Create bridge by 'brctl addbr bridge-name' (brctl delbr remove it)
  4. Add interface into the bridge by ' brctl addif bridgename device'
  5. Show bridge by 'brctl show'
  6. show address forwarding by 'brctl showmacs'
  7. STP (spanning tree protocol) - if multiple bridges are used, enable STP to handle multiple hops and avoid cycle routing by 'brctl stp bridge-name on'