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