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