brctl

Legacy utility for managing Linux Ethernet bridges (bridge-utils package). Superseded by the bridge command in iproute2.

Category: Networking L2 Bridging bridge-utils Legacy Deprecated

What it does

brctl creates and manages Linux Ethernet bridges. It allows you to create bridge devices, add/remove interfaces, and inspect basic bridge settings.

How it works (mechanical)

A Linux bridge acts as a Layer‑2 switch implemented in the kernel. brctl configures bridge devices and attaches interfaces (ports) to them. The kernel then handles MAC learning and frame forwarding.

  • Create/delete bridge interfaces
  • Add/remove member interfaces
  • Enable/disable Spanning Tree Protocol (STP)
  • Display bridge membership

10 Practical Examples

# 1) Show existing bridges
brctl show
# 2) Create a new bridge device
sudo brctl addbr br0
# 3) Add interface to bridge
sudo brctl addif br0 eth1
# 4) Bring bridge interface up
sudo ip link set br0 up
# 5) Remove interface from bridge
sudo brctl delif br0 eth1
# 6) Delete bridge
sudo brctl delbr br0
# 7) Enable Spanning Tree Protocol
sudo brctl stp br0 on
# 8) Disable Spanning Tree Protocol
sudo brctl stp br0 off
# 9) Show detailed bridge info (including STP state)
brctl showstp br0
# 10) Typical virtualization workflow (example)
sudo brctl addbr br0
sudo brctl addif br0 eth0
sudo ip addr flush dev eth0
sudo ip link set br0 up

Notes & Gotchas

  • Deprecated: brctl is replaced by bridge (iproute2).
  • No VLAN awareness: advanced VLAN features require bridge.
  • IP address location: assign IP to the bridge, not the member interface.
  • Loop risk: without STP, loops can bring down a LAN.
  • Persistence: configuration must be scripted or managed by NetworkManager/systemd.

Historical Context

brctl was part of the bridge-utils package widely used in early Linux virtualization and server setups. As networking evolved, iproute2 introduced the more powerful bridge command, consolidating networking management under one framework.

Modern Equivalent / Related Tools

  • bridge — modern bridge management (recommended)
  • ip link — create/delete bridge devices
  • nft — filtering at L2/L3/L4
  • tcpdump — observe bridge traffic
  • tc — shaping on bridge ports