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