LAN Switching - Linux


  • bridge or LAN switch is a device that interconnects two or more local area networks (LANs) and forwards packets between these networks. Different from IP routers, bridges and LAN switches operate at the data link layer. For example, bridges and LAN switches forward packets based on MAC addresses, whereas IP routers forward packets based on IP addresses.
  • LAN switches are widely deployed in enterprise networks, including university campus networks. Many enterprise networks primarily use LAN switches to interconnect LANs, using IP routers only to connect the enterprise network to the public Internet.
Detailed Description
  • Ethernet bridging functionality is integrated in all recent versions of Linux. The configuration of bridging functions in Linux is done with configuration commands and tools. The following explains how to use the bridge configuration tool, brctl.
Command Syntax
Bridge Configuration:  
brctl addbr <BridgeID> -Create a bridge with the indicated BridgeID
brctl addif <BridgeID> <IFID> -Add network interface IFID to bridge BridgeID
brctl stp <BridgeID> off -Disables the spanning tree protocol on bridge BridgeID
brctl setageing <BridgeID> <secs>

-Sets the ageing parameter of bridge BridgeID to secs

ifconfig <BridgeID> up/down

-Activate/deactivates bridge BridgeID

Status Commands:

brctl show -Displays information about configured bridges
brctl showmacs -Displays the the MAC forwarding table for configured bridges