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?
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?
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
).
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
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