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