BRCTL(8)
๐ NAME ๐
okay bestie, you're reading the BRCTL(8) manual page โ ethernet bridge administration. The command itself is brctl, and it's lowkey iconic for bridge vibes. ๐ซถ
โจ SYNOPSIS โจ
brctl [command]
๐ฆ DESCRIPTION ๐ฆ
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. no cap, that's the whole point. ๐
Each of the ethernets being connected corresponds to one physical interface in the bridge. These individual ethernets are bundled into one bigger ('logical') ethernet, and this bigger ethernet corresponds to the bridge network interface. it's giving main character energy but make it networking. ๐
๐ง INSTANCES ๐ง
brctl addbr <name>โ creates a new instance of the ethernet bridge. The network interface corresponding to the bridge will be called<name>. โจbrctl delbr <name>โ deletes the instance<name>of the ethernet bridge. The network interface corresponding to the bridge must be down before it can be deleted! ๐ญ
bestie, that "must be down" part is not a suggestion. the interface has to be down before deletion, periodt. ๐
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 traceroute(8)). ๐ฆ
brctl addif <brname> <ifname>โ makes the interface<ifname>a port of the bridge<brname>. This means that all frames received on<ifname>will be processed as if destined for the bridge. Also, when sending frames on<brname>,<ifname>will be considered as a potential output interface. ๐brctl delif <brname> <ifname>โ detaches the interface<ifname>from the bridge<brname>. ๐brctl show <brname>โ shows 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. slay, efficient. โญ
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. so yeah, the bridge has to keep up. ๐
brctl showmacs <brname>โ shows a list of learned MAC addresses for this bridge. ๐brctl setageing <brname> <time>โ sets the ethernet (MAC) address ageing time, in seconds. After<time>seconds of not having seen a frame coming from a certain address, the bridge will time out (delete) that address from the Forwarding DataBase (fdb). ๐ฐ๏ธbrctl setgcint <brname> <time>โ sets the garbage collection interval for the bridge<brname>to<time>seconds. This means that the bridge will check the forwarding database for timed out entries every<time>seconds. ๐งน
๐ SPANNING TREE PROTOCOL ๐
Multiple ethernet bridges can work together to create even larger networks of ethernets using the IEEE 802.1d spanning tree protocol. This protocol is used for finding the shortest path between two ethernets, and for eliminating loops from the topology. As this protocol is a standard, Linux bridges will interwork properly with other third party bridge products. Bridges communicate with each other by sending and receiving BPDUs (Bridge Protocol Data Units). These BPDUs can be recognized by an ethernet destination address of 01:80:c2:00:00:00. ๐ฅ
The spanning tree protocol can also be turned off (for those situations where it just doesn't make sense, for example when this Linux box is the only bridge on the LAN, or when you know that there are no loops in the topology.) ๐
brctl(8) can be used for configuring certain spanning tree protocol parameters. For an explanation of these parameters, see the IEEE 802.1d specification (or send me an email). The default values should be just fine. If you don't know what these parameters mean, you probably won't feel the desire to tweak them. ngl, that's real. ๐
brctl stp <bridge> <state>โ controls this bridge instance's participation in the spanning tree protocol. If<state>is"on"or"yes"the STP will be turned on, otherwise it will be turned off. When turned off, the bridge will not send or receive BPDUs, and will thus not participate in the spanning tree protocol. If your bridge isn't the only bridge on the LAN, or if there are loops in the LAN's topology, DO NOT turn this option off. If you turn this option off, please know what you are doing. fr fr, this is the dramatic warning. ๐brctl setbridgeprio <bridge> <priority>โ sets the bridge's priority to<priority>. The priority value is an unsigned 16-bit quantity (a number between 0 and 65535), and has no dimension. Lower priority values are 'better'. The bridge with the lowest priority will be elected 'root bridge'. ๐brctl setfd <bridge> <time>โ sets the bridge's 'bridge forward delay' to<time>seconds. โณbrctl sethello <bridge> <time>โ sets the bridge's 'bridge hello time' to<time>seconds. ๐brctl setmaxage <bridge> <time>โ sets the bridge's 'maximum message age' to<time>seconds. ๐ฐ๏ธbrctl setpathcost <bridge> <port> <cost>โ sets the port cost of the port<port>to<cost>. This is a dimensionless metric. ๐ซbrctl setportprio <bridge> <port> <priority>โ sets the port<port>'s priority to<priority>. The priority value is an unsigned 8-bit quantity (a number between 0 and 255), and has no dimension. This metric is used in the designated port and root port selection algorithms. ๐
๐ NOTES ๐
brctl(8)is obsolete. Some features such as STP guard, hairpin mode, fast leave and root block are intentionally not implemented in this command. Instead usebridgecommand fromiproute2package for a more full set of features. bestie, this is the "use the newer tool" memo. ๐ญ
๐ SEE ALSO ๐
iptables(8)โ the see-also bestie in this page. โจ
๐ AUTHOR ๐
- Lennert Buytenhek
<buytenh@gnu.org>๐ซถ - Stephen Hemminger
<stephen@networkplumber.org>๐ซถ
mwah ๐ โ this BRCTL(8) manual page is dated November 7, 2001, and that's the footer vibe, periodt. ๐
๐ฆ where this page comes from
- alpine 3.22: bridge-utils-doc 1.7.1-r2 ยท GPL-2.0-or-later
- alpine 3.23: bridge-utils-doc 1.7.1-r2 ยท GPL-2.0-or-later
- alpine 3.24: bridge-utils-doc 1.7.1-r2 ยท GPL-2.0-or-later
- epel 10: bridge-utils 1.7.1-11.el10_0 ยท GPL-2.0-or-later
- epel 9: bridge-utils 1.7.1-3.el9 ยท GPLv2+
- fedora 43: bridge-utils 1.7.1-13.fc43 ยท GPL-2.0-or-later
- fedora 44: bridge-utils 1.7.1-15.fc44 ยท GPL-2.0-or-later
- nixpkgs unstable: bridge-utils 1.7.1
- opensuse-leap 16.0: bridge-utils 1.7.1-bp160.1.12 ยท GPL-2.0-or-later
- opensuse-leap 16.0: bridge-utils 1.7.1-bp160.1.12 ยท GPL-2.0-or-later
- opensuse-leap 16.0: bridge-utils 1.7.1-bp160.1.12 ยท GPL-2.0-or-later
- opensuse-leap 16.0: bridge-utils 1.7.1-bp160.1.12 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms