1BRIDGE(8) Linux BRIDGE(8)
2
3
4
6 bridge - show / manipulate bridge addresses and devices
7
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 ] [ src_vni VNI ] { [ dst IPADDR ] [
32 vni VNI ] [ port PORT ] [ via DEVICE ] | nhid NHID }
33
34 bridge fdb [ [ show ] [ br BRDEV ] [ brport DEV ] [ vlan VID ] [ state
35 STATE ] [ dynamic ] ]
36
37 bridge fdb get [ to ] LLADDR [ br BRDEV ] { brport | dev } DEV [ vlan
38 VID ] [ vni VNI ] [ self ] [ master ] [ dynamic ]
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
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
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 selection algorithms.
160
161
162 state STATE
163 the operation state of the port. Except state 0 (disable STP or
164 BPDU filter feature), this is primarily used by user space
165 STP/RSTP implementation. One may enter port state name (case
166 insensitive), or one of the numbers below. Negative inputs are
167 ignored, and unrecognized names return an error.
168
169 0 - port is in STP DISABLED state. Make this port completely
170 inactive for STP. This is also called BPDU filter and could be
171 used to disable STP on an untrusted port, like a leaf virtual
172 devices.
173
174
175 1 - port is in STP LISTENING state. Only valid if STP is enabled
176 on the bridge. In this state the port listens for STP BPDUs and
177 drops all other traffic frames.
178
179
180 2 - port is in STP LEARNING state. Only valid if STP is enabled
181 on the bridge. In this state the port will accept traffic only
182 for the purpose of updating MAC address tables.
183
184
185 3 - port is in STP FORWARDING state. Port is fully active.
186
187
188 4 - port is in STP BLOCKING state. Only valid if STP is enabled
189 on the bridge. This state is used during the STP election
190 process. In this state, port will only process STP BPDUs.
191
192
193
194 guard on or guard off
195 Controls whether STP BPDUs will be processed by the bridge port.
196 By default, the flag is turned off allowed BPDU processing.
197 Turning this flag on will disables the bridge port if a STP BPDU
198 packet is received.
199
200 If running Spanning Tree on bridge, hostile devices on the net‐
201 work may send BPDU on a port and cause network failure. Setting
202 guard on will detect and stop this by disabling the port. The
203 port will be restarted if link is brought down, or removed and
204 reattached. For example if guard is enable on eth0:
205
206 ip link set dev eth0 down; ip link set dev eth0 up
207
208
209 hairpin on or hairpin off
210 Controls whether traffic may be send back out of the port on
211 which it was received. This option is also called reflective
212 relay mode, and is used to support basic VEPA (Virtual Ethernet
213 Port Aggregator) capabilities. By default, this flag is turned
214 off and the bridge will not forward traffic back out of the
215 receiving port.
216
217
218 fastleave on or fastleave off
219 This flag allows the bridge to immediately stop multicast traf‐
220 fic on a port that receives IGMP Leave message. It is only used
221 with IGMP snooping is enabled on the bridge. By default the flag
222 is off.
223
224
225 root_block on or root_block off
226 Controls whether a given port is allowed to become root port or
227 not. Only used when STP is enabled on the bridge. By default the
228 flag is off.
229
230 This feature is also called root port guard. If BPDU is
231 received from a leaf (edge) port, it should not be elected as
232 root port. This could be used if using STP on a bridge and the
233 downstream bridges are not fully trusted; this prevents a hos‐
234 tile guest from rerouting traffic.
235
236
237 learning on or learning off
238 Controls whether a given port will learn MAC addresses from
239 received traffic or not. If learning if off, the bridge will end
240 up flooding any traffic for which it has no FDB entry. By
241 default this flag is on.
242
243
244 learning_sync on or learning_sync off
245 Controls whether a given port will sync MAC addresses learned on
246 device port to bridge FDB.
247
248
249 flood on or flood off
250 Controls whether a given port will flood unicast traffic for
251 which there is no FDB entry. By default this flag is on.
252
253
254 hwmode Some network interface cards support HW bridge functionality and
255 they may be configured in different modes. Currently support
256 modes are:
257
258 vepa - Data sent between HW ports is sent on the wire to the
259 external switch.
260
261 veb - bridging happens in hardware.
262
263
264 mcast_flood on or mcast_flood off
265 Controls whether a given port will flood multicast traffic for
266 which there is no MDB entry. By default this flag is on.
267
268
269 mcast_to_unicast on or mcast_to_unicast off
270 Controls whether a given port will replicate packets using uni‐
271 cast instead of multicast. By default this flag is off.
272
273 This is done by copying the packet per host and changing the
274 multicast destination MAC to a unicast one accordingly.
275
276 mcast_to_unicast works on top of the multicast snooping feature
277 of the bridge. Which means unicast copies are only delivered to
278 hosts which are interested in it and signalized this via
279 IGMP/MLD reports previously.
280
281 This feature is intended for interface types which have a more
282 reliable and/or efficient way to deliver unicast packets than
283 broadcast ones (e.g. WiFi).
284
285 However, it should only be enabled on interfaces where no
286 IGMPv2/MLDv1 report suppression takes place. IGMP/MLD report
287 suppression issue is usually overcome by the network daemon
288 (supplicant) enabling AP isolation and by that separating all
289 STAs.
290
291 Delivery of STA-to-STA IP multicast is made possible again by
292 enabling and utilizing the bridge hairpin mode, which considers
293 the incoming port as a potential outgoing port, too (see hairpin
294 option). Hairpin mode is performed after multicast snooping,
295 therefore leading to only deliver reports to STAs running a mul‐
296 ticast router.
297
298
299 neigh_suppress on or neigh_suppress off
300 Controls whether neigh discovery (arp and nd) proxy and suppres‐
301 sion is enabled on the port. By default this flag is off.
302
303
304 vlan_tunnel on or vlan_tunnel off
305 Controls whether vlan to tunnel mapping is enabled on the port.
306 By default this flag is off.
307
308
309 isolated on or isolated off
310 Controls whether a given port will be isolated, which means it
311 will be able to communicate with non-isolated ports only. By
312 default this flag is off.
313
314
315 backup_port DEVICE
316 If the port loses carrier all traffic will be redirected to the
317 configured backup port
318
319
320 nobackup_port
321 Removes the currently configured backup port
322
323
324 self link setting is configured on specified physical device
325
326
327 master link setting is configured on the software bridge (default)
328
329
330 -t, -timestamp
331 display current time when using monitor option.
332
333
334 bridge link show - list ports configuration for all bridges.
335 This command displays port configuration and flags for all bridges.
336
337 To display port configuration and flags for a specific bridge, use the
338 "ip link show master <bridge_device>" command.
339
340
342 fdb objects contain known Ethernet addresses on a link.
343
344
345 The corresponding commands display fdb entries, add new entries, append
346 entries, and delete old ones.
347
348
349 bridge fdb add - add a new fdb entry
350 This command creates a new fdb entry.
351
352
353 LLADDR the Ethernet MAC address.
354
355
356 dev DEV
357 the interface to which this address is associated.
358
359 local - is a local permanent fdb entry
360
361
362 static - is a static (no arp) fdb entry
363
364
365 dynamic - is a dynamic reachable age-able fdb entry
366
367
368 self - the address is associated with the port drivers fdb. Usu‐
369 ally hardware.
370
371
372 master - the address is associated with master devices fdb. Usu‐
373 ally software (default).
374
375
376 router - the destination address is associated with a router.
377 Valid if the referenced device is a VXLAN type device and has
378 route short circuit enabled.
379
380
381 use - the address is in use. User space can use this option to
382 indicate to the kernel that the fdb entry is in use.
383
384
385 extern_learn - this entry was learned externally. This option
386 can be used to indicate to the kernel that an entry was hardware
387 or user-space controller learnt dynamic entry. Kernel will not
388 age such an entry.
389
390
391 sticky - this entry will not change its port due to learning.
392
393
394 The next command line parameters apply only when the specified device
395 DEV is of type VXLAN.
396
397 dst IPADDR
398 the IP address of the destination VXLAN tunnel endpoint where
399 the Ethernet MAC ADDRESS resides.
400
401
402 src_vni VNI
403 the src VNI Network Identifier (or VXLAN Segment ID) this entry
404 belongs to. Used only when the vxlan device is in external or
405 collect metadata mode. If omitted the value specified at vxlan
406 device creation will be used.
407
408
409 vni VNI
410 the VXLAN VNI Network Identifier (or VXLAN Segment ID) to use to
411 connect to the remote VXLAN tunnel endpoint. If omitted the
412 value specified at vxlan device creation will be used.
413
414
415 port PORT
416 the UDP destination PORT number to use to connect to the remote
417 VXLAN tunnel endpoint. If omitted the default value is used.
418
419
420 via DEVICE
421 device name of the outgoing interface for the VXLAN device
422 driver to reach the remote VXLAN tunnel endpoint.
423
424
425 nhid NHID
426 ecmp nexthop group for the VXLAN device driver to reach remote
427 VXLAN tunnel endpoints.
428
429
430 bridge fdb append - append a forwarding database entry
431 This command adds a new fdb entry with an already known LLADDR. Valid
432 only for multicast link layer addresses. The command adds support for
433 broadcast and multicast Ethernet MAC addresses. The Ethernet MAC
434 address is added multiple times into the forwarding database and the
435 vxlan device driver sends a copy of the data packet to each entry
436 found.
437
438
439 The arguments are the same as with bridge fdb add.
440
441
442 bridge fdb delete - delete a forwarding database entry
443 This command removes an existing fdb entry.
444
445
446 The arguments are the same as with bridge fdb add.
447
448
449 bridge fdb replace - replace a forwarding database entry
450 If no matching entry is found, a new one will be created instead.
451
452
453 The arguments are the same as with bridge fdb add.
454
455
456 bridge fdb show - list forwarding entries.
457 This command displays the current forwarding table.
458
459
460 With the -statistics option, the command becomes verbose. It prints out
461 the last updated and last used time for each entry.
462
463
464 bridge fdb get - get bridge forwarding entry.
465 lookup a bridge forwarding table entry.
466
467
468 LLADDR the Ethernet MAC address.
469
470
471 dev DEV
472 the interface to which this address is associated.
473
474
475 brport DEV
476 the bridge port to which this address is associated. same as dev
477 above.
478
479
480 br DEV the bridge to which this address is associated.
481
482
483 self - the address is associated with the port drivers fdb. Usually
484 hardware.
485
486
487 master - the address is associated with master devices fdb. Usually
488 software (default).
489
490
491
493 mdb objects contain known IP multicast group addresses on a link.
494
495
496 The corresponding commands display mdb entries, add new entries, and
497 delete old ones.
498
499
500 bridge mdb add - add a new multicast group database entry
501 This command creates a new mdb entry.
502
503
504 dev DEV
505 the interface where this group address is associated.
506
507
508 port PORT
509 the port whose link is known to have members of this multicast
510 group.
511
512
513 grp GROUP
514 the IP multicast group address whose members reside on the link
515 connected to the port.
516
517 permanent - the mdb entry is permanent
518
519
520 temp - the mdb entry is temporary (default)
521
522
523
524 vid VID
525 the VLAN ID which is known to have members of this multicast
526 group.
527
528
529 bridge mdb delete - delete a multicast group database entry
530 This command removes an existing mdb entry.
531
532
533 The arguments are the same as with bridge mdb add.
534
535
536 bridge mdb show - list multicast group database entries
537 This command displays the current multicast group membership table. The
538 table is populated by IGMP and MLD snooping in the bridge driver auto‐
539 matically. It can be altered by bridge mdb add and bridge mdb del com‐
540 mands manually too.
541
542
543 dev DEV
544 the interface only whose entries should be listed. Default is to
545 list all bridge interfaces.
546
547
548 With the -details option, the command becomes verbose. It prints out
549 the ports known to have a connected router.
550
551
552 With the -statistics option, the command displays timer values for mdb
553 and router port entries.
554
555
557 vlan objects contain known VLAN IDs for a link.
558
559
560 The corresponding commands display vlan filter entries, add new
561 entries, and delete old ones.
562
563
564 bridge vlan add - add a new vlan filter entry
565 This command creates a new vlan filter entry.
566
567
568 dev NAME
569 the interface with which this vlan is associated.
570
571
572 vid VID
573 the VLAN ID that identifies the vlan.
574
575
576 tunnel_info TUNNEL_ID
577 the TUNNEL ID that maps to this vlan. The tunnel id is set in
578 dst_metadata for every packet that belongs to this vlan (appli‐
579 cable to bridge ports with vlan_tunnel flag set).
580
581
582 pvid the vlan specified is to be considered a PVID at ingress. Any
583 untagged frames will be assigned to this VLAN.
584
585
586 untagged
587 the vlan specified is to be treated as untagged on egress.
588
589
590 self the vlan is configured on the specified physical device.
591 Required if the device is the bridge device.
592
593
594 master the vlan is configured on the software bridge (default).
595
596
597 bridge vlan delete - delete a vlan filter entry
598 This command removes an existing vlan filter entry.
599
600
601 The arguments are the same as with bridge vlan add. The pvid and
602 untagged flags are ignored.
603
604
605 bridge vlan show - list vlan configuration.
606 This command displays the current VLAN filter table.
607
608
609 With the -statistics option, the command displays per-vlan traffic sta‐
610 tistics.
611
612
613 bridge vlan tunnelshow - list vlan tunnel mapping.
614 This command displays the current vlan tunnel info mapping.
615
616
618 The bridge utility can monitor the state of devices and addresses con‐
619 tinuously. This option has a slightly different format. Namely, the
620 monitor command is the first in the command line and then the object
621 list follows:
622
623 bridge monitor [ all | OBJECT-LIST ]
624
625 OBJECT-LIST is the list of object types that we want to monitor. It
626 may contain link, fdb, and mdb. If no file argument is given, bridge
627 opens RTNETLINK, listens on it and dumps state changes in the format
628 described in previous sections.
629
630
631 If a file name is given, it does not listen on RTNETLINK, but opens the
632 file containing RTNETLINK messages saved in binary format and dumps
633 them.
634
635
637 This command uses facilities added in Linux 3.0.
638
639 Although the forwarding table is maintained on a per-bridge device
640 basis the bridge device is not part of the syntax. This is a limitation
641 of the underlying netlink neighbour message protocol. When displaying
642 the forwarding table, entries for all bridges are displayed.
643 Add/delete/modify commands determine the underlying bridge device based
644 on the bridge to which the corresponding ethernet device is attached.
645
646
647
649 ip(8)
650
652 Please direct bugreports and patches to: <netdev@vger.kernel.org>
653
654
656 Original Manpage by Stephen Hemminger
657
658
659
660iproute2 1 August 2012 BRIDGE(8)