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