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 | -c[lor] | -p[retty] | -j[son] | -o[neline] }
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 } ] [
23               mcast_to_unicast { on | off } ] [ neigh_suppress { on | off } ]
24               [ vlan_tunnel { on | off } ] [ isolated { on | off } ] [
25               backup_port DEVICE ] [ nobackup_port ] [ self ] [ master ]
26
27       bridge link [ show ] [ dev DEV ]
28
29       bridge fdb { add | append | del | replace } LLADDR dev DEV { local |
30               static | dynamic } [ self ] [ master ] [ router ] [ use ] [
31               extern_learn ] [ sticky ] [ dst IPADDR ] [ src_vni VNI ] [ vni
32               VNI ] [ port PORT ] [ via DEVICE ]
33
34       bridge fdb [ show ] [ dev DEV ] [ br BRDEV ] [ brport DEV ] [ vlan VID
35               ] [ state STATE ]
36
37       bridge fdb get LLADDR  [ dev DEV ] [ br BRDEV ] [ vlan VID ] [ self ] [
38               master ]
39
40       bridge mdb { add | del } dev DEV port PORT grp GROUP [ permanent | temp
41               ] [ vid VID ]
42
43       bridge mdb show [ dev DEV ]
44
45       bridge vlan { add | del } dev DEV vid VID [ tunnel_info TUNNEL_ID ] [
46               pvid ] [ untagged ] [ self ] [ master ]
47
48       bridge vlan [ show | tunnelshow ] [ dev DEV ]
49
50       bridge monitor [ all | neigh | link | mdb ]
51
52

OPTIONS

54       -V, -Version
55              print the version of the bridge utility and exit.
56
57
58       -s, -stats, -statistics
59              output more information. If this option is given multiple times,
60              the amount of information increases.  As a rule, the information
61              is statistics or some time values.
62
63
64       -d, -details
65              print detailed information about MDB router ports.
66
67
68       -n, -net, -netns <NETNS>
69              switches bridge to the specified network namespace NETNS.  Actu‐
70              ally it just simplifies executing of:
71
72              ip netns exec NETNS bridge [ OPTIONS ] OBJECT { COMMAND | help }
73
74              to
75
76              bridge -n[etns] NETNS [ OPTIONS ] OBJECT { COMMAND | help }
77
78
79       -b, -batch <FILENAME>
80              Read commands from provided file or standard input and invoke
81              them.  First failure will cause termination of bridge command.
82
83
84       -force Don't terminate bridge command on errors in batch mode.  If
85              there were any errors during execution of the commands, the
86              application return code will be non zero.
87
88
89       -c[color][={always|auto|never}
90              Configure color output. If parameter is omitted or always, color
91              output is enabled regardless of stdout state. If parameter is
92              auto, stdout is checked to be a terminal before enabling color
93              output. If parameter is never, color output is disabled. If
94              specified multiple times, the last one takes precedence. This
95              flag is ignored if -json is also given.
96
97
98       -j, -json
99              Output results in JavaScript Object Notation (JSON).
100
101
102       -p, -pretty
103              When combined with -j generate a pretty JSON output.
104
105
106       -o, -oneline
107              output each record on a single line, replacing line feeds with
108              the '\' character. This is convenient when you want to count
109              records with wc(1) or to grep(1) the output.
110
111
112

BRIDGE - COMMAND SYNTAX

114   OBJECT
115       link   - Bridge port.
116
117
118       fdb    - Forwarding Database entry.
119
120
121       mdb    - Multicast group database entry.
122
123
124       vlan   - VLAN filter list.
125
126
127   COMMAND
128       Specifies the action to perform on the object.  The set of possible
129       actions depends on the object type.  As a rule, it is possible to add,
130       delete and show (or list ) objects, but some objects do not allow all
131       of these operations or have some additional commands. The help command
132       is available for all objects. It prints out a list of available com‐
133       mands and argument syntax conventions.
134
135       If no command is given, some default command is assumed.  Usually it is
136       list or, if the objects of this class cannot be listed, help.
137
138
140       link objects correspond to the port devices of the bridge.
141
142
143       The corresponding commands set and display port status and bridge spe‐
144       cific attributes.
145
146
147   bridge link set - set bridge specific attributes on a port
148       dev NAME
149              interface name of the bridge port
150
151
152       cost COST
153              the STP path cost of the specified port.
154
155
156       priority PRIO
157              the STP port priority. The priority value is an unsigned 8-bit
158              quantity (number between 0 and 255). This metric is used in the
159              designated port an droot port selectio algorithms.
160
161
162       state STATE
163              the operation state of the port. This is primarily used by user
164              space STP/RSTP implementation. One may enter a lowercased port
165              state name, or one of the numbers below. Negative inputs are
166              ignored, and unrecognized names return an error.
167
168              0 - port is DISABLED. Make this port completely inactive.
169
170
171              1 - STP LISTENING state. Only valid if STP is enabled on the
172              bridge. In this state the port listens for STP BPDUs and drops
173              all other traffic frames.
174
175
176              2 - STP LEARNING state. Only valid if STP is enabled on the
177              bridge. In this state the port will accept traffic only for the
178              purpose of updating MAC address tables.
179
180
181              3 - STP FORWARDING state. Port is fully active.
182
183
184              4 - STP BLOCKING state. Only valid if STP is enabled on the
185              bridge. This state is used during the STP election process. In
186              this state, port will only process STP BPDUs.
187
188
189
190       guard on or guard off
191              Controls whether STP BPDUs will be processed by the bridge port.
192              By default, the flag is turned off allowed BPDU processing.
193              Turning this flag on will cause the port to stop processing STP
194              BPDUs.
195
196
197       hairpin on or hairpin off
198              Controls whether traffic may be send back out of the port on
199              which it was received. By default, this flag is turned off and
200              the bridge will not forward traffic back out of the receiving
201              port.
202
203
204       fastleave on or fastleave off
205              This flag allows the bridge to immediately stop multicast traf‐
206              fic on a port that receives IGMP Leave message. It is only used
207              with IGMP snooping is enabled on the bridge. By default the flag
208              is off.
209
210
211       root_block on or root_block off
212              Controls whether a given port is allowed to become root port or
213              not. Only used when STP is enabled on the bridge. By default the
214              flag is off.
215
216
217       learning on or learning off
218              Controls whether a given port will learn MAC addresses from
219              received traffic or not. If learning if off, the bridge will end
220              up flooding any traffic for which it has no FDB entry. By
221              default this flag is on.
222
223
224       learning_sync on or learning_sync off
225              Controls whether a given port will sync MAC addresses learned on
226              device port to bridge FDB.
227
228
229       flood on or flood off
230              Controls whether a given port will flood unicast traffic for
231              which there is no FDB entry. By default this flag is on.
232
233
234       hwmode Some network interface cards support HW bridge functionality and
235              they may be configured in different modes. Currently support
236              modes are:
237
238              vepa - Data sent between HW ports is sent on the wire to the
239              external switch.
240
241              veb - bridging happens in hardware.
242
243
244       mcast_flood on or mcast_flood off
245              Controls whether a given port will flood multicast traffic for
246              which there is no MDB entry. By default this flag is on.
247
248
249       mcast_to_unicast on or mcast_to_unicast off
250              Controls whether a given port will replicate packets using uni‐
251              cast instead of multicast. By default this flag is off.
252
253
254       neigh_suppress on or neigh_suppress off
255              Controls whether neigh discovery (arp and nd) proxy and suppres‐
256              sion is enabled on the port. By default this flag is off.
257
258
259       vlan_tunnel on or vlan_tunnel off
260              Controls whether vlan to tunnel mapping is enabled on the port.
261              By default this flag is off.
262
263
264       isolated on or isolated off
265              Controls whether a given port will be isolated, which means it
266              will be able to communicate with non-isolated ports only.  By
267              default this flag is off.
268
269
270       backup_port DEVICE
271              If the port loses carrier all traffic will be redirected to the
272              configured backup port
273
274
275       nobackup_port
276              Removes the currently configured backup port
277
278
279       self   link setting is configured on specified physical device
280
281
282       master link setting is configured on the software bridge (default)
283
284
285       -t, -timestamp
286              display current time when using monitor option.
287
288
289   bridge link show - list bridge port configuration.
290       This command displays the current bridge port configuration and flags.
291
292

bridge fdb - forwarding database management

294       fdb objects contain known Ethernet addresses on a link.
295
296
297       The corresponding commands display fdb entries, add new entries, append
298       entries, and delete old ones.
299
300
301   bridge fdb add - add a new fdb entry
302       This command creates a new fdb entry.
303
304
305       LLADDR the Ethernet MAC address.
306
307
308       dev DEV
309              the interface to which this address is associated.
310
311              local - is a local permanent fdb entry
312
313
314              static - is a static (no arp) fdb entry
315
316
317              dynamic - is a dynamic reachable age-able fdb entry
318
319
320              self - the address is associated with the port drivers fdb. Usu‐
321              ally hardware.
322
323
324              master - the address is associated with master devices fdb. Usu‐
325              ally software (default).
326
327
328              router - the destination address is associated with a router.
329              Valid if the referenced device is a VXLAN type device and has
330              route shortcircuit enabled.
331
332
333              use - the address is in use. User space can use this option to
334              indicate to the kernel that the fdb entry is in use.
335
336
337              extern_learn - this entry was learned externally. This option
338              can be used to indicate to the kernel that an entry was hardware
339              or user-space controller learnt dynamic entry. Kernel will not
340              age such an entry.
341
342
343              sticky - this entry will not change its port due to learning.
344
345
346      The next command line parameters apply only when the specified device
347      DEV is of type VXLAN.
348
349       dst IPADDR
350              the IP address of the destination VXLAN tunnel endpoint where
351              the Ethernet MAC ADDRESS resides.
352
353
354       src_vni VNI
355              the src VNI Network Identifier (or VXLAN Segment ID) this entry
356              belongs to. Used only when the vxlan device is in external or
357              collect metadata mode. If omitted the value specified at vxlan
358              device creation will be used.
359
360
361       vni VNI
362              the VXLAN VNI Network Identifier (or VXLAN Segment ID) to use to
363              connect to the remote VXLAN tunnel endpoint.  If omitted the
364              value specified at vxlan device creation will be used.
365
366
367       port PORT
368              the UDP destination PORT number to use to connect to the remote
369              VXLAN tunnel endpoint.  If omitted the default value is used.
370
371
372       via DEVICE
373              device name of the outgoing interface for the VXLAN device
374              driver to reach the remote VXLAN tunnel endpoint.
375
376
377   bridge fdb append - append a forwarding database entry
378       This command adds a new fdb entry with an already known LLADDR.  Valid
379       only for multicast link layer addresses.  The command adds support for
380       broadcast and multicast Ethernet MAC addresses.  The Ethernet MAC
381       address is added multiple times into the forwarding database and the
382       vxlan device driver sends a copy of the data packet to each entry
383       found.
384
385
386       The arguments are the same as with bridge fdb add.
387
388
389   bridge fdb delete - delete a forwarding database entry
390       This command removes an existing fdb entry.
391
392
393       The arguments are the same as with bridge fdb add.
394
395
396   bridge fdb replace - replace a forwarding database entry
397       If no matching entry is found, a new one will be created instead.
398
399
400       The arguments are the same as with bridge fdb add.
401
402
403   bridge fdb show - list forwarding entries.
404       This command displays the current forwarding table.
405
406
407       With the -statistics option, the command becomes verbose. It prints out
408       the last updated and last used time for each entry.
409
410
411   bridge fdb get - get bridge forwarding entry.
412       lookup a bridge forwarding table entry.
413
414
415       LLADDR the Ethernet MAC address.
416
417
418       dev DEV
419              the interface to which this address is associated.
420
421
422       brport DEV
423              the bridge port to which this address is associated. same as dev
424              above.
425
426
427       br DEV the bridge to which this address is associated.
428
429
430       self   - the address is associated with the port drivers fdb. Usually
431              hardware.
432
433
434       master - the address is associated with master devices fdb. Usually
435              software (default).
436
437
438

bridge mdb - multicast group database management

440       mdb objects contain known IP multicast group addresses on a link.
441
442
443       The corresponding commands display mdb entries, add new entries, and
444       delete old ones.
445
446
447   bridge mdb add - add a new multicast group database entry
448       This command creates a new mdb entry.
449
450
451       dev DEV
452              the interface where this group address is associated.
453
454
455       port PORT
456              the port whose link is known to have members of this multicast
457              group.
458
459
460       grp GROUP
461              the IP multicast group address whose members reside on the link
462              connected to the port.
463
464              permanent - the mdb entry is permanent
465
466
467              temp - the mdb entry is temporary (default)
468
469
470
471       vid VID
472              the VLAN ID which is known to have members of this multicast
473              group.
474
475
476   bridge mdb delete - delete a multicast group database entry
477       This command removes an existing mdb entry.
478
479
480       The arguments are the same as with bridge mdb add.
481
482
483   bridge mdb show - list multicast group database entries
484       This command displays the current multicast group membership table. The
485       table is populated by IGMP and MLD snooping in the bridge driver auto‐
486       matically. It can be altered by bridge mdb add and bridge mdb del com‐
487       mands manually too.
488
489
490       dev DEV
491              the interface only whose entries should be listed. Default is to
492              list all bridge interfaces.
493
494
495       With the -details option, the command becomes verbose. It prints out
496       the ports known to have a connected router.
497
498
499       With the -statistics option, the command displays timer values for mdb
500       and router port entries.
501
502

bridge vlan - VLAN filter list

504       vlan objects contain known VLAN IDs for a link.
505
506
507       The corresponding commands display vlan filter entries, add new
508       entries, and delete old ones.
509
510
511   bridge vlan add - add a new vlan filter entry
512       This command creates a new vlan filter entry.
513
514
515       dev NAME
516              the interface with which this vlan is associated.
517
518
519       vid VID
520              the VLAN ID that identifies the vlan.
521
522
523       tunnel_info TUNNEL_ID
524              the TUNNEL ID that maps to this vlan. The tunnel id is set in
525              dst_metadata for every packet that belongs to this vlan (appli‐
526              cable to bridge ports with vlan_tunnel flag set).
527
528
529       pvid   the vlan specified is to be considered a PVID at ingress.  Any
530              untagged frames will be assigned to this VLAN.
531
532
533       untagged
534              the vlan specified is to be treated as untagged on egress.
535
536
537       self   the vlan is configured on the specified physical device.
538              Required if the device is the bridge device.
539
540
541       master the vlan is configured on the software bridge (default).
542
543
544   bridge vlan delete - delete a vlan filter entry
545       This command removes an existing vlan filter entry.
546
547
548       The arguments are the same as with bridge vlan add.  The pvid and
549       untagged flags are ignored.
550
551
552   bridge vlan show - list vlan configuration.
553       This command displays the current VLAN filter table.
554
555
556       With the -statistics option, the command displays per-vlan traffic sta‐
557       tistics.
558
559
560   bridge vlan tunnelshow - list vlan tunnel mapping.
561       This command displays the current vlan tunnel info mapping.
562
563

bridge monitor - state monitoring

565       The bridge utility can monitor the state of devices and addresses con‐
566       tinuously. This option has a slightly different format.  Namely, the
567       monitor command is the first in the command line and then the object
568       list follows:
569
570       bridge monitor [ all | OBJECT-LIST ]
571
572       OBJECT-LIST is the list of object types that we want to monitor.  It
573       may contain link, fdb, and mdb.  If no file argument is given, bridge
574       opens RTNETLINK, listens on it and dumps state changes in the format
575       described in previous sections.
576
577
578       If a file name is given, it does not listen on RTNETLINK, but opens the
579       file containing RTNETLINK messages saved in binary format and dumps
580       them.
581
582

NOTES

584       This command uses facilities added in Linux 3.0.
585
586       Although the forwarding table is maintained on a per-bridge device
587       basis the bridge device is not part of the syntax. This is a limitation
588       of the underlying netlink neighbour message protocol. When displaying
589       the forwarding table, entries for all bridges are displayed.
590       Add/delete/modify commands determine the underlying bridge device based
591       on the bridge to which the corresponding ethernet device is attached.
592
593
594

SEE ALSO

596       ip(8)
597

BUGS

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

AUTHOR

603       Original Manpage by Stephen Hemminger
604
605
606
607iproute2                         1 August 2012                       BRIDGE(8)
Impressum