1BRIDGE(8)                            Linux                           BRIDGE(8)
2
3
4

NAME

6       bridge - show / manipulate bridge addresses and devices
7

SYNOPSIS

9       bridge [ OPTIONS ] OBJECT { COMMAND | help }
10
11
12       OBJECT := { link | fdb | mdb | vlan | monitor }
13
14
15       OPTIONS := { -V[ersion] | -s[tatistics] | -n[etns] name | -b[atch]
16               filename | -j[son] }
17
18       bridge link set dev DEV  [ cost COST ] [ priority PRIO ] [ state STATE]
19               [ guard { on | off } ] [ hairpin { on | off } ] [ fastleave {
20               on | off } ] [ root_block { on | off } ] [ learning { on | off
21               } ] [ learning_sync { on | off } ] [ flood { on | off } ] [
22               hwmode { vepa | veb } ] [ mcast_flood { on | off } ] [ self ] [
23               master ]
24
25       bridge link [ show ] [ dev DEV ]
26
27       bridge fdb { add | append | del | replace } LLADDR dev DEV { local |
28               static | dynamic } [ self ] [ master ] [ router ] [ use ] [ dst
29               IPADDR ] [ vni VNI ] [ port PORT ] [ via DEVICE ]
30
31       bridge fdb [ show ] [ dev DEV ] [ br BRDEV ] [ brport DEV ] [ vlan VID
32               ] [ state STATE ]
33
34       bridge mdb { add | del } dev DEV port PORT grp GROUP [ permanent | temp
35               ] [ vid VID ]
36
37       bridge mdb show [ dev DEV ]
38
39       bridge vlan { add | del } dev DEV vid VID [ pvid ] [ untagged ] [ self
40               ] [ master ]
41
42       bridge vlan [ show ] [ dev DEV ]
43
44       bridge monitor [ all | neigh | link | mdb ]
45
46

OPTIONS

48       -V, -Version
49              print the version of the bridge utility and exit.
50
51
52       -s, -stats, -statistics
53              output more information. If this option is given multiple times,
54              the amount of information increases.  As a rule, the information
55              is statistics or some time values.
56
57
58       -d, -details
59              print detailed information about MDB router ports.
60
61
62       -n, -net, -netns <NETNS>
63              switches bridge to the specified network namespace NETNS.  Actu‐
64              ally it just simplifies executing of:
65
66              ip netns exec NETNS bridge [ OPTIONS ] OBJECT { COMMAND | help }
67
68              to
69
70              bridge -n[etns] NETNS [ OPTIONS ] OBJECT { COMMAND | help }
71
72
73       -b, -batch <FILENAME>
74              Read commands from provided file or standard input and invoke
75              them.  First failure will cause termination of bridge command.
76
77
78       -force Don't terminate bridge command on errors in batch mode.  If
79              there were any errors during execution of the commands, the
80              application return code will be non zero.
81
82
83       -json  Display results in JSON format. Currently available for vlan and
84              fdb.
85
86

BRIDGE - COMMAND SYNTAX

88   OBJECT
89       link   - Bridge port.
90
91
92       fdb    - Forwarding Database entry.
93
94
95       mdb    - Multicast group database entry.
96
97
98       vlan   - VLAN filter list.
99
100
101   COMMAND
102       Specifies the action to perform on the object.  The set of possible
103       actions depends on the object type.  As a rule, it is possible to add,
104       delete and show (or list ) objects, but some objects do not allow all
105       of these operations or have some additional commands. The help command
106       is available for all objects. It prints out a list of available com‐
107       mands and argument syntax conventions.
108
109       If no command is given, some default command is assumed.  Usually it is
110       list or, if the objects of this class cannot be listed, help.
111
112
114       link objects correspond to the port devices of the bridge.
115
116
117       The corresponding commands set and display port status and bridge spe‐
118       cific attributes.
119
120
121   bridge link set - set bridge specific attributes on a port
122       dev NAME
123              interface name of the bridge port
124
125
126       cost COST
127              the STP path cost of the specified port.
128
129
130       priority PRIO
131              the STP port priority. The priority value is an unsigned 8-bit
132              quantity (number between 0 and 255). This metric is used in the
133              designated port an droot port selectio algorithms.
134
135
136       state STATE
137              the operation state of the port. This is primarily used by user
138              space STP/RSTP implementation. One may enter a lowercased port
139              state name, or one of the numbers below. Negative inputs are
140              ignored, and unrecognized names return an error.
141
142              0 - port is DISABLED. Make this port completely inactive.
143
144
145              1 - STP LISTENING state. Only valid if STP is enabled on the
146              bridge. In this state the port listens for STP BPDUs and drops
147              all other traffic frames.
148
149
150              2 - STP LEARNING state. Only valid if STP is enabled on the
151              bridge. In this state the port will accept traffic only for the
152              purpose of updating MAC address tables.
153
154
155              3 - STP FORWARDING state. Port is fully active.
156
157
158              4 - STP BLOCKING state. Only valid if STP is enabled on the
159              bridge. This state is used during the STP election process. In
160              this state, port will only process STP BPDUs.
161
162
163
164       guard on or guard off
165              Controls whether STP BPDUs will be processed by the bridge port.
166              By default, the flag is turned off allowed BPDU processing.
167              Turning this flag on will cause the port to stop processing STP
168              BPDUs.
169
170
171       hairpin on or hairpin off
172              Controls whether traffic may be send back out of the port on
173              which it was received. By default, this flag is turned off and
174              the bridge will not forward traffic back out of the receiving
175              port.
176
177
178       fastleave on or fastleave off
179              This flag allows the bridge to immediately stop multicast traf‐
180              fic on a port that receives IGMP Leave message. It is only used
181              with IGMP snooping is enabled on the bridge. By default the flag
182              is off.
183
184
185       root_block on or root_block off
186              Controls whether a given port is allowed to become root port or
187              not. Only used when STP is enabled on the bridge. By default the
188              flag is off.
189
190
191       learning on or learning off
192              Controls whether a given port will learn MAC addresses from
193              received traffic or not. If learning if off, the bridge will end
194              up flooding any traffic for which it has no FDB entry. By
195              default this flag is on.
196
197
198       learning_sync on or learning_sync off
199              Controls whether a given port will sync MAC addresses learned on
200              device port to bridge FDB.
201
202
203       flooding on or flooding off
204              Controls whether a given port will flood unicast traffic for
205              which there is no FDB entry. By default this flag is on.
206
207
208       hwmode Some network interface cards support HW bridge functionality and
209              they may be configured in different modes. Currently support
210              modes are:
211
212              vepa - Data sent between HW ports is sent on the wire to the
213              external switch.
214
215              veb - bridging happens in hardware.
216
217
218       mcast_flood on or mcast_flood off
219              Controls whether a given port will be flooded with multicast
220              traffic for which there is no MDB entry. By default this flag is
221              on.
222
223
224       self   link setting is configured on specified physical device
225
226
227       master link setting is configured on the software bridge (default)
228
229
230       -t, -timestamp
231              display current time when using monitor option.
232
233
234   bridge link show - list bridge port configuration.
235       This command displays the current bridge port configuration and flags.
236
237

bridge fdb - forwarding database management

239       fdb objects contain known Ethernet addresses on a link.
240
241
242       The corresponding commands display fdb entries, add new entries, append
243       entries, and delete old ones.
244
245
246   bridge fdb add - add a new fdb entry
247       This command creates a new fdb entry.
248
249
250       LLADDR the Ethernet MAC address.
251
252
253       dev DEV
254              the interface to which this address is associated.
255
256              local - is a local permanent fdb entry
257
258
259              static - is a static (no arp) fdb entry
260
261
262              dynamic - is a dynamic reachable age-able fdb entry
263
264
265              self - the address is associated with the port drivers fdb. Usu‐
266              ally hardware.
267
268
269              master - the address is associated with master devices fdb. Usu‐
270              ally software (default).
271
272
273              router - the destination address is associated with a router.
274              Valid if the referenced device is a VXLAN type device and has
275              route shortcircuit enabled.
276
277
278              use - the address is in use. User space can use this option to
279              indicate to the kernel that the fdb entry is in use.
280
281
282      The next command line parameters apply only when the specified device
283      DEV is of type VXLAN.
284
285       dst IPADDR
286              the IP address of the destination VXLAN tunnel endpoint where
287              the Ethernet MAC ADDRESS resides.
288
289
290       vni VNI
291              the VXLAN VNI Network Identifier (or VXLAN Segment ID) to use to
292              connect to the remote VXLAN tunnel endpoint.  If omitted the
293              value specified at vxlan device creation will be used.
294
295
296       port PORT
297              the UDP destination PORT number to use to connect to the remote
298              VXLAN tunnel endpoint.  If omitted the default value is used.
299
300
301       via DEVICE
302              device name of the outgoing interface for the VXLAN device
303              driver to reach the remote VXLAN tunnel endpoint.
304
305
306   bridge fdb append - append a forwarding database entry
307       This command adds a new fdb entry with an already known LLADDR.  Valid
308       only for multicast link layer addresses.  The command adds support for
309       broadcast and multicast Ethernet MAC addresses.  The Ethernet MAC
310       address is added multiple times into the forwarding database and the
311       vxlan device driver sends a copy of the data packet to each entry
312       found.
313
314
315       The arguments are the same as with bridge fdb add.
316
317
318   bridge fdb delete - delete a forwarding database entry
319       This command removes an existing fdb entry.
320
321
322       The arguments are the same as with bridge fdb add.
323
324
325   bridge fdb replace - replace a forwarding database entry
326       If no matching entry is found, a new one will be created instead.
327
328
329       The arguments are the same as with bridge fdb add.
330
331
332   bridge fdb show - list forwarding entries.
333       This command displays the current forwarding table.
334
335
336       With the -statistics option, the command becomes verbose. It prints out
337       the last updated and last used time for each entry.
338
339

bridge mdb - multicast group database management

341       mdb objects contain known IP multicast group addresses on a link.
342
343
344       The corresponding commands display mdb entries, add new entries, and
345       delete old ones.
346
347
348   bridge mdb add - add a new multicast group database entry
349       This command creates a new mdb entry.
350
351
352       dev DEV
353              the interface where this group address is associated.
354
355
356       port PORT
357              the port whose link is known to have members of this multicast
358              group.
359
360
361       grp GROUP
362              the IP multicast group address whose members reside on the link
363              connected to the port.
364
365              permanent - the mdb entry is permanent
366
367
368              temp - the mdb entry is temporary (default)
369
370
371
372       vid VID
373              the VLAN ID which is known to have members of this multicast
374              group.
375
376
377   bridge mdb delete - delete a multicast group database entry
378       This command removes an existing mdb entry.
379
380
381       The arguments are the same as with bridge mdb add.
382
383
384   bridge mdb show - list multicast group database entries
385       This command displays the current multicast group membership table. The
386       table is populated by IGMP and MLD snooping in the bridge driver auto‐
387       matically. It can be altered by bridge mdb add and bridge mdb del com‐
388       mands manually too.
389
390
391       dev DEV
392              the interface only whose entries should be listed. Default is to
393              list all bridge interfaces.
394
395
396       With the -details option, the command becomes verbose. It prints out
397       the ports known to have a connected router.
398
399
400       With the -statistics option, the command displays timer values for mdb
401       and router port entries.
402
403

bridge vlan - VLAN filter list

405       vlan objects contain known VLAN IDs for a link.
406
407
408       The corresponding commands display vlan filter entries, add new
409       entries, and delete old ones.
410
411
412   bridge vlan add - add a new vlan filter entry
413       This command creates a new vlan filter entry.
414
415
416       dev NAME
417              the interface with which this vlan is associated.
418
419
420       vid VID
421              the VLAN ID that identifies the vlan.
422
423
424       pvid   the vlan specified is to be considered a PVID at ingress.  Any
425              untagged frames will be assigned to this VLAN.
426
427
428       untagged
429              the vlan specified is to be treated as untagged on egress.
430
431
432       self   the vlan is configured on the specified physical device.
433              Required if the device is the bridge device.
434
435
436       master the vlan is configured on the software bridge (default).
437
438
439   bridge vlan delete - delete a vlan filter entry
440       This command removes an existing vlan filter entry.
441
442
443       The arguments are the same as with bridge vlan add.  The pvid and
444       untagged flags are ignored.
445
446
447   bridge vlan show - list vlan configuration.
448       This command displays the current VLAN filter table.
449
450
451       With the -statistics option, the command displays per-vlan traffic sta‐
452       tistics.
453
454

bridge monitor - state monitoring

456       The bridge utility can monitor the state of devices and addresses con‐
457       tinuously. This option has a slightly different format.  Namely, the
458       monitor command is the first in the command line and then the object
459       list follows:
460
461       bridge monitor [ all | OBJECT-LIST ]
462
463       OBJECT-LIST is the list of object types that we want to monitor.  It
464       may contain link, fdb, and mdb.  If no file argument is given, bridge
465       opens RTNETLINK, listens on it and dumps state changes in the format
466       described in previous sections.
467
468
469       If a file name is given, it does not listen on RTNETLINK, but opens the
470       file containing RTNETLINK messages saved in binary format and dumps
471       them.
472
473

NOTES

475       This command uses facilities added in Linux 3.0.
476
477       Although the forwarding table is maintained on a per-bridge device
478       basis the bridge device is not part of the syntax. This is a limitation
479       of the underlying netlink neighbour message protocol. When displaying
480       the forwarding table, entries for all bridges are displayed.
481       Add/delete/modify commands determine the underlying bridge device based
482       on the bridge to which the corresponding ethernet device is attached.
483
484
485

SEE ALSO

487       ip(8)
488

BUGS

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

AUTHOR

494       Original Manpage by Stephen Hemminger
495
496
497
498iproute2                         1 August 2012                       BRIDGE(8)
Impressum