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 neigh_suppress { on | off } ] [ vlan_tunnel { on | off } ] [
24 isolated { on | off } ] [ backup_port DEVICE ] [ nobackup_port
25 ] [ 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 ] [ vni VNI ] [ port
32 PORT ] [ via DEVICE ]
33
34 bridge fdb [ show ] [ dev DEV ] [ br BRDEV ] [ brport DEV ] [ vlan VID
35 ] [ state STATE ]
36
37 bridge mdb { add | del } dev DEV port PORT grp GROUP [ permanent | temp
38 ] [ vid VID ]
39
40 bridge mdb show [ dev DEV ]
41
42 bridge vlan { add | del } dev DEV vid VID [ tunnel_info TUNNEL_ID ] [
43 pvid ] [ untagged ] [ self ] [ master ]
44
45 bridge vlan [ show | tunnelshow ] [ dev DEV ]
46
47 bridge monitor [ all | neigh | link | mdb ]
48
49
51 -V, -Version
52 print the version of the bridge utility and exit.
53
54
55 -s, -stats, -statistics
56 output more information. If this option is given multiple times,
57 the amount of information increases. As a rule, the information
58 is statistics or some time values.
59
60
61 -d, -details
62 print detailed information about MDB router ports.
63
64
65 -n, -net, -netns <NETNS>
66 switches bridge to the specified network namespace NETNS. Actu‐
67 ally it just simplifies executing of:
68
69 ip netns exec NETNS bridge [ OPTIONS ] OBJECT { COMMAND | help }
70
71 to
72
73 bridge -n[etns] NETNS [ OPTIONS ] OBJECT { COMMAND | help }
74
75
76 -b, -batch <FILENAME>
77 Read commands from provided file or standard input and invoke
78 them. First failure will cause termination of bridge command.
79
80
81 -force Don't terminate bridge command on errors in batch mode. If
82 there were any errors during execution of the commands, the
83 application return code will be non zero.
84
85
86 -c[color][={always|auto|never}
87 Configure color output. If parameter is omitted or always, color
88 output is enabled regardless of stdout state. If parameter is
89 auto, stdout is checked to be a terminal before enabling color
90 output. If parameter is never, color output is disabled. If
91 specified multiple times, the last one takes precedence. This
92 flag is ignored if -json is also given.
93
94
95 -j, -json
96 Output results in JavaScript Object Notation (JSON).
97
98
99 -p, -pretty
100 When combined with -j generate a pretty JSON output.
101
102
103 -o, -oneline
104 output each record on a single line, replacing line feeds with
105 the '\' character. This is convenient when you want to count
106 records with wc(1) or to grep(1) the output.
107
108
109
111 OBJECT
112 link - Bridge port.
113
114
115 fdb - Forwarding Database entry.
116
117
118 mdb - Multicast group database entry.
119
120
121 vlan - VLAN filter list.
122
123
124 COMMAND
125 Specifies the action to perform on the object. The set of possible
126 actions depends on the object type. As a rule, it is possible to add,
127 delete and show (or list ) objects, but some objects do not allow all
128 of these operations or have some additional commands. The help command
129 is available for all objects. It prints out a list of available com‐
130 mands and argument syntax conventions.
131
132 If no command is given, some default command is assumed. Usually it is
133 list or, if the objects of this class cannot be listed, help.
134
135
137 link objects correspond to the port devices of the bridge.
138
139
140 The corresponding commands set and display port status and bridge spe‐
141 cific attributes.
142
143
144 bridge link set - set bridge specific attributes on a port
145 dev NAME
146 interface name of the bridge port
147
148
149 cost COST
150 the STP path cost of the specified port.
151
152
153 priority PRIO
154 the STP port priority. The priority value is an unsigned 8-bit
155 quantity (number between 0 and 255). This metric is used in the
156 designated port an droot port selectio algorithms.
157
158
159 state STATE
160 the operation state of the port. This is primarily used by user
161 space STP/RSTP implementation. One may enter a lowercased port
162 state name, or one of the numbers below. Negative inputs are
163 ignored, and unrecognized names return an error.
164
165 0 - port is DISABLED. Make this port completely inactive.
166
167
168 1 - STP LISTENING state. Only valid if STP is enabled on the
169 bridge. In this state the port listens for STP BPDUs and drops
170 all other traffic frames.
171
172
173 2 - STP LEARNING state. Only valid if STP is enabled on the
174 bridge. In this state the port will accept traffic only for the
175 purpose of updating MAC address tables.
176
177
178 3 - STP FORWARDING state. Port is fully active.
179
180
181 4 - STP BLOCKING state. Only valid if STP is enabled on the
182 bridge. This state is used during the STP election process. In
183 this state, port will only process STP BPDUs.
184
185
186
187 guard on or guard off
188 Controls whether STP BPDUs will be processed by the bridge port.
189 By default, the flag is turned off allowed BPDU processing.
190 Turning this flag on will cause the port to stop processing STP
191 BPDUs.
192
193
194 hairpin on or hairpin off
195 Controls whether traffic may be send back out of the port on
196 which it was received. By default, this flag is turned off and
197 the bridge will not forward traffic back out of the receiving
198 port.
199
200
201 fastleave on or fastleave off
202 This flag allows the bridge to immediately stop multicast traf‐
203 fic on a port that receives IGMP Leave message. It is only used
204 with IGMP snooping is enabled on the bridge. By default the flag
205 is off.
206
207
208 root_block on or root_block off
209 Controls whether a given port is allowed to become root port or
210 not. Only used when STP is enabled on the bridge. By default the
211 flag is off.
212
213
214 learning on or learning off
215 Controls whether a given port will learn MAC addresses from
216 received traffic or not. If learning if off, the bridge will end
217 up flooding any traffic for which it has no FDB entry. By
218 default this flag is on.
219
220
221 learning_sync on or learning_sync off
222 Controls whether a given port will sync MAC addresses learned on
223 device port to bridge FDB.
224
225
226 flooding on or flooding off
227 Controls whether a given port will flood unicast traffic for
228 which there is no FDB entry. By default this flag is on.
229
230
231 hwmode Some network interface cards support HW bridge functionality and
232 they may be configured in different modes. Currently support
233 modes are:
234
235 vepa - Data sent between HW ports is sent on the wire to the
236 external switch.
237
238 veb - bridging happens in hardware.
239
240
241 mcast_flood on or mcast_flood off
242 Controls whether a given port will be flooded with multicast
243 traffic for which there is no MDB entry. By default this flag is
244 on.
245
246
247 neigh_suppress on or neigh_suppress off
248 Controls whether neigh discovery (arp and nd) proxy and suppres‐
249 sion is enabled on the port. By default this flag is off.
250
251
252 vlan_tunnel on or vlan_tunnel off
253 Controls whether vlan to tunnel mapping is enabled on the port.
254 By default this flag is off.
255
256
257 isolated on or isolated off
258 Controls whether a given port will be isolated, which means it
259 will be able to communicate with non-isolated ports only. By
260 default this flag is off.
261
262
263 backup_port DEVICE
264 If the port loses carrier all traffic will be redirected to the
265 configured backup port
266
267
268 nobackup_port
269 Removes the currently configured backup port
270
271
272 self link setting is configured on specified physical device
273
274
275 master link setting is configured on the software bridge (default)
276
277
278 -t, -timestamp
279 display current time when using monitor option.
280
281
282 bridge link show - list bridge port configuration.
283 This command displays the current bridge port configuration and flags.
284
285
287 fdb objects contain known Ethernet addresses on a link.
288
289
290 The corresponding commands display fdb entries, add new entries, append
291 entries, and delete old ones.
292
293
294 bridge fdb add - add a new fdb entry
295 This command creates a new fdb entry.
296
297
298 LLADDR the Ethernet MAC address.
299
300
301 dev DEV
302 the interface to which this address is associated.
303
304 local - is a local permanent fdb entry
305
306
307 static - is a static (no arp) fdb entry
308
309
310 dynamic - is a dynamic reachable age-able fdb entry
311
312
313 self - the address is associated with the port drivers fdb. Usu‐
314 ally hardware.
315
316
317 master - the address is associated with master devices fdb. Usu‐
318 ally software (default).
319
320
321 router - the destination address is associated with a router.
322 Valid if the referenced device is a VXLAN type device and has
323 route shortcircuit enabled.
324
325
326 use - the address is in use. User space can use this option to
327 indicate to the kernel that the fdb entry is in use.
328
329
330 extern_learn - this entry was learned externally. This option
331 can be used to indicate to the kernel that an entry was hardware
332 or user-space controller learnt dynamic entry. Kernel will not
333 age such an entry.
334
335
336 sticky - this entry will not change its port due to learning.
337
338
339 The next command line parameters apply only when the specified device
340 DEV is of type VXLAN.
341
342 dst IPADDR
343 the IP address of the destination VXLAN tunnel endpoint where
344 the Ethernet MAC ADDRESS resides.
345
346
347 vni VNI
348 the VXLAN VNI Network Identifier (or VXLAN Segment ID) to use to
349 connect to the remote VXLAN tunnel endpoint. If omitted the
350 value specified at vxlan device creation will be used.
351
352
353 port PORT
354 the UDP destination PORT number to use to connect to the remote
355 VXLAN tunnel endpoint. If omitted the default value is used.
356
357
358 via DEVICE
359 device name of the outgoing interface for the VXLAN device
360 driver to reach the remote VXLAN tunnel endpoint.
361
362
363 bridge fdb append - append a forwarding database entry
364 This command adds a new fdb entry with an already known LLADDR. Valid
365 only for multicast link layer addresses. The command adds support for
366 broadcast and multicast Ethernet MAC addresses. The Ethernet MAC
367 address is added multiple times into the forwarding database and the
368 vxlan device driver sends a copy of the data packet to each entry
369 found.
370
371
372 The arguments are the same as with bridge fdb add.
373
374
375 bridge fdb delete - delete a forwarding database entry
376 This command removes an existing fdb entry.
377
378
379 The arguments are the same as with bridge fdb add.
380
381
382 bridge fdb replace - replace a forwarding database entry
383 If no matching entry is found, a new one will be created instead.
384
385
386 The arguments are the same as with bridge fdb add.
387
388
389 bridge fdb show - list forwarding entries.
390 This command displays the current forwarding table.
391
392
393 With the -statistics option, the command becomes verbose. It prints out
394 the last updated and last used time for each entry.
395
396
398 mdb objects contain known IP multicast group addresses on a link.
399
400
401 The corresponding commands display mdb entries, add new entries, and
402 delete old ones.
403
404
405 bridge mdb add - add a new multicast group database entry
406 This command creates a new mdb entry.
407
408
409 dev DEV
410 the interface where this group address is associated.
411
412
413 port PORT
414 the port whose link is known to have members of this multicast
415 group.
416
417
418 grp GROUP
419 the IP multicast group address whose members reside on the link
420 connected to the port.
421
422 permanent - the mdb entry is permanent
423
424
425 temp - the mdb entry is temporary (default)
426
427
428
429 vid VID
430 the VLAN ID which is known to have members of this multicast
431 group.
432
433
434 bridge mdb delete - delete a multicast group database entry
435 This command removes an existing mdb entry.
436
437
438 The arguments are the same as with bridge mdb add.
439
440
441 bridge mdb show - list multicast group database entries
442 This command displays the current multicast group membership table. The
443 table is populated by IGMP and MLD snooping in the bridge driver auto‐
444 matically. It can be altered by bridge mdb add and bridge mdb del com‐
445 mands manually too.
446
447
448 dev DEV
449 the interface only whose entries should be listed. Default is to
450 list all bridge interfaces.
451
452
453 With the -details option, the command becomes verbose. It prints out
454 the ports known to have a connected router.
455
456
457 With the -statistics option, the command displays timer values for mdb
458 and router port entries.
459
460
462 vlan objects contain known VLAN IDs for a link.
463
464
465 The corresponding commands display vlan filter entries, add new
466 entries, and delete old ones.
467
468
469 bridge vlan add - add a new vlan filter entry
470 This command creates a new vlan filter entry.
471
472
473 dev NAME
474 the interface with which this vlan is associated.
475
476
477 vid VID
478 the VLAN ID that identifies the vlan.
479
480
481 tunnel_info TUNNEL_ID
482 the TUNNEL ID that maps to this vlan. The tunnel id is set in
483 dst_metadata for every packet that belongs to this vlan (appli‐
484 cable to bridge ports with vlan_tunnel flag set).
485
486
487 pvid the vlan specified is to be considered a PVID at ingress. Any
488 untagged frames will be assigned to this VLAN.
489
490
491 untagged
492 the vlan specified is to be treated as untagged on egress.
493
494
495 self the vlan is configured on the specified physical device.
496 Required if the device is the bridge device.
497
498
499 master the vlan is configured on the software bridge (default).
500
501
502 bridge vlan delete - delete a vlan filter entry
503 This command removes an existing vlan filter entry.
504
505
506 The arguments are the same as with bridge vlan add. The pvid and
507 untagged flags are ignored.
508
509
510 bridge vlan show - list vlan configuration.
511 This command displays the current VLAN filter table.
512
513
514 With the -statistics option, the command displays per-vlan traffic sta‐
515 tistics.
516
517
518 bridge vlan tunnelshow - list vlan tunnel mapping.
519 This command displays the current vlan tunnel info mapping.
520
521
523 The bridge utility can monitor the state of devices and addresses con‐
524 tinuously. This option has a slightly different format. Namely, the
525 monitor command is the first in the command line and then the object
526 list follows:
527
528 bridge monitor [ all | OBJECT-LIST ]
529
530 OBJECT-LIST is the list of object types that we want to monitor. It
531 may contain link, fdb, and mdb. If no file argument is given, bridge
532 opens RTNETLINK, listens on it and dumps state changes in the format
533 described in previous sections.
534
535
536 If a file name is given, it does not listen on RTNETLINK, but opens the
537 file containing RTNETLINK messages saved in binary format and dumps
538 them.
539
540
542 This command uses facilities added in Linux 3.0.
543
544 Although the forwarding table is maintained on a per-bridge device
545 basis the bridge device is not part of the syntax. This is a limitation
546 of the underlying netlink neighbour message protocol. When displaying
547 the forwarding table, entries for all bridges are displayed.
548 Add/delete/modify commands determine the underlying bridge device based
549 on the bridge to which the corresponding ethernet device is attached.
550
551
552
554 ip(8)
555
557 Please direct bugreports and patches to: <netdev@vger.kernel.org>
558
559
561 Original Manpage by Stephen Hemminger
562
563
564
565iproute2 1 August 2012 BRIDGE(8)