bridge man page

bridge — show / manipulate bridge addresses and devices

Synopsis

bridge [ Options ] Object { Command | help }
Object := { link | fdb | mdb | vlan | monitor }
Options := { -V[ersion] | -s[tatistics] | -n[etns] name | -b[atch] filename | -j[son] }
bridge link set dev DEV [ cost COST ] [ priority PRIO ] [ state STATE] [ guard { on | off } ] [ hairpin { on | off } ] [ fastleave { on | off } ] [ root_block { on | off } ] [ learning { on | off } ] [ learning_sync { on | off } ] [ flood { on | off } ] [ hwmode { vepa | veb } ] [ self ] [ master ]
bridge link [ show ] [ dev DEV ]
bridge fdb { add | append | del | replace } LLADDR dev DEV { local | static | dynamic } [ self ] [ master ] [ router ] [ use ] [ dst IPADDR ] [ vni VNI ] [ port PORT ] [ via DEVICE ]
bridge fdb [ show ] [ dev DEV ]
bridge mdb { add | del } dev DEV port PORT grp GROUP [ permanent | temp ] [ vid VID ]
bridge mdb show [ dev DEV ]
bridge vlan { add | del } dev DEV vid VID [ pvid ] [ untagged ] [ self ] [ master ]
bridge vlan [ show ] [ dev DEV ]
bridge monitor [ all | neigh | link | mdb ]

Options

-V, -Version
print the version of the bridge utility and exit.
-s, -stats, -statistics
output more information. If this option is given multiple times, the amount of information increases. As a rule, the information is statistics or some time values.
-d, -details
print detailed information about MDB router ports.
-n, -net, -netns <NETNS>

switches bridge to the specified network namespace NETNS. Actually it just simplifies executing of:

ip netns exec NETNS bridge [ Options ] Object { Command | help }

to

bridge -n[etns] NETNS [ Options ] Object { Command | help }

-b, -batch <FILENAME>
Read commands from provided file or standard input and invoke them. First failure will cause termination of bridge command.
-force
Don't terminate bridge command on errors in batch mode. If there were any errors during execution of the commands, the application return code will be non zero.
-json
Display results in JSON format. Currently available for vlan and fdb.

Bridge - Command Syntax

Object

link
- Bridge port.
fdb
- Forwarding Database entry.
mdb
- Multicast group database entry.
vlan
- VLAN filter list.

Command

Specifies the action to perform on the object. The set of possible actions depends on the object type. As a rule, it is possible to add, delete and show (or list ) objects, but some objects do not allow all of these operations or have some additional commands. The help command is available for all objects. It prints out a list of available commands and argument syntax conventions.

If no command is given, some default command is assumed. Usually it is list or, if the objects of this class cannot be listed, help.

bridge fdb - forwarding database management

fdb objects contain known Ethernet addresses on a link.

The corresponding commands display fdb entries, add new entries, append entries, and delete old ones.

bridge fdb add - add a new fdb entry

This command creates a new fdb entry.

LLADDR
the Ethernet MAC address.
dev DEV

the interface to which this address is associated.

local - is a local permanent fdb entry

static - is a static (no arp) fdb entry

dynamic - is a dynamic reachable age-able fdb entry

self - the address is associated with the port drivers fdb. Usually hardware.

master - the address is associated with master devices fdb. Usually software (default).

router - the destination address is associated with a router. Valid if the referenced device is a VXLAN type device and has route shortcircuit enabled.

use - the address is in use. User space can use this option to indicate to the kernel that the fdb entry is in use.

The next command line parameters apply only when the specified device DEV is of type VXLAN.

dst IPADDR
the IP address of the destination VXLAN tunnel endpoint where the Ethernet MAC ADDRESS resides.
vni VNI
the VXLAN VNI Network Identifier (or VXLAN Segment ID) to use to connect to the remote VXLAN tunnel endpoint. If omitted the value specified at vxlan device creation will be used.
port PORT
the UDP destination PORT number to use to connect to the remote VXLAN tunnel endpoint. If omitted the default value is used.
via DEVICE
device name of the outgoing interface for the VXLAN device driver to reach the remote VXLAN tunnel endpoint.

bridge fdb append - append a forwarding database entry

This command adds a new fdb entry with an already known LLADDR. Valid only for multicast link layer addresses. The command adds support for broadcast and multicast Ethernet MAC addresses. The Ethernet MAC address is added multiple times into the forwarding database and the vxlan device driver sends a copy of the data packet to each entry found.

The arguments are the same as with bridge fdb add.

bridge fdb delete - delete a forwarding database entry

This command removes an existing fdb entry.

The arguments are the same as with bridge fdb add.

bridge fdb replace - replace a forwarding database entry

If no matching entry is found, a new one will be created instead.

The arguments are the same as with bridge fdb add.

bridge fdb show - list forwarding entries.

This command displays the current forwarding table.

With the -statistics option, the command becomes verbose. It prints out the last updated and last used time for each entry.

bridge mdb - multicast group database management

mdb objects contain known IP multicast group addresses on a link.

The corresponding commands display mdb entries, add new entries, and delete old ones.

bridge mdb add - add a new multicast group database entry

This command creates a new mdb entry.

dev DEV
the interface where this group address is associated.
port PORT
the port whose link is known to have members of this multicast group.
grp GROUP

the IP multicast group address whose members reside on the link connected to the port.

permanent - the mdb entry is permanent

temp - the mdb entry is temporary (default)

vid VID
the VLAN ID which is known to have members of this multicast group.

bridge mdb delete - delete a multicast group database entry

This command removes an existing mdb entry.

The arguments are the same as with bridge mdb add.

bridge mdb show - list multicast group database entries

This command displays the current multicast group membership table. The table is populated by IGMP and MLD snooping in the bridge driver automatically. It can be altered by bridge mdb add and bridge mdb del commands manually too.

dev DEV
the interface only whose entries should be listed. Default is to list all bridge interfaces.

With the -details option, the command becomes verbose. It prints out the ports known to have a connected router.

With the -statistics option, the command displays timer values for mdb and router port entries.

bridge vlan - VLAN filter list

vlan objects contain known VLAN IDs for a link.

The corresponding commands display vlan filter entries, add new entries, and delete old ones.

bridge vlan add - add a new vlan filter entry

This command creates a new vlan filter entry.

dev NAME
the interface with which this vlan is associated.
vid VID
the VLAN ID that identifies the vlan.
pvid
the vlan specified is to be considered a PVID at ingress. Any untagged frames will be assigned to this VLAN.
untagged
the vlan specified is to be treated as untagged on egress.
self
the vlan is configured on the specified physical device. Required if the device is the bridge device.
master
the vlan is configured on the software bridge (default).

bridge vlan delete - delete a vlan filter entry

This command removes an existing vlan filter entry.

The arguments are the same as with bridge vlan add. The pvid and untagged flags are ignored.

bridge vlan show - list vlan configuration.

This command displays the current VLAN filter table.

bridge monitor - state monitoring

The bridge utility can monitor the state of devices and addresses continuously. This option has a slightly different format. Namely, the monitor command is the first in the command line and then the object list follows:

bridge monitor [ all | OBJECT-LIST ]

OBJECT-LIST is the list of object types that we want to monitor. It may contain link, fdb, and mdb. If no file argument is given, bridge opens RTNETLINK, listens on it and dumps state changes in the format described in previous sections.

If a file name is given, it does not listen on RTNETLINK, but opens the file containing RTNETLINK messages saved in binary format and dumps them.

Notes

This command uses facilities added in Linux 3.0.

Although the forwarding table is maintained on a per-bridge device basis the bridge device is not part of the syntax. This is a limitation of the underlying netlink neighbour message protocol. When displaying the forwarding table, entries for all bridges are displayed. Add/delete/modify commands determine the underlying bridge device based on the bridge to which the corresponding ethernet device is attached.

See Also

ip(8)

Bugs

Please direct bugreports and patches to: <netdev@vger.kernel.org>

Author

Original Manpage by Stephen Hemminger

Info

1 August 2012 iproute2 Linux