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