brctl is used to set up, maintain, and inspect the ethernet bridge configuration in the linux kernel.
An ethernet bridge is a device commonly used to connect different networks 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 ethernet 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 coming 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 network (i.e. it will not show up in (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 its 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 destination 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.
brctl setageingtime sets the ethernet (MAC) address ageing time, in seconds. After