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