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