BRIDGE(8)
๐ BRIDGE(8) โ the bridge utility, explained by your fav Unix bestie ๐
Linux ยท bridge ยท section 8 ยท she runs the whole bridge, no cap
โจ NAME โจ
bridge โ show / manipulate bridge addresses and devices
Like, it's the tool that lets you peek at and poke around your bridge's addresses and devices. That's the whole vibe. ๐ซถ
๐ธ SYNOPSIS ๐ธ
Bestie, here's the shape of it. It's giving "lots of options, but we'll get through it together." ๐
bridge [ OPTIONS ] OBJECT { COMMAND | help }
OBJECT := { link | fdb | mdb | vlan | vni | monitor }
OPTIONS := { -V[ersion] | -s[tatistics] | -n[etns] name | -b[atch]
filename | -com[pressvlans] | -c[olor] | -p[retty] | -j[son] |
-o[neline] }
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 } ] [ bcast_flood { on | off } ] [ mcast_flood { on |
off } ] [ mcast_max_groups MAX_GROUPS ] [ mcast_router
MULTICAST_ROUTER ] [ mcast_to_unicast { on | off } ] [
neigh_suppress { on | off } ] [ neigh_vlan_suppress { on | off }
] [ neigh_forward_grat { on | off } ] [ vlan_tunnel { on | off }
] [ isolated { on | off } ] [ locked { on | off } ] [ mab { on |
off } ] [ backup_port DEVICE ] [ nobackup_port ] [ backup_nhid
NHID ] [ self ] [ master ]
bridge link [ show ] [ dev DEV ] [ master DEVICE ]
bridge fdb { add | append | del | replace } LLADDR dev DEV { local |
static | dynamic } [ self ] [ master ] [ router ] [ use ] [
extern_learn ] [ sticky ] [ src_vni VNI ] { [ dst IPADDR ] [ vni
VNI ] [ port PORT ] [ via DEVICE ] | nhid NHID } [
activity_notify ] [ inactive ] [ norefresh ]
bridge fdb [ [ show ] [ br BRDEV ] [ brport DEV ] [ vlan VID ] [ state
STATE ] [ dynamic ] ]
bridge fdb get [ to ] LLADDR [ br BRDEV ] { brport | dev } DEV [ vlan
VID ] [ vni VNI ] [ self ] [ master ] [ dynamic ]
bridge fdb flush dev DEV [ brport DEV ] [ vlan VID ] [ src_vni VNI ] [
nhid NHID ] [ vni VNI ] [ port PORT ] [ dst IPADDR ] [ self ] [
master ] [ [no]permanent | [no]static | [no]dynamic ] [
[no]added_by_user ] [ [no]extern_learn ] [ [no]sticky ] [
[no]offloaded ] [ [no]router ]
bridge mdb { add | del | replace } dev DEV port PORT grp GROUP [ src
SOURCE ] [ permanent | temp ] [ vid VID ] [ filter_mode {
include | exclude } ] [ source_list SOURCE_LIST ] [ proto PROTO
] [ dst IPADDR ] [ dst_port DST_PORT ] [ vni VNI ] [ src_vni
SRC_VNI ] [ via DEV ]
bridge mdb show [ dev DEV ]
bridge mdb get dev DEV grp GROUP [ src SOURCE ] [ vid VID ] [ src_vni
SRC_VNI ]
bridge mdb flush dev DEV [ port PORT ] [ vid VID ] [ src_vni SRC_VNI ] [
proto PROTO ] [ [no]permanent ] [ dst IPADDR ] [ dst_port
DST_PORT ] [ vni VNI ]
bridge mst set dev DEV msti MSTI state STP_STATE
bridge mst [ [ show ] [ dev DEV ] ]
bridge vlan { add | del } dev DEV vid VID [ tunnel_info TUNNEL_ID ] [
pvid ] [ untagged ] [ self ] [ master ]
bridge vlan set dev DEV vid VID [ state STP_STATE ] [ mcast_max_groups
MAX_GROUPS ] [ mcast_router MULTICAST_ROUTER ] [ neigh_suppress
{ on | off } ] [ neigh_forward_grat { on | off } ]
bridge vlan [ show | tunnelshow ] [ dev DEV ]
bridge vlan global set dev DEV vid VID [ mcast_snooping
MULTICAST_SNOOPING ] [ mcast_querier MULTICAST_QUERIER ] [
mcast_igmp_version IGMP_VERSION ] [ mcast_mld_version
MLD_VERSION ] [ mcast_last_member_count LAST_MEMBER_COUNT ] [
mcast_last_member_interval LAST_MEMBER_INTERVAL ] [
mcast_startup_query_count STARTUP_QUERY_COUNT ] [
mcast_startup_query_interval STARTUP_QUERY_INTERVAL ] [
mcast_membership_interval MEMBERSHIP_INTERVAL ] [
mcast_querier_interval QUERIER_INTERVAL ] [ mcast_query_interval
QUERY_INTERVAL ] [ mcast_query_response_interval
QUERY_RESPONSE_INTERVAL ] [ msti MSTI ]
bridge vlan global [ show ] [ dev DEV ] [ vid VID ]
bridge vlan show [ dev DEV ]
bridge vni { add | del } dev DEV vni VNI [ { group | remote } IPADDR ]
bridge vni show [ dev DEV ]
bridge monitor [ all | neigh | link | mdb | vlan ]
๐ OPTIONS ๐
okay so here's the whole menu of flags. every single one. no skipping, bestie. ๐
-V,-Versionโ prints the version of thebridgeutility and then dips. bye! ๐-s,-stats,-statisticsโ gives you MORE info. And like, if you pass it multiple times, the amount of info just keeps growing. As a rule, what you're getting is statistics or some time values. the way it just keeps giving โจ-d,-detailsโ prints detailed information aboutbridge vlanfilter entries or MDB router ports. the details girlies ate ๐ฅ-n,-net,-netns<NETNS>โ switchesbridgeover to the network namespace you named, NETNS. Fr fr it's just a shortcut that simplifies running:
ip netns exec NETNS bridge [ OPTIONS ] OBJECT { COMMAND | help }
down to:
bridge -n[etns] NETNS [ OPTIONS ] OBJECT { COMMAND | help }
less typing, same energy. ๐
-b,-batch<FILENAME>โ reads commands from the file you gave it (or from standard input) and invokes them. Heads up though: the first failure will cause termination of thebridgecommand. one wrong move and the whole thing stops, no cap. ๐-forceโ don't terminate thebridgecommand on errors when you're in batch mode. But like, if there were any errors while the commands ran, the application return code will be non zero. she remembers. ๐-com,-compressvlansโ shows a compressed VLAN list. Instead of a million separated VLANs, it shows continuous VLANs as a range. Default is off. tidy queen ๐-c[color][={always|auto|never}โ configures color output. If you leave the parameter out, or sayalways, color output is enabled no matter what state stdout is in. If it'sauto, stdout gets checked to see if it's a terminal before enabling color output. If it'snever, color output is disabled. Pass it multiple times and the last one takes precedence. Also, this flag is ignored if-jsonis also given. ๐-j,-jsonโ outputs results in JavaScript Object Notation (JSON). for the machines ๐ค-p,-prettyโ when you combine it with-j, you get a pretty JSON output. glow up โจ-o,-onelineโ outputs each record on a single line, replacing line feeds with the'\'character. Super convenient when you wanna count records withwc(1)orgrep(1)the output. iconic for scripting ๐ซถ
๐ BRIDGE - COMMAND SYNTAX ๐
๐ฆ OBJECT
linkโ Bridge port. the port bestie herself ๐fdbโ Forwarding Database entry.mdbโ Multicast group database entry.vlanโ VLAN filter list.vniโ VNI filter list.
๐ง COMMAND
Specifies the action to perform on the object. The set of possible actions depends on the object type. As a rule, you can add, delete and show (or list) objects โ but some objects don't allow all of these operations, or they have some additional commands. The help command is available for all objects. It prints out a list of available commands and argument syntax conventions. (bestie help is always there for you, periodt ๐ซถ)
If no command is given, some default command is assumed. Usually it's list, or โ if the objects of this class can't be listed โ help.
๐ bridge link โ bridge port ๐
link objects correspond to the port devices of the bridge.
The corresponding commands set and display port status and bridge specific attributes. ๐ธ
๐ bridge link set โ set bridge specific attributes on a port
devNAMEโ interface name of the bridge port.costCOSTโ the STP path cost of the specified port.priorityPRIOโ the STP port priority. The priority value is an unsigned 8-bit quantity (a number between 0 and 255). This metric is used in the designated port and root port selection algorithms.stateSTATEโ the operation state of the port. Except for state0(disable STP or BPDU filter feature), this is primarily used by user space STP/RSTP implementation. You can enter the port state name (case insensitive), or one of the numbers below. Negative inputs are ignored, and unrecognized names return an error. (so like, be careful bestie ๐)0โ port is in STP DISABLED state. Make this port completely inactive for STP. This is also called BPDU filter and could be used to disable STP on an untrusted port, like a leaf virtual devices.1โ port is in STP LISTENING state. Only valid if STP is enabled on the bridge. In this state the port listens for STP BPDUs and drops all other traffic frames.2โ port is in STP LEARNING state. Only valid if STP is enabled on the bridge. In this state the port will accept traffic only for the purpose of updating MAC address tables.3โ port is in STP FORWARDING state. Port is fully active.4โ port is in STP BLOCKING state. Only valid if STP is enabled on the bridge. This state is used during the STP election process. In this state, port will only process STP BPDUs.
guard onorguard offโ controls whether STP BPDUs will be processed by the bridge port. By default, the flag is turned off and BPDU processing is allowed. Turning this flag on will disable the bridge port if a STP BPDU packet is received.
If you're running Spanning Tree on a bridge, hostile devices on the network may send BPDU on a port and cause network failure. Setting guard on will detect and stop this by disabling the port. The port will be restarted if the link is brought down, or removed and reattached. For example, if guard is enabled on eth0:
ip link set dev eth0 down; ip link set dev eth0 up
hairpin onorhairpin offโ controls whether traffic may be sent back out of the port on which it was received. This option is also called reflective relay mode, and it's used to support basic VEPA (Virtual Ethernet Port Aggregator) capabilities. By default, this flag is turned off and the bridge will not forward traffic back out of the receiving port.fastleave onorfastleave offโ this flag allows the bridge to immediately stop multicast traffic on a port that receives an IGMP Leave message. It's only used when IGMP snooping is enabled on the bridge. By default the flag is off.root_block onorroot_block offโ controls whether a given port is allowed to become root port or not. Only used when STP is enabled on the bridge. By default the flag is off.
This feature is also called root port guard. If BPDU is received from a leaf (edge) port, it should not be elected as root port. This could be used if you're using STP on a bridge and the downstream bridges are not fully trusted โ this prevents a hostile guest from rerouting traffic. ๐ก๏ธ
learning onorlearning offโ controls whether a given port will learn MAC addresses from received traffic or not. If learning is off, the bridge will end up flooding any traffic for which it has no FDB entry. By default this flag is on.
okay that's the first chunk, and bestie there is SO much more coming โ don't go anywhere โจ๐
learning_sync onorlearning_sync offโ okay so this controls whether a given port will sync MAC addresses learned on device port to bridge FDB. ๐flood onorflood offโ Controls whether unicast traffic for which there is no FDB entry will be flooded towards this given port. By default this flag ison. โจhwmodeโ Some network interface cards support HW bridge functionality and they may be configured in different modes. Currently support modes are:vepaโ Data sent between HW ports is sent on the wire to the external switch.vebโ bridging happens in hardware.
bcast_flood onorbcast_flood offโ Controls flooding of broadcast traffic on the given port. By default this flag ison. ๐mcast_flood onormcast_flood offโ Controls whether multicast traffic for which there is no MDB entry will be flooded towards this given port. By default this flag ison. ๐ฆmcast_max_groups MAX_GROUPSโ Sets the maximum number of MDB entries that can be registered for a given port. Attempts to register more MDB entries at the port than this limit allows will be rejected, whether they are done through netlink (e.g. thebridgetool), or IGMP or MLD membership reports. Setting a limit to0has the effect of disabling the limit. The default value is0. See also theip linkoptionmcast_hash_max. ๐mcast_router MULTICAST_ROUTERโ This flag is almost the same as the per-VLAN flag, see below, except its value can only be set in the range0-2. The default is1where the bridge figures out automatically where an IGMP/MLD querier, MRDISC capable device, or PIM router, is located. Setting this flag to2is useful in cases where the multicast router does not indicate its presence in any meaningful way (e.g. older versions of SMCRoute, or mrouted), or when there is a need for forwarding both known and unknown IP multicast to a secondary/backup router. ๐mcast_to_unicast onormcast_to_unicast offโ Controls whether a given port will replicate packets using unicast instead of multicast. By default this flag isoff. ๐
This is done by copying the packet per host and changing the multicast destination MAC to a unicast one accordingly.
mcast_to_unicast works on top of the multicast snooping feature of the bridge. Which means unicast copies are only delivered to hosts which are interested in it and signalized this via IGMP/MLD reports previously.
This feature is intended for interface types which have a more reliable and/or efficient way to deliver unicast packets than broadcast ones (e.g. WiFi).
However, it should only be enabled on interfaces where no IGMPv2/MLDv1 report suppression takes place. IGMP/MLD report suppression issue is usually overcome by the network daemon (supplicant) enabling AP isolation and by that separating all STAs.
Delivery of STA-to-STA IP multicast is made possible again by enabling and utilizing the bridge hairpin mode, which considers the incoming port as a potential outgoing port, too (see hairpin option). Hairpin mode is performed after multicast snooping, therefore leading to only deliver reports to STAs running a multicast router. ๐ธ
neigh_suppress onorneigh_suppress offโ Controls whether neigh discovery (arp and nd) proxy and suppression is enabled on the port. By default this flag isoff. ๐neigh_vlan_suppress onorneigh_vlan_suppress offโ Controls whether per-VLAN neigh discovery (arp and nd) proxy and suppression is enabled on the port. Whenon, the bridge link optionneigh_suppresshas no effect and the per-VLAN state is set using thebridge vlanoptionneigh_suppress. By default this flag isoff. โจneigh_forward_grat onorneigh_forward_grat offโ Controls whether gratuitous ARP packets and unsolicited Neighbor Advertisement packets are forwarded when neighbor suppression is enabled on the port. By default this flag isoff, meaning gratuitous ARP and unsolicited NA packets will be suppressed when neighbor suppression is enabled. Setting this flag toonallows these packets to be forwarded even when neighbor suppression is enabled. ๐ฆvlan_tunnel onorvlan_tunnel offโ Controls whether vlan to tunnel mapping is enabled on the port. By default this flag isoff. ๐isolated onorisolated offโ Controls whether a given port will be isolated, which means it will be able to communicate with non-isolated ports only. By default this flag isoff. ๐locked onorlocked offโ Controls whether a port is locked or not. When locked, non-link-local frames received through the port are dropped unless an FDB entry with the MAC source address points to the port. The common use case is IEEE 802.1X where hosts can authenticate themselves by exchanging EAPOL frames with an authenticator. After authentication is complete, the user space control plane can install a matching FDB entry to allow traffic from the host to be forwarded by the bridge. When learning is enabled on a locked port, theno_linklocal_learnbridge option needs to be on to prevent the bridge from learning from received EAPOL frames. By default this flag isoff. ๐ฅmab onormab offโ Controls whether MAC Authentication Bypass (MAB) is enabled on the port or not. MAB can only be enabled on a locked port that has learning enabled. When enabled, FDB entries are learned from received traffic and have the "locked" FDB flag set. The flag can only be set by the kernel and it indicates that the FDB entry cannot be used to authenticate the corresponding host. User space can decide to authenticate the host by replacing the FDB entry and clearing the "locked" FDB flag. Locked FDB entries can roam to unlocked (authorized) ports in which case the "locked" flag is cleared. FDB entries cannot roam to locked ports regardless of MAB being enabled or not. Therefore, locked FDB entries are only created if an FDB entry with the given{MAC, VID}does not already exist. This behavior prevents unauthenticated hosts from disrupting traffic destined to already authenticated hosts. Locked FDB entries act like regular dynamic entries with respect to forwarding and aging. By default this flag isoff. ๐backup_port DEVICEโ If the port loses carrier all traffic will be redirected to the configured backup port. ๐nobackup_portโ Removes the currently configured backup port. โจbackup_nhid NHIDโ The FDB nexthop object ID (seeip-nexthop(8)) to attach to packets being redirected to a backup port that has VLAN tunnel mapping enabled (via thevlan_tunneloption). Setting a value of0(default) has the effect of not attaching any ID. ๐ฆselfโ link setting is configured on specified physical device. ๐masterโ link setting is configured on the software bridge (default). ๐-t,-timestampโ display current time when usingmonitoroption. โจ
๐ bridge link show - list ports configuration for all bridges. ๐
This command displays ports configuration and flags for all bridges by default. periodt.
dev DEVโ only display the specific bridge port named DEV. ๐master DEVICEโ only display ports of the bridge named DEVICE. This is similar toip link show master <bridge_device>command. ๐
bridge fdb - forwarding database management
Okay so bestie, fdb objects contain known Ethernet addresses on a link. The corresponding commands display fdb entries, add new entries, append entries, and delete old ones. โจ No cap, this is the whole vibe.
bridge fdb add - add a new fdb entry
This command creates a new fdb entry. ๐ It's giving "I'm adding a new address to the forwarding database."
LLADDRโ the Ethernet MAC address.dev DEVโ the interface to which this address is associated.localโ is a local permanent fdb entry, which means that the bridge will not forward frames with this destination MAC address and VLAN ID, but terminate them locally. This flag is default unlessstaticordynamicare explicitly specified. ๐permanentโ this is a synonym forlocal.staticโ is a static (no arp) fdb entry.dynamicโ is a dynamic reachable age-able fdb entry.selfโ the operation is fulfilled directly by the driver for the specified network device. If the network device belongs to a master like a bridge, then the bridge is bypassed and not notified of this operation (and if the device does notify the bridge, it is driver-specific behavior and not mandated by this flag, check the driver for more details). Thebridge fdb addcommand can also be used on the bridge device itself, and in this case, the added fdb entries will be locally terminated (not forwarded). In the latter case, theselfflag is mandatory. The flag is set by default ifmasteris not specified. ๐คmasterโ if the specified network device is a port that belongs to a master device such as a bridge, the operation is fulfilled by the master device's driver, which may in turn notify the port driver too of the address. If the specified device is a master itself, such as a bridge, this flag is invalid.routerโ the destination address is associated with a router. Valid if the referenced device is a VXLAN type device and has route short circuit 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.extern_learnโ this entry was learned externally. This option can be used to indicate to the kernel that an entry was hardware or user-space controller learnt dynamic entry. Kernel will not age such an entry.stickyโ this entry will not change its port due to learning.
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.src_vni VNIโ the src VNI Network Identifier (or VXLAN Segment ID) this entry belongs to. Used only when the vxlan device is in external or collect metadata mode. If omitted the value specified at vxlan device creation will be used.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.nhid NHIDโ ecmp nexthop group for the VXLAN device driver to reach remote VXLAN tunnel endpoints.activity_notifyโ enable activity notifications on an existing or a new FDB entry. This keyword only makes sense for non-dynamic entries as dynamic entries are deleted upon inactivity. An entry is assumed to be active unless theinactivekeyword is specified.inactiveโ mark an FDB entry as inactive. This keyword only makes sense in conjunction with theactivity_notifykeyword and usually only when adding a new FDB entry as opposed to replacing an existing one.norefreshโ avoid resetting an FDB entry's activity (i.e., its last updated time). This can be useful, for example, when one wants to enable activity notifications on an existing entry without modifying its last updated time.
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. ๐ฅ That's how you do broadcast, periodt.
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. ๐๏ธ Bye bye, address.
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. ๐ It's like a glow-up for your fdb.
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. Obsessed with the details. ๐
bridge fdb get - get bridge forwarding entry.
Lookup a bridge forwarding table entry. ๐
LLADDRโ the Ethernet MAC address.dev DEVโ the interface to which this address is associated.brport DEVโ the bridge port to which this address is associated. same asdevabove.br DEVโ the bridge to which this address is associated.selfโ the address is associated with the port drivers fdb. Usually hardware.masterโ the address is associated with master devices fdb. Usually software (default).
bridge fdb flush - flush bridge forwarding table entries.
Flush the matching bridge forwarding table entries. Some options below have a negated form when "no" is prepended to them (e.g. permanent and nopermanent). ๐
It's giving "spring cleaning" for your fdb.
dev DEVโ the target device for the operation. If the device is a bridge port andmasteris set then the operation will be fulfilled by its master device's driver and all entries pointing to that port will be deleted.brport DEVโ the target bridge port for the operation. If the bridge device is specified then only entries pointing to the bridge itself will be deleted. Note that the target device specified by this option will override the one specified bydevabove.vlan VIDโ the target VLAN ID for the operation. Match forwarding table entries only with the specified VLAN ID.src_vni VNIโ the src VNI Network Identifier (or VXLAN Segment ID) for the operation. Match forwarding table entries only with the specified VNI. Valid if the referenced device is a VXLAN type device.nhid NHIDโ the ECMP nexthop group for the operation. Match forwarding table entries only with the specified NHID. Valid if the referenced device is a VXLAN type device.vni VNIโ the VXLAN VNI Network Identifier (or VXLAN Segment ID) for the operation. Match forwarding table entries only with the specified VNI. Valid if the referenced device is a VXLAN type device.port PORTโ the UDP destination PORT number for the operation. Match forwarding table entries only with the specified PORT. Valid if the referenced device is a VXLAN type device.dst IPADDRโ the IP address of the destination VXLAN tunnel endpoint for the operation. Match forwarding table entries only with the specified IPADDR. Valid if the referenced device is a VXLAN type device.selfโ the operation is fulfilled directly by the driver for the specified network device. If the network device belongs to a master like a bridge, then the bridge is bypassed and not notified of this operation. Thebridge fdb flushcommand can also be used on the bridge device itself. The flag is set by default ifmasteris not specified.masterโ if the specified network device is a port that belongs to a master device such as a bridge, the operation is fulfilled by the master device's driver. Flush with bothmasterandselfis not recommended with attributes that are not supported by all devices (e.g.,vlan,vni). Such command will be handled by bridge or VXLAN driver, but will return an error from the driver that does not support the attribute. Instead, run flush twice - once withselfand once withmaster, and each one with the supported attributes.[no]permanentโ if specified then only permanent entries will be deleted or respectively if "no" is prepended then only non-permanent entries will be deleted.[no]staticโ if specified then only static entries will be deleted or respectively if "no" is prepended then only non-static entries will be deleted.[no]dynamicโ if specified then only dynamic entries will be deleted or respectively if "no" is prepended then only non-dynamic (static or permanent) entries will be deleted.[no]added_by_userโ if specified then only entries with added_by_user flag will be deleted or respectively if "no" is prepended then only entries without added_by_user flag will be deleted.[no]extern_learnโ if specified then only entries with extern_learn flag will be deleted or respectively if "no" is prepended then only entries without extern_learn flag will be deleted.[no]stickyโ if specified then only entries with sticky flag will be deleted or respectively if "no" is prepended then only entries without sticky flag will be deleted.[no]offloadedโ if specified then only entries with offloaded flag will be deleted or respectively if "no" is prepended then only entries without offloaded flag will be deleted.[no]routerโ if specified then only entries with router flag will be deleted or respectively if "no" is prepended then only entries without router flag will be deleted. Valid if the referenced device is a VXLAN type device.
๐ bridge mdb - multicast group database management ๐
okay bestie so mdb objects are literally just the known IP or L2 multicast group addresses hanging out on a link. that's it, that's the vibe. ๐
the matching commands let you display mdb entries, add new ones, replace entries, and delete the old ones. full glow-up cycle.
โจ bridge mdb add - add a new multicast group database entry โจ
this command creates a new mdb entry. brand new, fresh out the box, main character energy. ๐
dev DEVโ the interface where this group address is associated. (where it lives, basically ๐ )port PORTโ the port whose link is known to have members of this multicast group.grp GROUPโ the multicast group address (IPv4, IPv6 or L2 multicast) whose members reside on the link connected to the port.permanentโ the mdb entry is permanent. Optional for IPv4 and IPv6, mandatory for L2. no skipping it for L2, fr fr.tempโ the mdb entry is temporary (default)
src SOURCEโ optional source IP address of a sender for this multicast group. If IGMPv3 for IPv4, or MLDv2 for IPv6 respectively, are enabled it will be included in the lookup when forwarding multicast traffic.vid VIDโ the VLAN ID which is known to have members of this multicast group.filter_mode includeorfilter_mode excludeโ controls whether the sources in the entry's source list are in INCLUDE or EXCLUDE mode. Can only be set for(*, G)entries.source_list SOURCE_LISTโ optional list of source IP addresses of senders for this multicast group, separated by a,. Whether the entry forwards packets from these senders or not is determined by the entry's filter mode, which becomes a mandatory argument. Can only be set for(*, G)entries.proto PROTOโ the routing protocol identifier of this mdb entry. Can be a number or a string from the file/etc/iproute2/rt_protos. If the routing protocol is not given, thenstaticis assumed. (default behaviour slay โจ)
๐ฆ heads up bestie: 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 multicast receivers reside.dst_port DST_PORTโ the UDP destination port number to use to connect to the remote VXLAN tunnel endpoint. If omitted, the value specified at VXLAN device creation will be used.vni VNIโ the VXLAN VNI Network Identifier to use to connect to the remote VXLAN tunnel endpoint. If omitted, the value specified at VXLAN device creation will be used or the source VNI when the VXLAN device is in external mode.src_vni SRC_VNIโ the source VNI Network Identifier this entry belongs to. Used only when the VXLAN device is in external mode. If omitted, the value specified at VXLAN device creation will be used.via DEVโ device name of the outgoing interface for the VXLAN device to reach the remote VXLAN tunnel endpoint.
the 0.0.0.0 and :: MDB entries are special catchall entries used to flood IPv4 and IPv6 unregistered multicast packets, respectively. so like, they catch everything the normal ones don't. therefore, when these entries are programmed, the catchall 00:00:00:00:00:00 FDB entry will only flood broadcast, unknown unicast and link-local multicast. ๐
๐ธ bridge mdb delete - delete a multicast group database entry ๐ธ
this command removes an existing mdb entry. bye bye, we don't know her anymore. ๐
The arguments are the same as with bridge mdb add.
๐ bridge mdb replace - replace a multicast group database entry ๐
If no matching entry is found, a new one will be created instead. (it's giving "if you can't find her, build her" ๐ญ)
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 โ no cap, it does it by itself. it can be altered by bridge mdb add and bridge mdb del commands manually too, if you're feeling hands-on.
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 mdb get - get multicast group database entry. ๐ฆ
this command retrieves a multicast group database entry based on its key. like a lil lookup, bestie.
dev DEVโ the interface where this group address is associated.grp GROUPโ the multicast group address (IPv4, IPv6 or L2 multicast).src SOURCEโ the source IP address. Only relevant when retrieving an(S, G)entry.vid VIDโ the VLAN ID. Only relevant when the bridge is VLAN-aware.src_vni SRC_VNIโ the source VNI Network Identifier. Only relevant when the VXLAN device is in external mode.
๐ฅ bridge mdb flush - flush multicast group database entries. ๐ฅ
this command flushes the matching multicast group database entries. everything that matches? gone. bye. ๐
dev DEVโ the interface where this group address is associated.port PORTโ the target port for the operation. If the bridge device is specified then only entries pointing to the bridge itself will be deleted.vid VIDโ the VLAN ID for the operation. Match entries only with the specified VLAN ID.src_vni SRC_VNIโ the source VNI Network Identifier for the operation. Match entries only with the specified source VNI.proto PROTOโ the routing protocol identifier for the operation. Match entries only with the specified routing protocol. Can be a number or a string from the file/etc/iproute2/rt_protos.[no]permanentโ if specified then only permanent entries will be deleted or respectively if "no" is prepended then only non-permanent (temp) entries will be deleted.dst IPADDRโ the IP address of the destination VXLAN tunnel endpoint where the multicast receivers reside. Match entries only with the specified destination IP.dst_port DST_PORTโ the UDP destination port number to use to connect to the remote VXLAN tunnel endpoint. Match entries only with the specified destination port number.vni VNIโ the VXLAN VNI Network Identifier to use to connect to the remote VXLAN tunnel endpoint. Match entries only with the specified destination VNI.
โญ bridge mst - multiple spanning tree port states โญ
okay so in the multiple spanning tree (MST) model, the active paths through a network can be different for different VLANs. in other words, a bridge port can simultaneously forward one subset of VLANs, while blocking another. multitasking queen. ๐
provided that the mst_enable bridge option is enabled, a group of VLANs can be forwarded along the same spanning tree by associating them with the same instance (MSTI) using bridge vlan global set.
๐ซ bridge mst set - set multiple spanning tree state ๐ซ
Set the spanning tree state for DEV, in the multiple spanning tree instance MSTI, to STP_STATE.
dev DEVโ Interface name of the bridge port.msti MSTIโ The multiple spanning tree instance.state STP_STATEโ The spanning tree state, see thestateoption ofbridge link setfor supported states.
๐ bridge mst show - list MST states ๐
List current MST port states in every MSTI. full rundown, all the tea. ๐ต
dev DEVโ If specified, only display states of the bridge port with this interface name.
bridge vlan - VLAN filter list
bestie. vlan objects hold the known VLAN IDs for a link. that's the whole vibe. ๐
The corresponding commands display vlan filter entries, add new entries, and delete old ones. it's giving filing cabinet but make it network. โจ
bridge vlan add - add a new vlan filter entry
This command creates a new vlan filter entry. brand new entry, freshly unboxed ๐
dev NAMEโ the interface this vlan is associated with.vid VIDโ the VLAN ID that identifies the vlan.tunnel_info TUNNEL_IDโ the TUNNEL ID that maps to this vlan. the tunnel id gets set indst_metadatafor every packet that belongs to this vlan (only applicable to bridge ports with thevlan_tunnelflag set).pvidโ the vlan you specified is to be considered a PVID at ingress. any untagged frames get assigned to this VLAN.untaggedโ the vlan you 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. bye bye ๐
The arguments are the same as with bridge vlan add. the pvid and untagged flags are ignored here, so don't even try it.
bridge vlan set - change vlan filter entry's options
This command changes vlan filter entry's options. glow-up time โจ
dev NAMEโ the interface this vlan is associated with.vid VIDโ the VLAN ID that identifies the vlan.state STP_STATEโ the operation state of the vlan. you can enter the STP state name (case insensitive), or one of the numbers below. Negative inputs are ignored, and unrecognized names return an error. Also note: the state is set only for the vlan of the specified device โ so if it's a bridge port, the state gets set only for the vlan of the port. iykyk.0โ vlan is in STP DISABLED state. makes this vlan completely inactive for STP. this is also called BPDU filter and could be used to disable STP on an untrusted vlan. ๐1โ vlan is in STP LISTENING state. only valid if STP is enabled on the bridge. in this state the vlan listens for STP BPDUs and drops all other traffic frames.2โ vlan is in STP LEARNING state. only valid if STP is enabled on the bridge. in this state the vlan will accept traffic only for the purpose of updating MAC address tables.3โ vlan is in STP FORWARDING state. this is the default vlan state. the main character ๐4โ vlan is in STP BLOCKING state. only valid if STP is enabled on the bridge. this state is used during the STP election process. in this state, the vlan will only process STP BPDUs.
mcast_max_groups MAX_GROUPSโ sets the max number of MDB entries that can be registered for a given VLAN on a given port. it's the VLAN-specific equivalent of the per-port option of the same name, see above for details.
heads up bestie: this option is only available when theip linkoptionmcast_vlan_snoopingis enabled.
mcast_router MULTICAST_ROUTERโ configure this vlan and interface's multicast router mode. note that only modes0โ2are available for bridge devices. a vlan and interface with a multicast router will receive all multicast traffic.MULTICAST_ROUTERmay be either:0โ to disable multicast router.1โ to let the system detect the presence of routers (default).2โ to permanently enable multicast traffic forwarding on this vlan and interface.3โ to temporarily mark this vlan and port as having a multicast router, i.e. enable multicast traffic forwarding. this mode is available only for ports.
neigh_suppress onorneigh_suppress offโ controls whether neigh discovery (arp and nd) proxy and suppression is enabled for a given VLAN on a given port. by default this flag is off.
this option only takes effect when thebridge linkoptionneigh_vlan_suppressis enabled for a given port.
neigh_forward_grat onorneigh_forward_grat offโ controls whether gratuitous ARP packets and unsolicited Neighbor Advertisement packets are forwarded when neighbor suppression is enabled for a given VLAN on a given port. by default this flag is off, meaning gratuitous ARP and unsolicited NA packets will be suppressed when neighbor suppression is enabled. setting this flag toonlets these packets be forwarded even when neighbor suppression is enabled. ๐ฆ
again: this option only takes effect when thebridge linkoptionneigh_vlan_suppressis enabled for a given port.
bridge vlan show - list vlan configuration.
This command displays the current VLAN filter table. the receipts, basically ๐งพ
With the -details option, the command becomes verbose. it displays the per-vlan options.
With the -statistics option, the command displays per-vlan traffic statistics. numbers go brrr ๐
bridge vlan tunnelshow - list vlan tunnel mapping.
This command displays the current vlan tunnel info mapping.
bridge vlan global set - change vlan filter entry's global options
This command changes vlan filter entry's global options. global girlie behaviour ๐
dev NAMEโ the interface this vlan is associated with. only bridge devices are supported for global options.vid VIDโ the VLAN ID that identifies the vlan.mcast_snooping MULTICAST_SNOOPINGโ turn multicast snooping for the VLAN entry with that VLAN ID on (MULTICAST_SNOOPING > 0) or off (MULTICAST_SNOOPING == 0). default is on.mcast_querier MULTICAST_QUERIERโ enable (MULTICAST_QUERIER > 0) or disable (MULTICAST_QUERIER == 0) IGMP/MLD querier, i.e. sending of multicast queries by the bridge. default is disabled.mcast_igmp_version IGMP_VERSIONโ set the IGMP version. default is2.mcast_mld_version MLD_VERSIONโ set the MLD version. default is1.mcast_last_member_count LAST_MEMBER_COUNTโ set multicast last member count, i.e. the number of queries the bridge will send before stopping forwarding a multicast group after a "leave" message has been received. default is2.mcast_last_member_interval LAST_MEMBER_INTERVALโ interval between queries to find remaining members of a group, after a "leave" message is received.mcast_startup_query_count STARTUP_QUERY_COUNTโ set the number of queries to send during the startup phase. default is2.mcast_startup_query_interval STARTUP_QUERY_INTERVALโ interval between queries in the startup phase.mcast_membership_interval MEMBERSHIP_INTERVALโ delay after which the bridge will leave a group, if no membership reports for this group are received.mcast_querier_interval QUERIER_INTERVALโ interval between queries sent by other routers. if no queries are seen after this delay has passed, the bridge will start to send its own queries (as ifmcast_querierwas enabled).mcast_query_interval QUERY_INTERVALโ interval between queries sent by the bridge after the end of the startup phase.mcast_query_response_interval QUERY_RESPONSE_INTERVALโ set the Max Response Time/Maximum Response Delay for IGMP/MLD queries sent by the bridge.msti MSTIโ associate the VLAN with the specified multiple spanning tree instance (MSTI).
bridge vlan global show - list global vlan options.
This command displays the global VLAN options for each VLAN entry.
dev DEVโ only list the VLAN global options for this interface. default is to list all bridge interfaces.vid VIDโ only list the global options for this VLAN ID. default is to list all vlans.
bridge vni - VNI filter list
vni objects contain known VNI IDs for a dst metadata vxlan link. ๐
The corresponding commands display vni filter entries, add new entries, and delete old ones.
bridge vni add - add a new vni filter entry
This command creates a new vni filter entry.
dev NAMEโ the interface this vni is associated with.vni VNIโ the VNI ID that identifies the vni.remote IPADDRโ specifies the unicast destination IP address to use in outgoing packets when the destination link layer address is not known in the VXLAN device forwarding database. this parameter cannot be specified together withgroup. it's one or the other bestie ๐ซถgroup IPADDRโ specifies the multicast IP address to join for this VNI.
bridge vni del - delete a new vni filter entry
This command removes an existing vni filter entry.
The arguments are the same as with bridge vni add.
bridge vni show - list vni filtering configuration.
This command displays the current vni filter table.
With the -statistics option, the command displays per-vni traffic statistics.
dev NAMEโ shows the vni filtering table associated with the vxlan device.
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 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, vlan 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. vintage, but iconic โจ
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. so like, it figures it out. ๐
SEE ALSO
BUGS
Please direct bugreports and patches to: <netdev@vger.kernel.org> ๐ฌ
AUTHOR
Original Manpage by Stephen Hemminger
and that's a wrap on the whole page, bestie!! ๐ this one came from iproute2 and the page itself is dated 1 August 2012 โ shoutout to the <pink>BRIDGE(8)</pink> girlies, you ate and left no crumbs. now go bridge something. periodt ๐๐ฆ
๐ฆ where this page comes from
- arch rolling: iproute2 7.2.0-1
- arch rolling: iproute2 7.3.0-1 ยท GPL-2.0-or-later
- nixpkgs unstable: iproute2 7.2.0
- ubuntu stonking: iproute2 7.2.0-1ubuntu1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms