]> 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 selection algorithms.
293
294 .TP
295 .BI state " STATE "
296 the operation state of the port. Except state 0 (disable STP or BPDU filter feature),
297 this is primarily used by user space STP/RSTP
298 implementation. One may enter port state name (case insensitive), or one of the
299 numbers below. Negative inputs are ignored, and unrecognized names return an
300 error.
301
302 .B 0
303 - port is in STP
304 .B DISABLED
305 state. Make this port completely inactive for STP. This is also called
306 BPDU filter and could be used to disable STP on an untrusted port, like
307 a leaf virtual devices.
308 .sp
309
310 .B 1
311 - port is in STP
312 .B LISTENING
313 state. Only valid if STP is enabled on the bridge. In this
314 state the port listens for STP BPDUs and drops all other traffic frames.
315 .sp
316
317 .B 2
318 - port is in STP
319 .B LEARNING
320 state. Only valid if STP is enabled on the bridge. In this
321 state the port will accept traffic only for the purpose of updating MAC
322 address tables.
323 .sp
324
325 .B 3
326 - port is in STP
327 .B FORWARDING
328 state. Port is fully active.
329 .sp
330
331 .B 4
332 - port is in STP
333 .B BLOCKING
334 state. Only valid if STP is enabled on the bridge. This state
335 is used during the STP election process. In this state, port will only process
336 STP BPDUs.
337 .sp
338
339 .TP
340 .BR "guard on " or " guard off "
341 Controls whether STP BPDUs will be processed by the bridge port. By default,
342 the flag is turned off allowed BPDU processing. Turning this flag on will
343 disables
344 the bridge port if a STP BPDU packet is received.
345
346 If running Spanning Tree on bridge, hostile devices on the network
347 may send BPDU on a port and cause network failure. Setting
348 .B guard on
349 will detect and stop this by disabling the port.
350 The port will be restarted if link is brought down, or
351 removed and reattached. For example if guard is enable on
352 eth0:
353
354 .B ip link set dev eth0 down; ip link set dev eth0 up
355
356 .TP
357 .BR "hairpin on " or " hairpin off "
358 Controls whether traffic may be send back out of the port on which it was
359 received. This option is also called reflective relay mode, and is used to support
360 basic VEPA (Virtual Ethernet Port Aggregator) capabilities.
361 By default, this flag is turned off and the bridge will not forward
362 traffic back out of the receiving port.
363
364 .TP
365 .BR "fastleave on " or " fastleave off "
366 This flag allows the bridge to immediately stop multicast traffic on a port
367 that receives IGMP Leave message. It is only used with IGMP snooping is
368 enabled on the bridge. By default the flag is off.
369
370 .TP
371 .BR "root_block on " or " root_block off "
372 Controls whether a given port is allowed to become root port or not. Only used
373 when STP is enabled on the bridge. By default the flag is off.
374
375 This feature is also called root port guard.
376 If BPDU is received from a leaf (edge) port, it should not
377 be elected as root port. This could be used if using STP on a bridge and the downstream bridges are not fully
378 trusted; this prevents a hostile guest from rerouting traffic.
379
380 .TP
381 .BR "learning on " or " learning off "
382 Controls whether a given port will learn MAC addresses from received traffic or
383 not. If learning if off, the bridge will end up flooding any traffic for which
384 it has no FDB entry. By default this flag is on.
385
386 .TP
387 .BR "learning_sync on " or " learning_sync off "
388 Controls whether a given port will sync MAC addresses learned on device port to
389 bridge FDB.
390
391 .TP
392 .BR "flood on " or " flood off "
393 Controls whether a given port will flood unicast traffic for which there is no FDB entry. By default this flag is on.
394
395 .TP
396 .BI hwmode
397 Some network interface cards support HW bridge functionality and they may be
398 configured in different modes. Currently support modes are:
399
400 .B vepa
401 - Data sent between HW ports is sent on the wire to the external
402 switch.
403
404 .B veb
405 - bridging happens in hardware.
406
407 .TP
408 .BR "mcast_flood on " or " mcast_flood off "
409 Controls whether a given port will flood multicast traffic for which
410 there is no MDB entry. By default this flag is on.
411
412 .TP
413 .BR "mcast_to_unicast on " or " mcast_to_unicast off "
414 Controls whether a given port will replicate packets using unicast
415 instead of multicast. By default this flag is off.
416
417 This is done by copying the packet per host and
418 changing the multicast destination MAC to a unicast one accordingly.
419
420 .BR mcast_to_unicast
421 works on top of the multicast snooping feature of
422 the bridge. Which means unicast copies are only delivered to hosts which
423 are interested in it and signalized this via IGMP/MLD reports
424 previously.
425
426 This feature is intended for interface types which have a more reliable
427 and/or efficient way to deliver unicast packets than broadcast ones
428 (e.g. WiFi).
429
430 However, it should only be enabled on interfaces where no IGMPv2/MLDv1
431 report suppression takes place. IGMP/MLD report suppression issue is usually
432 overcome by the network daemon (supplicant) enabling AP isolation and
433 by that separating all STAs.
434
435 Delivery of STA-to-STA IP multicast is made possible again by
436 enabling and utilizing the bridge hairpin mode, which considers the
437 incoming port as a potential outgoing port, too (see
438 .B hairpin
439 option).
440 Hairpin mode is performed after multicast snooping, therefore leading to
441 only deliver reports to STAs running a multicast router.
442
443 .TP
444 .BR "neigh_suppress on " or " neigh_suppress off "
445 Controls whether neigh discovery (arp and nd) proxy and suppression is
446 enabled on the port. By default this flag is off.
447
448 .TP
449 .BR "vlan_tunnel on " or " vlan_tunnel off "
450 Controls whether vlan to tunnel mapping is enabled on the port. By
451 default this flag is off.
452
453 .TP
454 .BR "isolated on " or " isolated off "
455 Controls whether a given port will be isolated, which means it will be
456 able to communicate with non-isolated ports only. By default this
457 flag is off.
458
459 .TP
460 .BI backup_port " DEVICE"
461 If the port loses carrier all traffic will be redirected to the
462 configured backup port
463
464 .TP
465 .BR nobackup_port
466 Removes the currently configured backup port
467
468 .TP
469 .BI self
470 link setting is configured on specified physical device
471
472 .TP
473 .BI master
474 link setting is configured on the software bridge (default)
475
476 .TP
477 .BR "\-t" , " \-timestamp"
478 display current time when using monitor option.
479
480 .SS bridge link show - list ports configuration for all bridges.
481
482 This command displays port configuration and flags for all bridges.
483
484 To display port configuration and flags for a specific bridge, use the
485 "ip link show master <bridge_device>" command.
486
487 .SH bridge fdb - forwarding database management
488
489 .B fdb
490 objects contain known Ethernet addresses on a link.
491
492 .P
493 The corresponding commands display fdb entries, add new entries,
494 append entries,
495 and delete old ones.
496
497 .SS bridge fdb add - add a new fdb entry
498
499 This command creates a new fdb entry.
500
501 .TP
502 .BI "LLADDR"
503 the Ethernet MAC address.
504
505 .TP
506 .BI dev " DEV"
507 the interface to which this address is associated.
508
509 .B local
510 - is a local permanent fdb entry
511 .sp
512
513 .B static
514 - is a static (no arp) fdb entry
515 .sp
516
517 .B dynamic
518 - is a dynamic reachable age-able fdb entry
519 .sp
520
521 .B self
522 - the address is associated with the port drivers fdb. Usually hardware.
523 .sp
524
525 .B master
526 - the address is associated with master devices fdb. Usually software (default).
527 .sp
528
529 .B router
530 - the destination address is associated with a router.
531 Valid if the referenced device is a VXLAN type device and has
532 route short circuit enabled.
533 .sp
534
535 .B use
536 - the address is in use. User space can use this option to
537 indicate to the kernel that the fdb entry is in use.
538 .sp
539
540 .B extern_learn
541 - this entry was learned externally. This option can be used to
542 indicate to the kernel that an entry was hardware or user-space
543 controller learnt dynamic entry. Kernel will not age such an entry.
544 .sp
545
546 .B sticky
547 - this entry will not change its port due to learning.
548 .sp
549
550 .in -8
551 The next command line parameters apply only
552 when the specified device
553 .I DEV
554 is of type VXLAN.
555 .TP
556 .BI dst " IPADDR"
557 the IP address of the destination
558 VXLAN tunnel endpoint where the Ethernet MAC ADDRESS resides.
559
560 .TP
561 .BI src_vni " VNI"
562 the src VNI Network Identifier (or VXLAN Segment ID)
563 this entry belongs to. Used only when the vxlan device is in
564 external or collect metadata mode. If omitted the value specified at
565 vxlan device creation will be used.
566
567 .TP
568 .BI vni " VNI"
569 the VXLAN VNI Network Identifier (or VXLAN Segment ID)
570 to use to connect to the remote VXLAN tunnel endpoint.
571 If omitted the value specified at vxlan device creation
572 will be used.
573
574 .TP
575 .BI port " PORT"
576 the UDP destination PORT number to use to connect to the
577 remote VXLAN tunnel endpoint.
578 If omitted the default value is used.
579
580 .TP
581 .BI via " DEVICE"
582 device name of the outgoing interface for the
583 VXLAN device driver to reach the
584 remote VXLAN tunnel endpoint.
585
586 .SS bridge fdb append - append a forwarding database entry
587 This command adds a new fdb entry with an already known
588 .IR LLADDR .
589 Valid only for multicast link layer addresses.
590 The command adds support for broadcast and multicast
591 Ethernet MAC addresses.
592 The Ethernet MAC address is added multiple times into
593 the forwarding database and the vxlan device driver
594 sends a copy of the data packet to each entry found.
595
596 .PP
597 The arguments are the same as with
598 .BR "bridge fdb add" .
599
600 .SS bridge fdb delete - delete a forwarding database entry
601 This command removes an existing fdb entry.
602
603 .PP
604 The arguments are the same as with
605 .BR "bridge fdb add" .
606
607 .SS bridge fdb replace - replace a forwarding database entry
608 If no matching entry is found, a new one will be created instead.
609
610 .PP
611 The arguments are the same as with
612 .BR "bridge fdb add" .
613
614 .SS bridge fdb show - list forwarding entries.
615
616 This command displays the current forwarding table.
617
618 .PP
619 With the
620 .B -statistics
621 option, the command becomes verbose. It prints out the last updated
622 and last used time for each entry.
623
624 .SS bridge fdb get - get bridge forwarding entry.
625
626 lookup a bridge forwarding table entry.
627
628 .TP
629 .BI "LLADDR"
630 the Ethernet MAC address.
631
632 .TP
633 .BI dev " DEV"
634 the interface to which this address is associated.
635
636 .TP
637 .BI brport " DEV"
638 the bridge port to which this address is associated. same as dev above.
639
640 .TP
641 .BI br " DEV"
642 the bridge to which this address is associated.
643
644 .TP
645 .B self
646 - the address is associated with the port drivers fdb. Usually hardware.
647
648 .TP
649 .B master
650 - the address is associated with master devices fdb. Usually software (default).
651 .sp
652
653 .SH bridge mdb - multicast group database management
654
655 .B mdb
656 objects contain known IP multicast group addresses on a link.
657
658 .P
659 The corresponding commands display mdb entries, add new entries,
660 and delete old ones.
661
662 .SS bridge mdb add - add a new multicast group database entry
663
664 This command creates a new mdb entry.
665
666 .TP
667 .BI dev " DEV"
668 the interface where this group address is associated.
669
670 .TP
671 .BI port " PORT"
672 the port whose link is known to have members of this multicast group.
673
674 .TP
675 .BI grp " GROUP"
676 the IP multicast group address whose members reside on the link connected to
677 the port.
678
679 .B permanent
680 - the mdb entry is permanent
681 .sp
682
683 .B temp
684 - the mdb entry is temporary (default)
685 .sp
686
687 .TP
688 .BI vid " VID"
689 the VLAN ID which is known to have members of this multicast group.
690
691 .in -8
692 .SS bridge mdb delete - delete a multicast group database entry
693 This command removes an existing mdb entry.
694
695 .PP
696 The arguments are the same as with
697 .BR "bridge mdb add" .
698
699 .SS bridge mdb show - list multicast group database entries
700
701 This command displays the current multicast group membership table. The table
702 is populated by IGMP and MLD snooping in the bridge driver automatically. It
703 can be altered by
704 .B bridge mdb add
705 and
706 .B bridge mdb del
707 commands manually too.
708
709 .TP
710 .BI dev " DEV"
711 the interface only whose entries should be listed. Default is to list all
712 bridge interfaces.
713
714 .PP
715 With the
716 .B -details
717 option, the command becomes verbose. It prints out the ports known to have
718 a connected router.
719
720 .PP
721 With the
722 .B -statistics
723 option, the command displays timer values for mdb and router port entries.
724
725 .SH bridge vlan - VLAN filter list
726
727 .B vlan
728 objects contain known VLAN IDs for a link.
729
730 .P
731 The corresponding commands display vlan filter entries, add new entries,
732 and delete old ones.
733
734 .SS bridge vlan add - add a new vlan filter entry
735
736 This command creates a new vlan filter entry.
737
738 .TP
739 .BI dev " NAME"
740 the interface with which this vlan is associated.
741
742 .TP
743 .BI vid " VID"
744 the VLAN ID that identifies the vlan.
745
746 .TP
747 .BI tunnel_info " TUNNEL_ID"
748 the TUNNEL ID that maps to this vlan. The tunnel id is set in
749 dst_metadata for every packet that belongs to this vlan (applicable to
750 bridge ports with vlan_tunnel flag set).
751
752 .TP
753 .BI pvid
754 the vlan specified is to be considered a PVID at ingress.
755 Any untagged frames will be assigned to this VLAN.
756
757 .TP
758 .BI untagged
759 the vlan specified is to be treated as untagged on egress.
760
761 .TP
762 .BI self
763 the vlan is configured on the specified physical device. Required if the
764 device is the bridge device.
765
766 .TP
767 .BI master
768 the vlan is configured on the software bridge (default).
769
770 .SS bridge vlan delete - delete a vlan filter entry
771 This command removes an existing vlan filter entry.
772
773 .PP
774 The arguments are the same as with
775 .BR "bridge vlan add".
776 The
777 .BR "pvid " and " untagged"
778 flags are ignored.
779
780 .SS bridge vlan show - list vlan configuration.
781
782 This command displays the current VLAN filter table.
783
784 .PP
785 With the
786 .B -statistics
787 option, the command displays per-vlan traffic statistics.
788
789 .SS bridge vlan tunnelshow - list vlan tunnel mapping.
790
791 This command displays the current vlan tunnel info mapping.
792
793 .SH bridge monitor - state monitoring
794
795 The
796 .B bridge
797 utility can monitor the state of devices and addresses
798 continuously. This option has a slightly different format.
799 Namely, the
800 .B monitor
801 command is the first in the command line and then the object list follows:
802
803 .BR "bridge monitor" " [ " all " |"
804 .IR OBJECT-LIST " ]"
805
806 .I OBJECT-LIST
807 is the list of object types that we want to monitor.
808 It may contain
809 .BR link ", " fdb ", and " mdb "."
810 If no
811 .B file
812 argument is given,
813 .B bridge
814 opens RTNETLINK, listens on it and dumps state changes in the format
815 described in previous sections.
816
817 .P
818 If a file name is given, it does not listen on RTNETLINK,
819 but opens the file containing RTNETLINK messages saved in binary format
820 and dumps them.
821
822 .SH NOTES
823 This command uses facilities added in Linux 3.0.
824
825 Although the forwarding table is maintained on a per-bridge device basis
826 the bridge device is not part of the syntax. This is a limitation of the
827 underlying netlink neighbour message protocol. When displaying the
828 forwarding table, entries for all bridges are displayed.
829 Add/delete/modify commands determine the underlying bridge device
830 based on the bridge to which the corresponding ethernet device is attached.
831
832
833 .SH SEE ALSO
834 .BR ip (8)
835 .SH BUGS
836 .RB "Please direct bugreports and patches to: " <netdev@vger.kernel.org>
837
838 .SH AUTHOR
839 Original Manpage by Stephen Hemminger