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 flood on or flood 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 flood multicast traffic for
243 which there is no MDB entry. By default this flag is on.
244
245
246 neigh_suppress on or neigh_suppress off
247 Controls whether neigh discovery (arp and nd) proxy and suppres‐
248 sion is enabled on the port. By default this flag is off.
249
250
251 vlan_tunnel on or vlan_tunnel off
252 Controls whether vlan to tunnel mapping is enabled on the port.
253 By default this flag is off.
254
255
256 isolated on or isolated off
257 Controls whether a given port will be isolated, which means it
258 will be able to communicate with non-isolated ports only. By
259 default this flag is off.
260
261
262 backup_port DEVICE
263 If the port loses carrier all traffic will be redirected to the
264 configured backup port
265
266
267 nobackup_port
268 Removes the currently configured backup port
269
270
271 self link setting is configured on specified physical device
272
273
274 master link setting is configured on the software bridge (default)
275
276
277 -t, -timestamp
278 display current time when using monitor option.
279
280
281 bridge link show - list bridge port configuration.
282 This command displays the current bridge port configuration and flags.
283
284
286 fdb objects contain known Ethernet addresses on a link.
287
288
289 The corresponding commands display fdb entries, add new entries, append
290 entries, and delete old ones.
291
292
293 bridge fdb add - add a new fdb entry
294 This command creates a new fdb entry.
295
296
297 LLADDR the Ethernet MAC address.
298
299
300 dev DEV
301 the interface to which this address is associated.
302
303 local - is a local permanent fdb entry
304
305
306 static - is a static (no arp) fdb entry
307
308
309 dynamic - is a dynamic reachable age-able fdb entry
310
311
312 self - the address is associated with the port drivers fdb. Usu‐
313 ally hardware.
314
315
316 master - the address is associated with master devices fdb. Usu‐
317 ally software (default).
318
319
320 router - the destination address is associated with a router.
321 Valid if the referenced device is a VXLAN type device and has
322 route shortcircuit enabled.
323
324
325 use - the address is in use. User space can use this option to
326 indicate to the kernel that the fdb entry is in use.
327
328
329 extern_learn - this entry was learned externally. This option
330 can be used to indicate to the kernel that an entry was hardware
331 or user-space controller learnt dynamic entry. Kernel will not
332 age such an entry.
333
334
335 sticky - this entry will not change its port due to learning.
336
337
338 The next command line parameters apply only when the specified device
339 DEV is of type VXLAN.
340
341 dst IPADDR
342 the IP address of the destination VXLAN tunnel endpoint where
343 the Ethernet MAC ADDRESS resides.
344
345
346 vni VNI
347 the VXLAN VNI Network Identifier (or VXLAN Segment ID) to use to
348 connect to the remote VXLAN tunnel endpoint. If omitted the
349 value specified at vxlan device creation will be used.
350
351
352 port PORT
353 the UDP destination PORT number to use to connect to the remote
354 VXLAN tunnel endpoint. If omitted the default value is used.
355
356
357 via DEVICE
358 device name of the outgoing interface for the VXLAN device
359 driver to reach the remote VXLAN tunnel endpoint.
360
361
362 bridge fdb append - append a forwarding database entry
363 This command adds a new fdb entry with an already known LLADDR. Valid
364 only for multicast link layer addresses. The command adds support for
365 broadcast and multicast Ethernet MAC addresses. The Ethernet MAC
366 address is added multiple times into the forwarding database and the
367 vxlan device driver sends a copy of the data packet to each entry
368 found.
369
370
371 The arguments are the same as with bridge fdb add.
372
373
374 bridge fdb delete - delete a forwarding database entry
375 This command removes an existing fdb entry.
376
377
378 The arguments are the same as with bridge fdb add.
379
380
381 bridge fdb replace - replace a forwarding database entry
382 If no matching entry is found, a new one will be created instead.
383
384
385 The arguments are the same as with bridge fdb add.
386
387
388 bridge fdb show - list forwarding entries.
389 This command displays the current forwarding table.
390
391
392 With the -statistics option, the command becomes verbose. It prints out
393 the last updated and last used time for each entry.
394
395
397 mdb objects contain known IP multicast group addresses on a link.
398
399
400 The corresponding commands display mdb entries, add new entries, and
401 delete old ones.
402
403
404 bridge mdb add - add a new multicast group database entry
405 This command creates a new mdb entry.
406
407
408 dev DEV
409 the interface where this group address is associated.
410
411
412 port PORT
413 the port whose link is known to have members of this multicast
414 group.
415
416
417 grp GROUP
418 the IP multicast group address whose members reside on the link
419 connected to the port.
420
421 permanent - the mdb entry is permanent
422
423
424 temp - the mdb entry is temporary (default)
425
426
427
428 vid VID
429 the VLAN ID which is known to have members of this multicast
430 group.
431
432
433 bridge mdb delete - delete a multicast group database entry
434 This command removes an existing mdb entry.
435
436
437 The arguments are the same as with bridge mdb add.
438
439
440 bridge mdb show - list multicast group database entries
441 This command displays the current multicast group membership table. The
442 table is populated by IGMP and MLD snooping in the bridge driver auto‐
443 matically. It can be altered by bridge mdb add and bridge mdb del com‐
444 mands manually too.
445
446
447 dev DEV
448 the interface only whose entries should be listed. Default is to
449 list all bridge interfaces.
450
451
452 With the -details option, the command becomes verbose. It prints out
453 the ports known to have a connected router.
454
455
456 With the -statistics option, the command displays timer values for mdb
457 and router port entries.
458
459
461 vlan objects contain known VLAN IDs for a link.
462
463
464 The corresponding commands display vlan filter entries, add new
465 entries, and delete old ones.
466
467
468 bridge vlan add - add a new vlan filter entry
469 This command creates a new vlan filter entry.
470
471
472 dev NAME
473 the interface with which this vlan is associated.
474
475
476 vid VID
477 the VLAN ID that identifies the vlan.
478
479
480 tunnel_info TUNNEL_ID
481 the TUNNEL ID that maps to this vlan. The tunnel id is set in
482 dst_metadata for every packet that belongs to this vlan (appli‐
483 cable to bridge ports with vlan_tunnel flag set).
484
485
486 pvid the vlan specified is to be considered a PVID at ingress. Any
487 untagged frames will be assigned to this VLAN.
488
489
490 untagged
491 the vlan specified is to be treated as untagged on egress.
492
493
494 self the vlan is configured on the specified physical device.
495 Required if the device is the bridge device.
496
497
498 master the vlan is configured on the software bridge (default).
499
500
501 bridge vlan delete - delete a vlan filter entry
502 This command removes an existing vlan filter entry.
503
504
505 The arguments are the same as with bridge vlan add. The pvid and
506 untagged flags are ignored.
507
508
509 bridge vlan show - list vlan configuration.
510 This command displays the current VLAN filter table.
511
512
513 With the -statistics option, the command displays per-vlan traffic sta‐
514 tistics.
515
516
517 bridge vlan tunnelshow - list vlan tunnel mapping.
518 This command displays the current vlan tunnel info mapping.
519
520
522 The bridge utility can monitor the state of devices and addresses con‐
523 tinuously. This option has a slightly different format. Namely, the
524 monitor command is the first in the command line and then the object
525 list follows:
526
527 bridge monitor [ all | OBJECT-LIST ]
528
529 OBJECT-LIST is the list of object types that we want to monitor. It
530 may contain link, fdb, and mdb. If no file argument is given, bridge
531 opens RTNETLINK, listens on it and dumps state changes in the format
532 described in previous sections.
533
534
535 If a file name is given, it does not listen on RTNETLINK, but opens the
536 file containing RTNETLINK messages saved in binary format and dumps
537 them.
538
539
541 This command uses facilities added in Linux 3.0.
542
543 Although the forwarding table is maintained on a per-bridge device
544 basis the bridge device is not part of the syntax. This is a limitation
545 of the underlying netlink neighbour message protocol. When displaying
546 the forwarding table, entries for all bridges are displayed.
547 Add/delete/modify commands determine the underlying bridge device based
548 on the bridge to which the corresponding ethernet device is attached.
549
550
551
553 ip(8)
554
556 Please direct bugreports and patches to: <netdev@vger.kernel.org>
557
558
560 Original Manpage by Stephen Hemminger
561
562
563
564iproute2 1 August 2012 BRIDGE(8)