Linux Display Ethernet Bridge Name and Information

How do I display a list of bridges under Linux? How do I show info about the Ethernet bridge configuration in the Linux kernel?

Bridging used in packet-switched networks and only used in local area networks. It connects multiple network segments at the Layer 2 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 biggerethernet, this bigger ethernet corresponds to the bridge network interface.

brctl command

You need to use the brctl command, which is used to set up, maintain, and display the Ethernet bridge configuration in the Linux systems. Open a command-line terminal (select Applications > Accessories > Terminal), or login to remote system using the ssh client, and then type the following commands.

Linux Show All Instances of The Ethernet Bridge

Type the following command as the root user, enter:
# brctl show
Sample outputs:

bridge name	bridge id		STP enabled	interfaces
br0		8000.0030488e31ac	no		eth0
br1		8000.0030488e31ad	no		eth1

Display Mac Address

To display a list of learned MAC addresses for br0 bridge, enter:
# brctl showmacs br0
Sample outputs:

port no	mac addr		is local?	ageing timer
  1	00:1a:30:38:a8:00	no		   0.00
  1	00:1b:53:bb:a7:a1	no		   5.06
  1	00:30:48:32:d7:aa	no		   0.27
  1	00:30:48:33:bc:32	no		   0.03
  1	00:30:48:8c:57:d2	no		   0.65
  1	00:30:48:8e:31:ac	yes		   0.00
  1	02:30:48:8e:31:ac	no		  12.86

Show br0 IP Address Information

To see ip address assinged to br0, enter:
# ifconfig br0
# ip addr show br0
Sample outputs:

br0       Link encap:Ethernet  HWaddr 00:30:48:8E:31:AC  
          inet addr:  Bcast:  Mask:
          RX packets:382175211 errors:0 dropped:0 overruns:0 frame:0
          TX packets:290454591 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:275381068495 (256.4 GiB)  TX bytes:224019772370 (208.6 GiB)

How Do I See and Change Ethernet Bridge Network Configuration File?

Under RHEL / Fedora / CentOS / Redhat Linux Ethernet bridge network configuration for br0 stored as follows:

  1. /etc/sysconfig/network-scripts/ifcfg-eth0 – Specify bridge name
  2. /etc/sysconfig/network-scripts/ifcfg-br0 – br0 config file.
  3. /etc/sysconfig/network-scripts/route-br0 – Static routing (optional).

Debian or Ubuntu Linux user should use /etc/network/interfaces configuration file. A typical example is as follows:
# cat /etc/network/interfaces
Sample outputs:

# The loopback network interface
auto lo br0
iface lo inet loopback
# Set up interfaces manually
iface eth0 inet manual
iface eth1 inet manual
# Bridge setup
iface br0 inet static
       bridge_ports eth0 eth1

See how to configure and use bridges under Linux here.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 0 comments... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum