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