7

When installing KVM on Fedora or CentOS it creates virbr0, but I can't see anywhere that en0 is part of the bridge.

Question

Is there are a command to see the members of a network bridge?

Sandra
  • 10,303
  • 38
  • 112
  • 165

3 Answers3

21

Alternatively, there's a more recent command provided by iproute2, used together with ip link to manage bridges: the bridge command. It can handle new bridge features not available through brctl (like VLAN filtering (to enable vlan handling directly by the bridge), port isolation (similar to PVLAN) or hairpin).

Modern syntax to display bridges would be:

ip link show type bridge

or looking for/by bridge ports:

bridge link show

or

bridge link show dev <interface>

To show only the ports of a given bridge requires again the ip link command:

ip link show master <bridgename>

The results might be a bit less pretty, but can provide more informations. Newer versions of iproute2 provide the bridge command with a JSON output (same for ip link show: try for example ip -details -pretty -json link show type bridge).

A.B
  • 11,090
  • 2
  • 24
  • 45
5

The command which handles bridging in Linux is brctl.

The command you are most likely looking for is

   brctl show

The bridge name is, of-course on the left, and all the interfaces connected to that bridge will be listed - one per line - on the right in the "interfaces" column.

You may also specify a specific bridge with a command like

  brctl show virbr0
davidgo
  • 6,222
  • 3
  • 23
  • 41
3

The best way I feel is to list the contents in this directory :

/sys/class/net/<bridge-name>/brif

This helps you parse the output. brctl show and other commands will be difficult to parse