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