brctl is used to set up, maintain, and inspect the ethernet bridge con- figuration in the linux kernel.
An ethernet bridge is a device commonly used to connect different net- works of ethernets together, so that these ethernets will appear as one ethernet to the participants.
Each of the ethernets being connected corresponds to one physical interface in the bridge. These individual ethernets are bundled into one bigger (’logical’) ethernet, this bigger ethernet corresponds to the bridge network interface.
INSTANCES
The command brctl addbr creates a new instance of the ethernet bridge. The network interface corresponding to the bridge will be called .
The command brctl delbr deletes the instance of the eth- ernet bridge. The network interface corresponding to the bridge must be down before it can be deleted!
The command brctl show shows all current instances of the ethernet bridge.
PORTS
Each bridge has a number of ports attached to it. Network traffic com- ing in on any of these ports will be forwarded to the other ports transparently, so that the bridge is invisible to the rest of the net- work (i.e. it will not show up in traceroute(8) ).
The command brctl addif will make the interface a port of the bridge . This means that all frames received on will be processed as if destined for the bridge. Also, when sending frames on , will be considered as a potential output interface.
The command brctl delif will detach the interface from the bridge .
The command brctl show will show some information on the bridge and it’s attached ports.
AGEING
The bridge keeps track of ethernet addresses seen on each port. When it needs to forward a frame, and it happens to know on which port the des- tination ethernet address (specified in the frame) is located, it can ’cheat’ by forwarding the frame to that port only, thus saving a lot of redundant copies and transmits.
However, the ethernet address location data is not static data. Machines can move to other ports, network cards can be replaced (which changes the machine’s ethernet address), etc.
brctl showmacs shows a list of learned MAC addresses for this bridge.