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