]> git.proxmox.com Git - mirror_iproute2.git/blame - man/man8/ip-link.8.in
bridge: mdb: add support for source address
[mirror_iproute2.git] / man / man8 / ip-link.8.in
CommitLineData
77987911 1.TH IP\-LINK 8 "13 Dec 2012" "iproute2" "Linux"
761a1e60
CT
2.SH "NAME"
3ip-link \- network device configuration
4.SH "SYNOPSIS"
5.sp
6.ad l
7.in +8
8.ti -8
e895ae0b 9.B ip link
761a1e60
CT
10.RI " { " COMMAND " | "
11.BR help " }"
12.sp
13
761a1e60 14.ti -8
9fc56974
AH
15.BI "ip link add"
16.RB "[ " link
17.IR DEVICE " ]"
761a1e60
CT
18.RB "[ " name " ]"
19.I NAME
20.br
21.RB "[ " txqueuelen
22.IR PACKETS " ]"
23.br
24.RB "[ " address
25.IR LLADDR " ]"
26.RB "[ " broadcast
27.IR LLADDR " ]"
28.br
29.RB "[ " mtu
30.IR MTU " ]"
4de8d885
PE
31.RB "[ " index
32.IR IDX " ]"
761a1e60 33.br
d992f3e6
JP
34.RB "[ " numtxqueues
35.IR QUEUE_COUNT " ]"
36.RB "[ " numrxqueues
37.IR QUEUE_COUNT " ]"
38.br
051274b4 39.BR "[ " gso_max_size
c2db423f
SH
40.IR BYTES " ]"
41.RB "[ " gso_max_segs
42.IR SEGMENTS " ]"
43.br
d890144e 44.BI type " TYPE"
761a1e60
CT
45.RI "[ " ARGS " ]"
46
761a1e60 47.ti -8
7f74cf6d
VK
48.BR "ip link delete " {
49.IR DEVICE " | "
50.BI "group " GROUP
51}
761a1e60
CT
52.BI type " TYPE"
53.RI "[ " ARGS " ]"
54
55.ti -8
56.BR "ip link set " {
57.IR DEVICE " | "
58.BI "group " GROUP
657426c5
PS
59}
60.br
61.RB "[ { " up " | " down " } ]"
62.br
63.RB "[ " type
64.IR "ETYPE TYPE_ARGS" " ]"
761a1e60 65.br
ca611d64 66.RB "[ " arp " { " on " | " off " } ]"
761a1e60 67.br
ca611d64 68.RB "[ " dynamic " { " on " | " off " } ]"
761a1e60 69.br
ca611d64 70.RB "[ " multicast " { " on " | " off " } ]"
761a1e60 71.br
ca611d64 72.RB "[ " allmulticast " { " on " | " off " } ]"
761a1e60 73.br
ca611d64 74.RB "[ " promisc " { " on " | " off " } ]"
18864827 75.br
ca611d64 76.RB "[ " protodown " { " on " | " off " } ]"
761a1e60 77.br
6fd53b2a
RP
78.RB "[ " protodown_reason
79.IR PREASON " { " on " | " off " } ]"
80.br
ca611d64 81.RB "[ " trailers " { " on " | " off " } ]"
761a1e60 82.br
ca611d64
PS
83.RB "[ " txqueuelen
84.IR PACKETS " ]"
85.br
86.RB "[ " name
87.IR NEWNAME " ]"
88.br
89.RB "[ " address
90.IR LLADDR " ]"
761a1e60 91.br
ca611d64
PS
92.RB "[ " broadcast
93.IR LLADDR " ]"
94.br
95.RB "[ " mtu
96.IR MTU " ]"
761a1e60 97.br
ca611d64
PS
98.RB "[ " netns " {"
99.IR PID " | " NETNSNAME " } ]"
761a1e60 100.br
ca611d64
PS
101.RB "[ " link-netnsid
102.IR ID " ]"
761a1e60 103.br
ca611d64
PS
104.RB "[ " alias
105.IR NAME " ]"
761a1e60 106.br
ca611d64 107.RB "[ " vf
761a1e60
CT
108.IR NUM " ["
109.B mac
ca611d64
PS
110.IR LLADDR " ]"
111.br
112.in +9
56e9f0ab 113.RI "[ " VFVLAN-LIST " ]"
761a1e60 114.br
ca611d64
PS
115.RB "[ " rate
116.IR TXRATE " ]"
117.br
118.RB "[ " max_tx_rate
119.IR TXRATE " ]"
120.br
121.RB "[ " min_tx_rate
122.IR TXRATE " ]"
761a1e60 123.br
ca611d64 124.RB "[ " spoofchk " { " on " | " off " } ]"
503aa4e2 125.br
8e45e44b
PS
126.RB "[ " query_rss " { " on " | " off " } ]"
127.br
ca611d64 128.RB "[ " state " { " auto " | " enable " | " disable " } ]"
503aa4e2 129.br
d91fb3f4
EC
130.RB "[ " trust " { " on " | " off " } ]"
131.br
132.RB "[ " node_guid " eui64 ]"
133.br
134.RB "[ " port_guid " eui64 ] ]"
ca611d64
PS
135.br
136.in -9
1b5e8094 137.RB "[ { " xdp " | " xdpgeneric " | " xdpdrv " | " xdpoffload " } { " off " | "
c7272ca7
DB
138.br
139.in +8
140.BR object
141.IR FILE
142.RB "[ " section
143.IR NAME " ]"
144.RB "[ " verbose " ] |"
145.br
146.BR pinned
147.IR FILE " } ]"
148.br
149.in -8
ca611d64
PS
150.RB "[ " master
151.IR DEVICE " ]"
152.br
153.RB "[ " nomaster " ]"
154.br
104444c2
DA
155.RB "[ " vrf
156.IR NAME " ]"
157.br
ca611d64 158.RB "[ " addrgenmode " { " eui64 " | " none " | " stable_secret " | " random " } ]"
aa1b44ca 159.br
cd35c954
SH
160.RB "[ " macaddr
161.RI "[ " MACADDR " ]"
162.br
163.in +10
164.RB "[ { " flush " | " add " | " del " } "
165.IR MACADDR " ]"
166.br
167.RB "[ " set
168.IR MACADDR " ] ]"
aa1b44ca 169.br
761a1e60
CT
170
171.ti -8
172.B ip link show
173.RI "[ " DEVICE " | "
174.B group
ca611d64
PS
175.IR GROUP " ] ["
176.BR up " ] ["
1b944148 177.B master
ca611d64 178.IR DEVICE " ] ["
712249d8 179.B type
ad0e3740 180.IR ETYPE " ] ["
104444c2
DA
181.B vrf
182.IR NAME " ]"
761a1e60 183
94f1a22a
NA
184.ti -8
185.B ip link xstats
186.BI type " TYPE"
187.RI "[ " ARGS " ]"
188
837552b4
RS
189.ti -8
190.B ip link afstats
191.RB "[ " dev
192.IR DEVICE " ]"
193
1f299e92 194.ti -8
195.B ip link help
196.RI "[ " TYPE " ]"
197
657426c5
PS
198.ti -8
199.IR TYPE " := [ "
200.BR bridge " | "
201.BR bond " | "
202.BR can " | "
203.BR dummy " | "
204.BR hsr " | "
205.BR ifb " | "
206.BR ipoib " |"
207.BR macvlan " | "
208.BR macvtap " | "
209.BR vcan " | "
1eccc573 210.BR vxcan " | "
657426c5
PS
211.BR veth " | "
212.BR vlan " | "
213.BR vxlan " |"
214.BR ip6tnl " |"
215.BR ipip " |"
216.BR sit " |"
217.BR gre " |"
218.BR gretap " |"
9a1381d5 219.BR erspan " |"
657426c5
PS
220.BR ip6gre " |"
221.BR ip6gretap " |"
8595cc40 222.BR ip6erspan " |"
657426c5
PS
223.BR vti " |"
224.BR nlmon " |"
225.BR ipvlan " |"
88272775 226.BR ipvtap " |"
657426c5
PS
227.BR lowpan " |"
228.BR geneve " |"
a6c5c952 229.BR bareudp " |"
fd4df5b2 230.BR vrf " |"
7d424c71 231.BR macsec " |"
46c16a5d 232.BR netdevsim " |"
286446c1
ME
233.BR rmnet " |"
234.BR xfrm " ]"
657426c5
PS
235
236.ti -8
237.IR ETYPE " := [ " TYPE " |"
238.BR bridge_slave " | " bond_slave " ]"
239
56e9f0ab
MS
240.ti -8
241.IR VFVLAN-LIST " := [ " VFVLAN-LIST " ] " VFVLAN
242
243.ti -8
244.IR VFVLAN " := "
245.RB "[ " vlan
246.IR VLANID " [ "
247.B qos
248.IR VLAN-QOS " ] ["
249.B proto
250.IR VLAN-PROTO " ] ]"
3aa0e51b
JP
251.in -8
252
253.ti -8
254.BI "ip link property add"
255.RB "[ " altname
256.IR NAME " .. ]"
257
258.ti -8
259.BI "ip link property del"
260.RB "[ " altname
261.IR NAME " .. ]"
56e9f0ab 262
761a1e60
CT
263.SH "DESCRIPTION"
264.SS ip link add - add virtual link
265
266.TP
267.BI link " DEVICE "
268specifies the physical device to act operate on.
269
270.I NAME
271specifies the name of the new virtual device.
272
273.I TYPE
274specifies the type of the new device.
275.sp
276Link types:
277
278.in +8
f1a6f4e9
SH
279.B bridge
280- Ethernet Bridge device
761a1e60 281.sp
cc26a890
JP
282.B bond
283- Bonding device
103bc5f1 284.sp
761a1e60
CT
285.B dummy
286- Dummy network interface
287.sp
2f937359 288.B hsr
289- High-availability Seamless Redundancy device
290.sp
761a1e60
CT
291.B ifb
292- Intermediate Functional Block device
293.sp
f1a6f4e9
SH
294.B ipoib
295- IP over Infiniband device
296.sp
761a1e60 297.B macvlan
f1a6f4e9 298- Virtual interface base on link layer address (MAC)
761a1e60 299.sp
e4c35682
RR
300.B macvtap
301- Virtual interface based on link layer address (MAC) and TAP.
302.sp
f1a6f4e9 303.B vcan
2b70fe15 304- Virtual Controller Area Network interface
761a1e60 305.sp
1eccc573
OH
306.B vxcan
307- Virtual Controller Area Network tunnel interface
308.sp
f1a6f4e9
SH
309.B veth
310- Virtual ethernet interface
de038993 311.sp
f1a6f4e9
SH
312.BR vlan
313- 802.1q tagged virtual LAN interface
314.sp
315.BR vxlan
316- Virtual eXtended LAN
77987911
ND
317.sp
318.BR ip6tnl
319- Virtual tunnel interface IPv4|IPv6 over IPv6
320.sp
321.BR ipip
322- Virtual tunnel interface IPv4 over IPv4
323.sp
324.BR sit
325- Virtual tunnel interface IPv6 over IPv4
9abde37c 326.sp
327.BR gre
328- Virtual tunnel interface GRE over IPv4
329.sp
330.BR gretap
d36d9d41 331- Virtual L2 tunnel interface GRE over IPv4
9abde37c 332.sp
9a1381d5
WT
333.BR erspan
334- Encapsulated Remote SPAN over GRE and IPv4
335.sp
9abde37c 336.BR ip6gre
d36d9d41 337- Virtual tunnel interface GRE over IPv6
9abde37c 338.sp
339.BR ip6gretap
d36d9d41 340- Virtual L2 tunnel interface GRE over IPv6
b6d6b5a1 341.sp
8595cc40
WT
342.BR ip6erspan
343- Encapsulated Remote SPAN over GRE and IPv6
344.sp
b6d6b5a1
VK
345.BR vti
346- Virtual tunnel interface
347.sp
348.BR nlmon
349- Netlink monitoring device
350.sp
351.BR ipvlan
352- Interface for L3 (IPv6/IPv4) based VLANs
2c0feda8 353.sp
88272775
HL
354.BR ipvtap
355- Interface for L3 (IPv6/IPv4) based VLANs and TAP
356.sp
2c0feda8
LB
357.BR lowpan
358- Interface for 6LoWPAN (IPv6) over IEEE 802.15.4 / Bluetooth
c1a1d8bc
JL
359.sp
360.BR geneve
361- GEneric NEtwork Virtualization Encapsulation
b26fc590 362.sp
a6c5c952
GN
363.BR bareudp
364- Bare UDP L3 encapsulation support
365.sp
b26fc590
SD
366.BR macsec
367- Interface for IEEE 802.1AE MAC Security (MACsec)
2a6f9cfa
DA
368.sp
369.BR vrf
370- Interface for L3 VRF domains
7d424c71
JK
371.sp
372.BR netdevsim
373- Interface for netdev API tests
46c16a5d
DP
374.sp
375.BR rmnet
376- Qualcomm rmnet device
286446c1
ME
377.sp
378.BR xfrm
379- Virtual xfrm interface
761a1e60
CT
380.in -8
381
d992f3e6
JP
382.TP
383.BI numtxqueues " QUEUE_COUNT "
384specifies the number of transmit queues for new device.
385
386.TP
387.BI numrxqueues " QUEUE_COUNT "
388specifies the number of receive queues for new device.
389
c2db423f
SH
390.TP
391.BI gso_max_size " BYTES "
f76ad635
SH
392specifies the recommended maximum size of a Generic Segment Offload
393packet the new device should accept.
c2db423f
SH
394
395.TP
396.BI gso_max_segs " SEGMENTS "
f76ad635
SH
397specifies the recommended maximum number of a Generic Segment Offload
398segments the new device should accept.
c2db423f 399
4de8d885
PE
400.TP
401.BI index " IDX "
f76ad635
SH
402specifies the desired index of the new virtual device. The link
403creation fails, if the index is busy.
4de8d885 404
503aa4e2
405.TP
406VLAN Type Support
407For a link of type
408.I VLAN
409the following additional arguments are supported:
410
411.BI "ip link add
412.BI link " DEVICE "
413.BI name " NAME "
52a59869 414.B "type vlan"
1ab0f02f 415[
503aa4e2 416.BI protocol " VLAN_PROTO "
1ab0f02f 417]
503aa4e2 418.BI id " VLANID "
1ab0f02f 419[
503aa4e2 420.BR reorder_hdr " { " on " | " off " } "
1ab0f02f
TF
421]
422[
503aa4e2 423.BR gvrp " { " on " | " off " } "
1ab0f02f
TF
424]
425[
503aa4e2 426.BR mvrp " { " on " | " off " } "
1ab0f02f
TF
427]
428[
503aa4e2 429.BR loose_binding " { " on " | " off " } "
1ab0f02f
TF
430]
431[
3f2e457a
MM
432.BR bridge_binding " { " on " | " off " } "
433]
434[
503aa4e2 435.BI ingress-qos-map " QOS-MAP "
1ab0f02f
TF
436]
437[
503aa4e2 438.BI egress-qos-map " QOS-MAP "
1ab0f02f 439]
503aa4e2
440
441.in +8
442.sp
443.BI protocol " VLAN_PROTO "
444- either 802.1Q or 802.1ad.
445
446.BI id " VLANID "
447- specifies the VLAN Identifer to use. Note that numbers with a leading " 0 " or " 0x " are interpreted as octal or hexadeimal, respectively.
448
449.BR reorder_hdr " { " on " | " off " } "
e612883c
VK
450- specifies whether ethernet headers are reordered or not (default is
451.BR on ")."
452
453.in +4
454If
455.BR reorder_hdr " is " on
f76ad635
SH
456then VLAN header will be not inserted immediately but only before
457passing to the physical device (if this device does not support VLAN
458offloading), the similar on the RX direction - by default the packet
459will be untagged before being received by VLAN device. Reordering
460allows to accelerate tagging on egress and to hide VLAN header on
461ingress so the packet looks like regular Ethernet packet, at the same
462time it might be confusing for packet capture as the VLAN header does
463not exist within the packet.
e612883c
VK
464
465VLAN offloading can be checked by
466.BR ethtool "(8):"
467.in +4
468.sp
469.B ethtool -k
470<phy_dev> |
471.RB grep " tx-vlan-offload"
472.sp
473.in -4
474where <phy_dev> is the physical device to which VLAN device is bound.
475.in -4
503aa4e2
476
477.BR gvrp " { " on " | " off " } "
f76ad635
SH
478- specifies whether this VLAN should be registered using GARP VLAN
479 Registration Protocol.
503aa4e2
480
481.BR mvrp " { " on " | " off " } "
f76ad635
SH
482- specifies whether this VLAN should be registered using Multiple VLAN
483 Registration Protocol.
503aa4e2
484
485.BR loose_binding " { " on " | " off " } "
486- specifies whether the VLAN device state is bound to the physical device state.
487
3f2e457a
MM
488.BR bridge_binding " { " on " | " off " } "
489- specifies whether the VLAN device link state tracks the state of bridge ports
490that are members of the VLAN.
491
503aa4e2 492.BI ingress-qos-map " QOS-MAP "
ab872442
VK
493- defines a mapping of VLAN header prio field to the Linux internal packet
494priority on incoming frames. The format is FROM:TO with multiple mappings
495separated by spaces.
503aa4e2
496
497.BI egress-qos-map " QOS-MAP "
ab872442
VK
498- defines a mapping of Linux internal packet priority to VLAN header prio field
499but for outgoing frames. The format is the same as for ingress-qos-map.
500.in +4
501
502Linux packet priority can be set by
503.BR iptables "(8)":
504.in +4
505.sp
506.B iptables
507-t mangle -A POSTROUTING [...] -j CLASSIFY --set-class 0:4
508.sp
509.in -4
f76ad635
SH
510and this "4" priority can be used in the egress qos mapping to set
511VLAN prio "5":
ab872442
VK
512.sp
513.in +4
514.B ip
515link set veth0.10 type vlan egress 4:5
516.in -4
517.in -4
503aa4e2
518.in -8
519
2816a568
TR
520.TP
521VXLAN Type Support
63f60e3a 522For a link of type
2816a568
TR
523.I VXLAN
524the following additional arguments are supported:
525
526.BI "ip link add " DEVICE
52a59869 527.BI type " vxlan " id " VNI"
1ab0f02f 528[
2816a568 529.BI dev " PHYS_DEV "
7cfa3802
AW
530.RB " ] [ { " group " | " remote " } "
531.I IPADDR
1ab0f02f 532] [
5cd64c97
TF
533.B local
534.RI "{ "IPADDR " | "any " } "
1ab0f02f 535] [
2816a568 536.BI ttl " TTL "
1ab0f02f 537] [
2816a568 538.BI tos " TOS "
1ab0f02f 539] [
3d98eba4
SB
540.BI df " DF "
541] [
f8eb79a6
DB
542.BI flowlabel " FLOWLABEL "
543] [
503aa4e2 544.BI dstport " PORT "
1ab0f02f 545] [
503aa4e2 546.BI srcport " MIN MAX "
1ab0f02f 547] [
52a59869 548.RB [ no ] learning
1ab0f02f 549] [
52a59869 550.RB [ no ] proxy
1ab0f02f 551] [
52a59869 552.RB [ no ] rsc
1ab0f02f 553] [
52a59869 554.RB [ no ] l2miss
1ab0f02f 555] [
52a59869 556.RB [ no ] l3miss
1ab0f02f 557] [
52a59869 558.RB [ no ] udpcsum
1ab0f02f 559] [
52a59869 560.RB [ no ] udp6zerocsumtx
1ab0f02f 561] [
52a59869 562.RB [ no ] udp6zerocsumrx
1ab0f02f 563] [
c2fbc57e 564.BI ageing " SECONDS "
1ab0f02f 565] [
c2fbc57e 566.BI maxaddress " NUMBER "
1ab0f02f 567] [
52a59869 568.RB [ no ] external
42d17a61 569] [
2eb90dc7 570.B gbp
346410bd
JB
571] [
572.B gpe
1ab0f02f 573]
2816a568
TR
574
575.in +8
576.sp
577.BI id " VNI "
578- specifies the VXLAN Network Identifer (or VXLAN Segment
579Identifier) to use.
580
581.BI dev " PHYS_DEV"
582- specifies the physical device to use for tunnel endpoint communication.
583
584.sp
585.BI group " IPADDR"
586- specifies the multicast IP address to join.
7cfa3802
AW
587This parameter cannot be specified with the
588.B remote
589parameter.
590
591.sp
592.BI remote " IPADDR"
593- specifies the unicast destination IP address to use in outgoing packets
594when the destination link layer address is not known in the VXLAN device
a89d5329 595forwarding database. This parameter cannot be specified with the
7cfa3802
AW
596.B group
597parameter.
2816a568
TR
598
599.sp
600.BI local " IPADDR"
601- specifies the source IP address to use in outgoing packets.
602
603.sp
604.BI ttl " TTL"
605- specifies the TTL value to use in outgoing packets.
606
607.sp
608.BI tos " TOS"
609- specifies the TOS value to use in outgoing packets.
610
3d98eba4
SB
611.sp
612.BI df " DF"
613- specifies the usage of the Don't Fragment flag (DF) bit in outgoing packets
614with IPv4 headers. The value
615.B inherit
616causes the bit to be copied from the original IP header. The values
617.B unset
618and
619.B set
620cause the bit to be always unset or always set, respectively. By default, the
621bit is not set.
622
f8eb79a6
DB
623.sp
624.BI flowlabel " FLOWLABEL"
625- specifies the flow label to use in outgoing packets.
626
2816a568 627.sp
503aa4e2 628.BI dstport " PORT"
f76ad635
SH
629- specifies the UDP destination port to communicate to the remote
630 VXLAN tunnel endpoint.
503aa4e2
631
632.sp
633.BI srcport " MIN MAX"
2816a568
TR
634- specifies the range of port numbers to use as UDP
635source ports to communicate to the remote VXLAN tunnel endpoint.
636
637.sp
52a59869 638.RB [ no ] learning
2816a568
TR
639- specifies if unknown source link layer addresses and IP addresses
640are entered into the VXLAN device forwarding database.
641
642.sp
52a59869 643.RB [ no ] rsc
2816a568
TR
644- specifies if route short circuit is turned on.
645
646.sp
52a59869 647.RB [ no ] proxy
2816a568
TR
648- specifies ARP proxy is turned on.
649
650.sp
52a59869 651.RB [ no ] l2miss
2816a568
TR
652- specifies if netlink LLADDR miss notifications are generated.
653
654.sp
52a59869 655.RB [ no ] l3miss
2816a568
TR
656- specifies if netlink IP ADDR miss notifications are generated.
657
503aa4e2 658.sp
52a59869 659.RB [ no ] udpcsum
4853ee52 660- specifies if UDP checksum is calculated for transmitted packets over IPv4.
503aa4e2
661
662.sp
52a59869 663.RB [ no ] udp6zerocsumtx
4853ee52 664- skip UDP checksum calculation for transmitted packets over IPv6.
503aa4e2
665
666.sp
52a59869 667.RB [ no ] udp6zerocsumrx
4853ee52 668- allow incoming UDP packets over IPv6 with zero checksum field.
503aa4e2 669
c2fbc57e
ND
670.sp
671.BI ageing " SECONDS"
672- specifies the lifetime in seconds of FDB entries learnt by the kernel.
673
674.sp
675.BI maxaddress " NUMBER"
676- specifies the maximum number of FDB entries.
677
42d17a61 678.sp
52a59869 679.RB [ no ] external
42d17a61
JB
680- specifies whether an external control plane
681.RB "(e.g. " "ip route encap" )
682or the internal FDB should be used.
683
2eb90dc7
TG
684.sp
685.B gbp
686- enables the Group Policy extension (VXLAN-GBP).
687
688.in +4
689Allows to transport group policy context across VXLAN network peers.
690If enabled, includes the mark of a packet in the VXLAN header for outgoing
691packets and fills the packet mark based on the information found in the
9d715cf6 692VXLAN header for incoming packets.
2eb90dc7
TG
693
694Format of upper 16 bits of packet mark (flags);
695
696.in +2
697+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
698.br
699|-|-|-|-|-|-|-|-|-|D|-|-|A|-|-|-|
700.br
701+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
702
703.B D :=
704Don't Learn bit. When set, this bit indicates that the egress
705VTEP MUST NOT learn the source address of the encapsulated frame.
706
707.B A :=
708Indicates that the group policy has already been applied to
709this packet. Policies MUST NOT be applied by devices when the A bit is set.
710.in -2
711
712Format of lower 16 bits of packet mark (policy ID):
713
714.in +2
715+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
716.br
717| Group Policy ID |
718.br
719+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
720.in -2
721
722Example:
723 iptables -A OUTPUT [...] -j MARK --set-mark 0x800FF
724
725.in -4
726
346410bd
JB
727.sp
728.B gpe
729- enables the Generic Protocol extension (VXLAN-GPE). Currently, this is
730only supported together with the
731.B external
732keyword.
733
2816a568
TR
734.in -8
735
1eccc573
OH
736.TP
737VETH, VXCAN Type Support
738For a link of types
739.I VETH/VXCAN
740the following additional arguments are supported:
741
742.BI "ip link add " DEVICE
743.BR type " { " veth " | " vxcan " }"
744[
745.BR peer
746.BI "name " NAME
747]
748
749.in +8
750.sp
751.BR peer
752.BI "name " NAME
753- specifies the virtual pair device name of the
754.I VETH/VXCAN
755tunnel.
756
757.in -8
758
90f1df71 759.TP
d21c028c
SD
760IPIP, SIT Type Support
761For a link of type
762.IR IPIP or SIT
90f1df71
TH
763the following additional arguments are supported:
764
765.BI "ip link add " DEVICE
d21c028c 766.BR type " { " ipip " | " sit " }"
90f1df71 767.BI " remote " ADDR " local " ADDR
1ab0f02f 768[
52a59869 769.BR encap " { " fou " | " gue " | " none " }"
1ab0f02f 770] [
52a59869 771.BR encap-sport " { " \fIPORT " | " auto " }"
1ab0f02f 772] [
90f1df71 773.BI "encap-dport " PORT
1ab0f02f 774] [
52a59869 775.RB [ no ] encap-csum
1ab0f02f 776] [
7baca946
KJ
777.I " [no]encap-remcsum "
778] [
f005b700 779.I " mode " { ip6ip | ipip | mplsip | any } "
9a1381d5 780] [
b760a882 781.BR external
1ab0f02f 782]
90f1df71
TH
783
784.in +8
785.sp
786.BI remote " ADDR "
787- specifies the remote address of the tunnel.
788
789.sp
790.BI local " ADDR "
791- specifies the fixed local address for tunneled packets.
792It must be an address on another interface on this host.
793
794.sp
52a59869 795.BR encap " { " fou " | " gue " | " none " }"
90f1df71
TH
796- specifies type of secondary UDP encapsulation. "fou" indicates
797Foo-Over-UDP, "gue" indicates Generic UDP Encapsulation.
798
799.sp
52a59869 800.BR encap-sport " { " \fIPORT " | " auto " }"
90f1df71
TH
801- specifies the source port in UDP encapsulation.
802.IR PORT
803indicates the port by number, "auto"
804indicates that the port number should be chosen automatically
805(the kernel picks a flow based on the flow hash of the
806encapsulated packet).
807
808.sp
52a59869 809.RB [ no ] encap-csum
90f1df71
TH
810- specifies if UDP checksums are enabled in the secondary
811encapsulation.
812
813.sp
52a59869 814.RB [ no ] encap-remcsum
90f1df71
TH
815- specifies if Remote Checksum Offload is enabled. This is only
816applicable for Generic UDP Encapsulation.
817
7baca946 818.sp
f005b700 819.BI mode " { ip6ip | ipip | mplsip | any } "
7baca946 820- specifies mode in which device should run. "ip6ip" indicates
f005b700 821IPv6-Over-IPv4, "ipip" indicates "IPv4-Over-IPv4", "mplsip" indicates
288c28bc
KJ
822MPLS-Over-IPv4, "any" indicates IPv6, IPv4 or MPLS Over IPv4. Supported for
823SIT where the default is "ip6ip" and IPIP where the default is "ipip".
824IPv6-Over-IPv4 is not supported for IPIP.
7baca946 825
b760a882
SP
826.sp
827.BR external
828- make this tunnel externally controlled
829.RB "(e.g. " "ip route encap" ).
830
d21c028c
SD
831.in -8
832.TP
833GRE Type Support
834For a link of type
835.IR GRE " or " GRETAP
836the following additional arguments are supported:
837
838.BI "ip link add " DEVICE
839.BR type " { " gre " | " gretap " }"
840.BI " remote " ADDR " local " ADDR
841[
7f520601 842.RB [ no ] "" [ i | o ] seq
d21c028c
SD
843] [
844.RB [ i | o ] key
845.I KEY
7f520601
SD
846|
847.BR no [ i | o ] key
d21c028c 848] [
7f520601 849.RB [ no ] "" [ i | o ] csum
d21c028c
SD
850] [
851.BI ttl " TTL "
852] [
853.BI tos " TOS "
854] [
855.RB [ no ] pmtudisc
856] [
857.RB [ no ] ignore-df
858] [
859.BI dev " PHYS_DEV "
860] [
861.BR encap " { " fou " | " gue " | " none " }"
862] [
863.BR encap-sport " { " \fIPORT " | " auto " }"
864] [
865.BI "encap-dport " PORT
866] [
867.RB [ no ] encap-csum
868] [
869.RB [ no ] encap-remcsum
870] [
871.BR external
872]
873
874.in +8
875.sp
876.BI remote " ADDR "
877- specifies the remote address of the tunnel.
878
879.sp
880.BI local " ADDR "
881- specifies the fixed local address for tunneled packets.
882It must be an address on another interface on this host.
883
884.sp
7f520601 885.RB [ no ] "" [ i | o ] seq
d21c028c
SD
886- serialize packets.
887The
888.B oseq
889flag enables sequencing of outgoing packets.
890The
891.B iseq
892flag requires that all input packets are serialized.
893
894.sp
895.RB [ i | o ] key
896.I KEY
7f520601
SD
897|
898.BR no [ i | o ] key
d21c028c
SD
899- use keyed GRE with key
900.IR KEY ". "KEY
901is either a number or an IPv4 address-like dotted quad.
902The
903.B key
904parameter specifies the same key to use in both directions.
905The
906.BR ikey " and " okey
907parameters specify different keys for input and output.
908
909.sp
7f520601 910.RB [ no ] "" [ i | o ] csum
d21c028c
SD
911- generate/require checksums for tunneled packets.
912The
913.B ocsum
914flag calculates checksums for outgoing packets.
915The
916.B icsum
917flag requires that all input packets have the correct
918checksum. The
919.B csum
920flag is equivalent to the combination
921.B "icsum ocsum" .
922
923.sp
924.BI ttl " TTL"
925- specifies the TTL value to use in outgoing packets.
926
927.sp
928.BI tos " TOS"
929- specifies the TOS value to use in outgoing packets.
930
931.sp
932.RB [ no ] pmtudisc
933- enables/disables Path MTU Discovery on this tunnel.
934It is enabled by default. Note that a fixed ttl is incompatible
935with this option: tunneling with a fixed ttl always makes pmtu
936discovery.
937
938.sp
939.RB [ no ] ignore-df
940- enables/disables IPv4 DF suppression on this tunnel.
941Normally datagrams that exceed the MTU will be fragmented; the presence
942of the DF flag inhibits this, resulting instead in an ICMP Unreachable
9d715cf6 943(Fragmentation Required) message. Enabling this attribute causes the
d21c028c
SD
944DF flag to be ignored.
945
946.sp
947.BI dev " PHYS_DEV"
948- specifies the physical device to use for tunnel endpoint communication.
949
950.sp
951.BR encap " { " fou " | " gue " | " none " }"
952- specifies type of secondary UDP encapsulation. "fou" indicates
953Foo-Over-UDP, "gue" indicates Generic UDP Encapsulation.
954
955.sp
956.BR encap-sport " { " \fIPORT " | " auto " }"
957- specifies the source port in UDP encapsulation.
958.IR PORT
959indicates the port by number, "auto"
960indicates that the port number should be chosen automatically
961(the kernel picks a flow based on the flow hash of the
962encapsulated packet).
963
964.sp
965.RB [ no ] encap-csum
966- specifies if UDP checksums are enabled in the secondary
967encapsulation.
968
969.sp
970.RB [ no ] encap-remcsum
971- specifies if Remote Checksum Offload is enabled. This is only
972applicable for Generic UDP Encapsulation.
973
974.sp
975.BR external
976- make this tunnel externally controlled
977.RB "(e.g. " "ip route encap" ).
978
90f1df71
TH
979.in -8
980
9abde37c 981.TP
982IP6GRE/IP6GRETAP Type Support
63f60e3a 983For a link of type
9abde37c 984.I IP6GRE/IP6GRETAP
985the following additional arguments are supported:
986
987.BI "ip link add " DEVICE
52a59869
PS
988.BR type " { " ip6gre " | " ip6gretap " }"
989.BI remote " ADDR " local " ADDR"
1ab0f02f 990[
7f520601 991.RB [ no ] "" [ i | o ] seq
1ab0f02f 992] [
52a59869
PS
993.RB [ i | o ] key
994.I KEY
7f520601
SD
995|
996.BR no [ i | o ] key
1ab0f02f 997] [
7f520601 998.RB [ no ] "" [ i | o ] csum
1ab0f02f 999] [
9abde37c 1000.BI hoplimit " TTL "
1ab0f02f 1001] [
9abde37c 1002.BI encaplimit " ELIM "
1ab0f02f 1003] [
9abde37c 1004.BI tclass " TCLASS "
1ab0f02f 1005] [
9abde37c 1006.BI flowlabel " FLOWLABEL "
1ab0f02f 1007] [
9abde37c 1008.BI "dscp inherit"
1ab0f02f 1009] [
f798a8ab
PM
1010.BI "[no]allow-localremote"
1011] [
9abde37c 1012.BI dev " PHYS_DEV "
6231c5be
WT
1013] [
1014.RB external
1ab0f02f 1015]
9abde37c 1016
1017.in +8
1018.sp
1019.BI remote " ADDR "
1020- specifies the remote IPv6 address of the tunnel.
1021
1022.sp
1023.BI local " ADDR "
1024- specifies the fixed local IPv6 address for tunneled packets.
90f1df71 1025It must be an address on another interface on this host.
9abde37c 1026
1027.sp
7f520601 1028.RB [ no ] "" [ i | o ] seq
9abde37c 1029- serialize packets.
1030The
1031.B oseq
1032flag enables sequencing of outgoing packets.
1033The
1034.B iseq
1035flag requires that all input packets are serialized.
1036
1037.sp
7f520601
SD
1038.RB [ i | o ] key
1039.I KEY
1040|
1041.BR no [ i | o ] key
9abde37c 1042- use keyed GRE with key
1043.IR KEY ". "KEY
1044is either a number or an IPv4 address-like dotted quad.
1045The
1046.B key
1047parameter specifies the same key to use in both directions.
1048The
1049.BR ikey " and " okey
1050parameters specify different keys for input and output.
1051
1052.sp
7f520601 1053.RB [ no ] "" [ i | o ] csum
9abde37c 1054- generate/require checksums for tunneled packets.
1055The
1056.B ocsum
1057flag calculates checksums for outgoing packets.
1058The
1059.B icsum
1060flag requires that all input packets have the correct
a89d5329 1061checksum. The
9abde37c 1062.B csum
1063flag is equivalent to the combination
1064.BR "icsum ocsum" .
1065
1066.sp
1067.BI hoplimit " TTL"
1068- specifies Hop Limit value to use in outgoing packets.
1069
1070.sp
1071.BI encaplimit " ELIM"
a89d5329 1072- specifies a fixed encapsulation limit. Default is 4.
9abde37c 1073
1074.sp
1075.BI flowlabel " FLOWLABEL"
63f60e3a 1076- specifies a fixed flowlabel.
9abde37c 1077
f798a8ab
PM
1078.sp
1079.BI [no]allow-localremote
1080- specifies whether to allow remote endpoint to have an address configured on
1081local host.
1082
9abde37c 1083.sp
1084.BI tclass " TCLASS"
1085- specifies the traffic class field on
1086tunneled packets, which can be specified as either a two-digit
1087hex value (e.g. c0) or a predefined string (e.g. internet).
1088The value
1089.B inherit
1090causes the field to be copied from the original IP header. The
1091values
1092.BI "inherit/" STRING
1093or
1094.BI "inherit/" 00 ".." ff
1095will set the field to
1096.I STRING
1097or
1098.IR 00 ".." ff
1099when tunneling non-IP packets. The default value is 00.
1100
6231c5be
WT
1101.sp
1102.RB external
1103- make this tunnel externally controlled (or not, which is the default).
1104In the kernel, this is referred to as collect metadata mode. This flag is
1105mutually exclusive with the
1106.BR remote ,
1107.BR local ,
1108.BR seq ,
1109.BR key,
1110.BR csum,
1111.BR hoplimit,
1112.BR encaplimit,
1113.BR flowlabel " and " tclass
1114options.
1115
9abde37c 1116.in -8
1117
8ca8fac7
OG
1118.TP
1119IPoIB Type Support
1120For a link of type
1121.I IPoIB
1122the following additional arguments are supported:
1123
1124.BI "ip link add " DEVICE " name " NAME
52a59869 1125.BR "type ipoib " [ " pkey \fIPKEY" " ] [ " mode " \fIMODE \fR]"
8ca8fac7
OG
1126
1127.in +8
1128.sp
1129.BI pkey " PKEY "
1130- specifies the IB P-Key to use.
1131
1132.BI mode " MODE "
1133- specifies the mode (datagram or connected) to use.
1134
28976362
WT
1135.TP
1136ERSPAN Type Support
1137For a link of type
1138.I ERSPAN/IP6ERSPAN
1139the following additional arguments are supported:
1140
1141.BI "ip link add " DEVICE
1142.BR type " { " erspan " | " ip6erspan " }"
1143.BI remote " ADDR " local " ADDR " seq
1144.RB key
1145.I KEY
1146.BR erspan_ver " \fIversion "
1147[
1148.BR erspan " \fIIDX "
1149] [
1150.BR erspan_dir " { " \fIingress " | " \fIegress " }"
1151] [
1152.BR erspan_hwid " \fIhwid "
1153] [
f798a8ab
PM
1154.BI "[no]allow-localremote"
1155] [
28976362
WT
1156.RB external
1157]
1158
1159.in +8
1160.sp
1161.BI remote " ADDR "
1162- specifies the remote address of the tunnel.
1163
1164.sp
1165.BI local " ADDR "
1166- specifies the fixed local address for tunneled packets.
1167It must be an address on another interface on this host.
1168
1169.sp
1170.BR erspan_ver " \fIversion "
1171- specifies the ERSPAN version number.
1172.IR version
846b6b2d
WT
1173indicates the ERSPAN version to be created: 0 for version 0 type I,
11741 for version 1 (type II) or 2 for version 2 (type III).
28976362
WT
1175
1176.sp
1177.BR erspan " \fIIDX "
1178- specifies the ERSPAN v1 index field.
1179.IR IDX
1180indicates a 20 bit index/port number associated with the ERSPAN
1181traffic's source port and direction.
1182
1183.sp
1184.BR erspan_dir " { " \fIingress " | " \fIegress " }"
1185- specifies the ERSPAN v2 mirrored traffic's direction.
1186
1187.sp
1188.BR erspan_hwid " \fIhwid "
1189- an unique identifier of an ERSPAN v2 engine within a system.
1190.IR hwid
1191is a 6-bit value for users to configure.
1192
f798a8ab
PM
1193.sp
1194.BI [no]allow-localremote
1195- specifies whether to allow remote endpoint to have an address configured on
1196local host.
1197
28976362
WT
1198.sp
1199.BR external
1200- make this tunnel externally controlled (or not, which is the default).
1201In the kernel, this is referred to as collect metadata mode. This flag is
1202mutually exclusive with the
1203.BR remote ,
1204.BR local ,
1205.BR erspan_ver ,
1206.BR erspan ,
1207.BR erspan_dir " and " erspan_hwid
1208options.
1209
1210.in -8
1211
c1a1d8bc
JL
1212.TP
1213GENEVE Type Support
1214For a link of type
1215.I GENEVE
1216the following additional arguments are supported:
1217
1218.BI "ip link add " DEVICE
52a59869 1219.BI type " geneve " id " VNI " remote " IPADDR"
1ab0f02f 1220[
f4c05c2e 1221.BI ttl " TTL "
1ab0f02f 1222] [
f4739b2e 1223.BI tos " TOS "
29bb2373 1224] [
64dbd03e
SB
1225.BI df " DF "
1226] [
29bb2373 1227.BI flowlabel " FLOWLABEL "
7e33b093
PS
1228] [
1229.BI dstport " PORT"
1230] [
1231.RB [ no ] external
1232] [
1233.RB [ no ] udpcsum
1234] [
1235.RB [ no ] udp6zerocsumtx
1236] [
1237.RB [ no ] udp6zerocsumrx
1ab0f02f 1238]
c1a1d8bc
JL
1239
1240.in +8
1241.sp
1242.BI id " VNI "
1243- specifies the Virtual Network Identifer to use.
1244
1245.sp
1246.BI remote " IPADDR"
1247- specifies the unicast destination IP address to use in outgoing packets.
1248
f4c05c2e
JL
1249.sp
1250.BI ttl " TTL"
35b857f9
HL
1251- specifies the TTL value to use in outgoing packets. "0" or "auto" means
1252use whatever default value, "inherit" means inherit the inner protocol's
1253ttl. Default option is "0".
f4c05c2e 1254
f4739b2e
JL
1255.sp
1256.BI tos " TOS"
1257- specifies the TOS value to use in outgoing packets.
1258
64dbd03e
SB
1259.sp
1260.BI df " DF"
1261- specifies the usage of the Don't Fragment flag (DF) bit in outgoing packets
1262with IPv4 headers. The value
1263.B inherit
1264causes the bit to be copied from the original IP header. The values
1265.B unset
1266and
1267.B set
1268cause the bit to be always unset or always set, respectively. By default, the
1269bit is not set.
1270
29bb2373
DB
1271.sp
1272.BI flowlabel " FLOWLABEL"
1273- specifies the flow label to use in outgoing packets.
1274
7e33b093
PS
1275.sp
1276.BI dstport " PORT"
1277- select a destination port other than the default of 6081.
1278
1279.sp
1280.RB [ no ] external
1281- make this tunnel externally controlled (or not, which is the default). This
1282flag is mutually exclusive with the
1283.BR id ,
1284.BR remote ,
1285.BR ttl ,
1286.BR tos " and " flowlabel
1287options.
1288
1289.sp
1290.RB [ no ] udpcsum
1291- specifies if UDP checksum is calculated for transmitted packets over IPv4.
1292
1293.sp
1294.RB [ no ] udp6zerocsumtx
1295- skip UDP checksum calculation for transmitted packets over IPv6.
1296
1297.sp
1298.RB [ no ] udp6zerocsumrx
1299- allow incoming UDP packets over IPv6 with zero checksum field.
1300
c1a1d8bc
JL
1301.in -8
1302
a6c5c952
GN
1303.TP
1304Bareudp Type Support
1305For a link of type
1306.I Bareudp
1307the following additional arguments are supported:
1308
1309.BI "ip link add " DEVICE
1310.BI type " bareudp " dstport " PORT " ethertype " ETHERTYPE"
1311[
1312.BI srcportmin " SRCPORTMIN "
1313] [
1314.RB [ no ] multiproto
1315]
1316
1317.in +8
1318.sp
1319.BI dstport " PORT"
1320- specifies the destination port for the UDP tunnel.
1321
1322.sp
1323.BI ethertype " ETHERTYPE"
1324- specifies the ethertype of the L3 protocol being tunnelled.
1325
1326.sp
1327.BI srcportmin " SRCPORTMIN"
1328- selects the lowest value of the UDP tunnel source port range.
1329
1330.sp
1331.RB [ no ] multiproto
1332- activates support for protocols similar to the one
1333.RB "specified by " ethertype .
1334When
1335.I ETHERTYPE
1336is "mpls_uc" (that is, unicast MPLS), this allows the tunnel to also handle
1337multicast MPLS.
1338When
1339.I ETHERTYPE
1340is "ipv4", this allows the tunnel to also handle IPv6. This option is disabled
1341by default.
1342
a60223bc
PS
1343.TP
1344MACVLAN and MACVTAP Type Support
1345For a link of type
1346.I MACVLAN
1347or
1348.I MACVTAP
1349the following additional arguments are supported:
1350
1351.BI "ip link add link " DEVICE " name " NAME
1352.BR type " { " macvlan " | " macvtap " } "
1353.BR mode " { " private " | " vepa " | " bridge " | " passthru
aa1b44ca 1354.RB " [ " nopromisc " ] | " source " } "
a60223bc
PS
1355
1356.in +8
1357.sp
1358.BR type " { " macvlan " | " macvtap " } "
1359- specifies the link type to use.
1360.BR macvlan " creates just a virtual interface, while "
1361.BR macvtap " in addition creates a character device "
1362.BR /dev/tapX " to be used just like a " tuntap " device."
1363
1364.B mode private
1365- Do not allow communication between
1366.B macvlan
1367instances on the same physical interface, even if the external switch supports
1368hairpin mode.
1369
1370.B mode vepa
1371- Virtual Ethernet Port Aggregator mode. Data from one
1372.B macvlan
1373instance to the other on the same physical interface is transmitted over the
1374physical interface. Either the attached switch needs to support hairpin mode,
1375or there must be a TCP/IP router forwarding the packets in order to allow
1376communication. This is the default mode.
1377
1378.B mode bridge
1379- In bridge mode, all endpoints are directly connected to each other,
1380communication is not redirected through the physical interface's peer.
1381
1382.BR mode " " passthru " [ " nopromisc " ] "
1383- This mode gives more power to a single endpoint, usually in
1384.BR macvtap " mode. It is not allowed for more than one endpoint on the same "
1385physical interface. All traffic will be forwarded to this endpoint, allowing
1386virtio guests to change MAC address or set promiscuous mode in order to bridge
1387the interface or create vlan interfaces on top of it. By default, this mode
1388forces the underlying interface into promiscuous mode. Passing the
1389.BR nopromisc " flag prevents this, so the promisc flag may be controlled "
1390using standard tools.
aa1b44ca 1391
1392.B mode source
1393- allows one to set a list of allowed mac address, which is used to match
1394against source mac address from received frames on underlying interface. This
1395allows creating mac based VLAN associations, instead of standard port or tag
1396based. The feature is useful to deploy 802.1x mac based behavior,
1397where drivers of underlying interfaces doesn't allows that.
a60223bc
PS
1398.in -8
1399
9b3c971a
PH
1400.TP
1401High-availability Seamless Redundancy (HSR) Support
1402For a link of type
1403.I HSR
1404the following additional arguments are supported:
1405
52a59869 1406.BI "ip link add link " DEVICE " name " NAME " type hsr"
9b3c971a 1407.BI slave1 " SLAVE1-IF " slave2 " SLAVE2-IF "
52a59869
PS
1408.RB [ " supervision"
1409.IR ADDR-BYTE " ] ["
ea6aeeb9
MK
1410.BR version " { " 0 " | " 1 " } ["
1411.BR proto " { " 0 " | " 1 " } ]"
9b3c971a
PH
1412
1413.in +8
1414.sp
1415.BR type " hsr "
1416- specifies the link type to use, here HSR.
1417
1418.BI slave1 " SLAVE1-IF "
1419- Specifies the physical device used for the first of the two ring ports.
1420
1421.BI slave2 " SLAVE2-IF "
1422- Specifies the physical device used for the second of the two ring ports.
1423
52a59869 1424.BI supervision " ADDR-BYTE"
9b3c971a
PH
1425- The last byte of the multicast address used for HSR supervision frames.
1426Default option is "0", possible values 0-255.
1427
52a59869 1428.BR version " { " 0 " | " 1 " }"
9b3c971a
PH
1429- Selects the protocol version of the interface. Default option is "0", which
1430corresponds to the 2010 version of the HSR standard. Option "1" activates the
14312012 version.
ea6aeeb9
MK
1432
1433.BR proto " { " 0 " | " 1 " }"
1434- Selects the protocol at the interface. Default option is "0", which
1435corresponds to the HSR standard. Option "1" activates the Parallel
1436Redundancy Protocol (PRP).
1437.
9b3c971a
PH
1438.in -8
1439
3fbb5d43
SD
1440.TP
1441BRIDGE Type Support
1442For a link of type
1443.I BRIDGE
1444the following additional arguments are supported:
1445
1446.BI "ip link add " DEVICE " type bridge "
1447[
1448.BI ageing_time " AGEING_TIME "
1449] [
1450.BI group_fwd_mask " MASK "
1451] [
1452.BI group_address " ADDRESS "
1453] [
1454.BI forward_delay " FORWARD_DELAY "
1455] [
1456.BI hello_time " HELLO_TIME "
1457] [
1458.BI max_age " MAX_AGE "
1459] [
1460.BI stp_state " STP_STATE "
1461] [
1462.BI priority " PRIORITY "
1463] [
1464.BI vlan_filtering " VLAN_FILTERING "
1465] [
1466.BI vlan_protocol " VLAN_PROTOCOL "
1467] [
1468.BI vlan_default_pvid " VLAN_DEFAULT_PVID "
1469] [
1470.BI vlan_stats_enabled " VLAN_STATS_ENABLED "
1471] [
90306a14
NA
1472.BI vlan_stats_per_port " VLAN_STATS_PER_PORT "
1473] [
3fbb5d43
SD
1474.BI mcast_snooping " MULTICAST_SNOOPING "
1475] [
1476.BI mcast_router " MULTICAST_ROUTER "
1477] [
1478.BI mcast_query_use_ifaddr " MCAST_QUERY_USE_IFADDR "
1479] [
1480.BI mcast_querier " MULTICAST_QUERIER "
1481] [
1482.BI mcast_hash_elasticity " HASH_ELASTICITY "
1483] [
1484.BI mcast_hash_max " HASH_MAX "
1485] [
1486.BI mcast_last_member_count " LAST_MEMBER_COUNT "
1487] [
1488.BI mcast_startup_query_count " STARTUP_QUERY_COUNT "
1489] [
1490.BI mcast_last_member_interval " LAST_MEMBER_INTERVAL "
1491] [
1492.BI mcast_membership_interval " MEMBERSHIP_INTERVAL "
1493] [
1494.BI mcast_querier_interval " QUERIER_INTERVAL "
1495] [
1496.BI mcast_query_interval " QUERY_INTERVAL "
1497] [
1498.BI mcast_query_response_interval " QUERY_RESPONSE_INTERVAL "
1499] [
1500.BI mcast_startup_query_interval " STARTUP_QUERY_INTERVAL "
1501] [
1502.BI mcast_stats_enabled " MCAST_STATS_ENABLED "
1503] [
1504.BI mcast_igmp_version " IGMP_VERSION "
1505] [
1506.BI mcast_mld_version " MLD_VERSION "
1507] [
1508.BI nf_call_iptables " NF_CALL_IPTABLES "
1509] [
1510.BI nf_call_ip6tables " NF_CALL_IP6TABLES "
1511] [
1512.BI nf_call_arptables " NF_CALL_ARPTABLES "
1513]
1514
1515.in +8
1516.sp
1517.BI ageing_time " AGEING_TIME "
f76ad635
SH
1518- configure the bridge's FDB entries ageing time, ie the number of
1519seconds a MAC address will be kept in the FDB after a packet has been
1520received from that address. after this time has passed, entries are
1521cleaned up.
3fbb5d43
SD
1522
1523.BI group_fwd_mask " MASK "
f76ad635
SH
1524- set the group forward mask. This is the bitmask that is applied to
1525decide whether to forward incoming frames destined to link-local
1526addresses, ie addresses of the form 01:80:C2:00:00:0X (defaults to 0,
1527ie the bridge does not forward any link-local frames).
3fbb5d43
SD
1528
1529.BI group_address " ADDRESS "
f76ad635
SH
1530- set the MAC address of the multicast group this bridge uses for STP.
1531The address must be a link-local address in standard Ethernet MAC
1532address format, ie an address of the form 01:80:C2:00:00:0X, with X
1533 in [0, 4..f].
3fbb5d43
SD
1534
1535.BI forward_delay " FORWARD_DELAY "
f76ad635
SH
1536- set the forwarding delay in seconds, ie the time spent in LISTENING
1537state (before moving to LEARNING) and in LEARNING state (before
1538moving to FORWARDING). Only relevant if STP is enabled. Valid values
1539are between 2 and 30.
3fbb5d43
SD
1540
1541.BI hello_time " HELLO_TIME "
f76ad635
SH
1542- set the time in seconds between hello packets sent by the bridge,
1543when it is a root bridge or a designated bridges.
1544Only relevant if STP is enabled. Valid values are between 1 and 10.
3fbb5d43
SD
1545
1546.BI max_age " MAX_AGE "
f76ad635
SH
1547- set the hello packet timeout, ie the time in seconds until another
1548bridge in the spanning tree is assumed to be dead, after reception of
1549its last hello message. Only relevant if STP is enabled. Valid values
1550are between 6 and 40.
3fbb5d43
SD
1551
1552.BI stp_state " STP_STATE "
1553- turn spanning tree protocol on
1554.RI ( STP_STATE " > 0) "
1555or off
1556.RI ( STP_STATE " == 0). "
1557for this bridge.
1558
1559.BI priority " PRIORITY "
f76ad635
SH
1560- set this bridge's spanning tree priority, used during STP root
1561bridge election.
3fbb5d43
SD
1562.I PRIORITY
1563is a 16bit unsigned integer.
1564
1565.BI vlan_filtering " VLAN_FILTERING "
1566- turn VLAN filtering on
1567.RI ( VLAN_FILTERING " > 0) "
1568or off
1569.RI ( VLAN_FILTERING " == 0). "
1570When disabled, the bridge will not consider the VLAN tag when handling packets.
1571
1572.BR vlan_protocol " { " 802.1Q " | " 802.1ad " } "
1573- set the protocol used for VLAN filtering.
1574
1575.BI vlan_default_pvid " VLAN_DEFAULT_PVID "
1576- set the default PVID (native/untagged VLAN ID) for this bridge.
1577
1578.BI vlan_stats_enabled " VLAN_STATS_ENABLED "
1579- enable
1580.RI ( VLAN_STATS_ENABLED " == 1) "
1581or disable
1582.RI ( VLAN_STATS_ENABLED " == 0) "
1583per-VLAN stats accounting.
1584
90306a14
NA
1585.BI vlan_stats_per_port " VLAN_STATS_PER_PORT "
1586- enable
1587.RI ( VLAN_STATS_PER_PORT " == 1) "
1588or disable
1589.RI ( VLAN_STATS_PER_PORT " == 0) "
1590per-VLAN per-port stats accounting. Can be changed only when there are no port VLANs configured.
1591
3fbb5d43
SD
1592.BI mcast_snooping " MULTICAST_SNOOPING "
1593- turn multicast snooping on
1594.RI ( MULTICAST_SNOOPING " > 0) "
1595or off
1596.RI ( MULTICAST_SNOOPING " == 0). "
1597
1598.BI mcast_router " MULTICAST_ROUTER "
1599- set bridge's multicast router if IGMP snooping is enabled.
1600.I MULTICAST_ROUTER
1601is an integer value having the following meaning:
1602.in +8
1603.sp
1604.B 0
1605- disabled.
1606
1607.B 1
1608- automatic (queried).
1609
1610.B 2
1611- permanently enabled.
1612.in -8
1613
1614.BI mcast_query_use_ifaddr " MCAST_QUERY_USE_IFADDR "
1615- whether to use the bridge's own IP address as source address for IGMP queries
1616.RI ( MCAST_QUERY_USE_IFADDR " > 0) "
1617or the default of 0.0.0.0
1618.RI ( MCAST_QUERY_USE_IFADDR " == 0). "
1619
1620.BI mcast_querier " MULTICAST_QUERIER "
1621- enable
1622.RI ( MULTICAST_QUERIER " > 0) "
1623or disable
1624.RI ( MULTICAST_QUERIER " == 0) "
1625IGMP querier, ie sending of multicast queries by the bridge (default: disabled).
1626
1627.BI mcast_querier_interval " QUERIER_INTERVAL "
f76ad635
SH
1628- interval between queries sent by other routers. if no queries are seen
1629after this delay has passed, the bridge will start to send its own queries
1630(as if
3fbb5d43
SD
1631.BI mcast_querier
1632was enabled).
1633
1634.BI mcast_hash_elasticity " HASH_ELASTICITY "
f76ad635
SH
1635- set multicast database hash elasticity, ie the maximum chain length
1636in the multicast hash table (defaults to 4).
3fbb5d43
SD
1637
1638.BI mcast_hash_max " HASH_MAX "
f76ad635
SH
1639- set maximum size of multicast hash table (defaults to 512,
1640value must be a power of 2).
3fbb5d43
SD
1641
1642.BI mcast_last_member_count " LAST_MEMBER_COUNT "
f76ad635
SH
1643- set multicast last member count, ie the number of queries the bridge
1644will send before stopping forwarding a multicast group after a "leave"
1645message has been received (defaults to 2).
3fbb5d43
SD
1646
1647.BI mcast_last_member_interval " LAST_MEMBER_INTERVAL "
f76ad635
SH
1648- interval between queries to find remaining members of a group,
1649after a "leave" message is received.
3fbb5d43
SD
1650
1651.BI mcast_startup_query_count " STARTUP_QUERY_COUNT "
1652- set the number of IGMP queries to send during startup phase (defaults to 2).
1653
1654.BI mcast_startup_query_interval " STARTUP_QUERY_INTERVAL "
1655- interval between queries in the startup phase.
1656
1657.BI mcast_query_interval " QUERY_INTERVAL "
f76ad635
SH
1658- interval between queries sent by the bridge after the end of the
1659startup phase.
3fbb5d43
SD
1660
1661.BI mcast_query_response_interval " QUERY_RESPONSE_INTERVAL "
f76ad635
SH
1662- set the Max Response Time/Maximum Response Delay for IGMP/MLD
1663queries sent by the bridge.
3fbb5d43
SD
1664
1665.BI mcast_membership_interval " MEMBERSHIP_INTERVAL "
f76ad635
SH
1666- delay after which the bridge will leave a group,
1667if no membership reports for this group are received.
3fbb5d43
SD
1668
1669.BI mcast_stats_enabled " MCAST_STATS_ENABLED "
1670- enable
1671.RI ( MCAST_STATS_ENABLED " > 0) "
1672or disable
1673.RI ( MCAST_STATS_ENABLED " == 0) "
1674multicast (IGMP/MLD) stats accounting.
1675
1676.BI mcast_igmp_version " IGMP_VERSION "
1677- set the IGMP version.
1678
1679.BI mcast_mld_version " MLD_VERSION "
1680- set the MLD version.
1681
1682.BI nf_call_iptables " NF_CALL_IPTABLES "
1683- enable
1684.RI ( NF_CALL_IPTABLES " > 0) "
1685or disable
1686.RI ( NF_CALL_IPTABLES " == 0) "
1687iptables hooks on the bridge.
1688
1689.BI nf_call_ip6tables " NF_CALL_IP6TABLES "
1690- enable
1691.RI ( NF_CALL_IP6TABLES " > 0) "
1692or disable
1693.RI ( NF_CALL_IP6TABLES " == 0) "
1694ip6tables hooks on the bridge.
1695
1696.BI nf_call_arptables " NF_CALL_ARPTABLES "
1697- enable
1698.RI ( NF_CALL_ARPTABLES " > 0) "
1699or disable
1700.RI ( NF_CALL_ARPTABLES " == 0) "
1701arptables hooks on the bridge.
1702
1703
c7d6cbaf 1704.in -8
3fbb5d43 1705
b26fc590
SD
1706.TP
1707MACsec Type Support
1708For a link of type
1709.I MACsec
1710the following additional arguments are supported:
1711
1712.BI "ip link add link " DEVICE " name " NAME " type macsec"
5898bd66
DC
1713[ [
1714.BI address " <lladdr>"
1715]
b26fc590
SD
1716.BI port " PORT"
1717|
1718.BI sci " SCI"
1719] [
1720.BI cipher " CIPHER_SUITE"
1721] [
89bb6e67
DC
1722.BR icvlen " { "
1723.IR 8..16 " } ] ["
b26fc590
SD
1724.BR encrypt " {"
1725.BR on " | " off " } ] [ "
1726.BR send_sci " { " on " | " off " } ] ["
c0ab80a4 1727.BR end_station " { " on " | " off " } ] ["
b26fc590
SD
1728.BR scb " { " on " | " off " } ] ["
1729.BR protect " { " on " | " off " } ] ["
1730.BR replay " { " on " | " off " }"
1731.BR window " { "
1732.IR 0..2^32-1 " } ] ["
1733.BR validate " { " strict " | " check " | " disabled " } ] ["
c0ab80a4 1734.BR encodingsa " { "
b26fc590
SD
1735.IR 0..3 " } ]"
1736
1737.in +8
1738.sp
5898bd66
DC
1739.BI address " <lladdr> "
1740- sets the system identifier component of secure channel for this MACsec device.
1741
1742.sp
1743.BI port " PORT "
f76ad635
SH
1744- sets the port number component of secure channel for this MACsec
1745device, in a range from 1 to 65535 inclusive. Numbers with a leading "
17460 " or " 0x " are interpreted as octal and hexadecimal, respectively.
b26fc590
SD
1747
1748.sp
1749.BI sci " SCI "
0330f49e
DC
1750- sets the secure channel identifier for this MACsec device.
1751.I SCI
1752is a 64bit wide number in hexadecimal format.
b26fc590
SD
1753
1754.sp
1755.BI cipher " CIPHER_SUITE "
1756- defines the cipher suite to use.
1757
89bb6e67
DC
1758.sp
1759.BI icvlen " LENGTH "
1760- sets the length of the Integrity Check Value (ICV).
1761
b26fc590
SD
1762.sp
1763.BR "encrypt on " or " encrypt off"
1764- switches between authenticated encryption, or authenticity mode only.
1765
1766.sp
1767.BR "send_sci on " or " send_sci off"
f76ad635
SH
1768- specifies whether the SCI is included in every packet,
1769or only when it is necessary.
b26fc590
SD
1770
1771.sp
c0ab80a4 1772.BR "end_station on " or " end_station off"
b26fc590
SD
1773- sets the End Station bit.
1774
1775.sp
1776.BR "scb on " or " scb off"
1777- sets the Single Copy Broadcast bit.
1778
1779.sp
1780.BR "protect on " or " protect off"
1781- enables MACsec protection on the device.
1782
1783.sp
1784.BR "replay on " or " replay off"
1785- enables replay protection on the device.
1786
1787.in +8
1788
1789.sp
1790.BI window " SIZE "
1791- sets the size of the replay window.
1792
1793.in -8
1794
1795.sp
1796.BR "validate strict " or " validate check " or " validate disabled"
1797- sets the validation mode on the device.
1798
1799.sp
c0ab80a4 1800.BI encodingsa " AN "
b26fc590
SD
1801- sets the active secure association for transmission.
1802
1803.in -8
1804
2a6f9cfa
DA
1805.TP
1806VRF Type Support
1807For a link of type
1808.I VRF
1809the following additional arguments are supported:
1810
1811.BI "ip link add " DEVICE " type vrf table " TABLE
1812
1813.in +8
1814.sp
1815.BR table " table id associated with VRF device"
1816
1817.in -8
1818
46c16a5d
DP
1819.TP
1820RMNET Type Support
1821For a link of type
1822.I RMNET
1823the following additional arguments are supported:
1824
1825.BI "ip link add link " DEVICE " name " NAME " type rmnet mux_id " MUXID
1826
1827.in +8
1828.sp
1829.BI mux_id " MUXID "
1830- specifies the mux identifier for the rmnet device, possible values 1-254.
1831
1832.in -8
1833
286446c1
ME
1834.TP
1835XFRM Type Support
1836For a link of type
1837.I XFRM
1838the following additional arguments are supported:
1839
1840.BI "ip link add " DEVICE " type xfrm dev " PHYS_DEV " [ if_id " IF_ID " ]"
1841
1842.in +8
1843.sp
1844.BI dev " PHYS_DEV "
1845- specifies the underlying physical interface from which transform traffic is sent and received.
1846
1847.sp
1848.BI if_id " IF-ID "
1849- specifies the hexadecimal lookup key used to send traffic to and from specific xfrm
1850policies. Policies must be configured with the same key. If not set, the key defaults to
18510 and will match any policies which similarly do not have a lookup key configuration.
1852
1853.in -8
1854
761a1e60 1855.SS ip link delete - delete virtual link
761a1e60
CT
1856
1857.TP
1858.BI dev " DEVICE "
7f74cf6d
VK
1859specifies the virtual device to act operate on.
1860
1861.TP
1862.BI group " GROUP "
1863specifies the group of virtual links to delete. Group 0 is not allowed to be
1864deleted since it is the default group.
1865
1866.TP
1867.BI type " TYPE "
1868specifies the type of the device.
761a1e60
CT
1869
1870.SS ip link set - change device attributes
1871
f9e9f928
PS
1872.PP
1873.B Warning:
1874If multiple parameter changes are requested,
1875.B ip
1876aborts immediately after any of the changes have failed.
1877This is the only case when
1878.B ip
1879can move the system to an unpredictable state. The solution
1880is to avoid changing several parameters with one
1881.B ip link set
1882call.
ab45d91d
SH
1883The modifier
1884.B change
1885is equivalent to
1886.BR "set" .
1887
f9e9f928 1888
761a1e60
CT
1889.TP
1890.BI dev " DEVICE "
1891.I DEVICE
f76ad635
SH
1892specifies network device to operate on. When configuring SR-IOV
1893Virtual Function (VF) devices, this keyword should specify the
1894associated Physical Function (PF) device.
761a1e60
CT
1895
1896.TP
1897.BI group " GROUP "
1898.I GROUP
1899has a dual role: If both group and dev are present, then move the device to the
a89d5329 1900specified group. If only a group is specified, then the command operates on
761a1e60
CT
1901all devices in that group.
1902
1903.TP
1904.BR up " and " down
1905change the state of the device to
1906.B UP
1907or
1908.BR "DOWN" .
1909
1910.TP
1911.BR "arp on " or " arp off"
1912change the
1913.B NOARP
1914flag on the device.
1915
1916.TP
1917.BR "multicast on " or " multicast off"
1918change the
1919.B MULTICAST
1920flag on the device.
1921
18864827
AK
1922.TP
1923.BR "protodown on " or " protodown off"
1924change the
1925.B PROTODOWN
f76ad635
SH
1926state on the device. Indicates that a protocol error has been detected
1927on the port. Switch drivers can react to this error by doing a phys
1928down on the switch port.
18864827 1929
6fd53b2a
RP
1930.TP
1931.BR "protodown_reason PREASON on " or " off"
1932set
1933.B PROTODOWN
1934reasons on the device. protodown reason bit names can be enumerated under
1935/etc/iproute2/protodown_reasons.d/. possible reasons bits 0-31
1936
761a1e60
CT
1937.TP
1938.BR "dynamic on " or " dynamic off"
1939change the
1940.B DYNAMIC
f76ad635
SH
1941flag on the device. Indicates that address can change when interface
1942goes down (currently
34c8a95c
VK
1943.B NOT
1944used by the Linux).
761a1e60
CT
1945
1946.TP
1947.BI name " NAME"
a89d5329 1948change the name of the device. This operation is not
761a1e60
CT
1949recommended if the device is running or has some addresses
1950already configured.
1951
1952.TP
1953.BI txqueuelen " NUMBER"
1954.TP
1955.BI txqlen " NUMBER"
1956change the transmit queue length of the device.
1957
1958.TP
1959.BI mtu " NUMBER"
1960change the
1961.I MTU
1962of the device.
1963
1964.TP
1965.BI address " LLADDRESS"
1966change the station address of the interface.
1967
1968.TP
1969.BI broadcast " LLADDRESS"
1970.TP
1971.BI brd " LLADDRESS"
1972.TP
1973.BI peer " LLADDRESS"
1974change the link layer broadcast address or the peer address when
1975the interface is
1976.IR "POINTOPOINT" .
1977
1978.TP
36324eba 1979.BI netns " NETNSNAME " \fR| " PID"
761a1e60 1980move the device to the network namespace associated with name
36324eba
VK
1981.IR "NETNSNAME " or
1982.RI process " PID".
1983
1984Some devices are not allowed to change network namespace: loopback, bridge,
130f5496 1985wireless. These are network namespace local devices. In such case
36324eba 1986.B ip
f76ad635
SH
1987tool will return "Invalid argument" error. It is possible to find out
1988if device is local to a single network namespace by checking
36324eba
VK
1989.B netns-local
1990flag in the output of the
1991.BR ethtool ":"
1992
1993.in +8
1994.B ethtool -k
1995.I DEVICE
1996.in -8
1997
1998To change network namespace for wireless devices the
1999.B iw
f76ad635
SH
2000tool can be used. But it allows to change network namespace only for
2001physical devices and by process
36324eba 2002.IR PID .
761a1e60
CT
2003
2004.TP
2005.BI alias " NAME"
2006give the device a symbolic name for easy reference.
2007
503aa4e2
2008.TP
2009.BI group " GROUP"
2010specify the group the device belongs to.
2011The available groups are listed in file
2012.BR "@SYSCONFDIR@/group" .
2013
761a1e60
CT
2014.TP
2015.BI vf " NUM"
2016specify a Virtual Function device to be configured. The associated PF device
2017must be specified using the
2018.B dev
2019parameter.
2020
2021.in +8
2022.BI mac " LLADDRESS"
2023- change the station address for the specified VF. The
2024.B vf
2025parameter must be specified.
2026
2027.sp
2028.BI vlan " VLANID"
2029- change the assigned VLAN for the specified VF. When specified, all traffic
2030sent from the VF will be tagged with the specified VLAN ID. Incoming traffic
2031will be filtered for the specified VLAN ID, and will have all VLAN tags
2032stripped before being passed to the VF. Setting this parameter to 0 disables
2033VLAN tagging and filtering. The
2034.B vf
2035parameter must be specified.
2036
2037.sp
2038.BI qos " VLAN-QOS"
2039- assign VLAN QOS (priority) bits for the VLAN tag. When specified, all VLAN
2040tags transmitted by the VF will include the specified priority bits in the
2041VLAN tag. If not specified, the value is assumed to be 0. Both the
2042.B vf
2043and
2044.B vlan
2045parameters must be specified. Setting both
2046.B vlan
2047and
2048.B qos
2049as 0 disables VLAN tagging and filtering for the VF.
2050
56e9f0ab
MS
2051.sp
2052.BI proto " VLAN-PROTO"
2053- assign VLAN PROTOCOL for the VLAN tag, either 802.1Q or 802.1ad.
f76ad635
SH
2054Setting to 802.1ad, all traffic sent from the VF will be tagged with
2055VLAN S-Tag. Incoming traffic will have VLAN S-Tags stripped before
2056being passed to the VF. Setting to 802.1ad also enables an option to
2057concatenate another VLAN tag, so both S-TAG and C-TAG will be
2058inserted/stripped for outgoing/incoming traffic, respectively. If not
2059specified, the value is assumed to be 802.1Q. Both the
56e9f0ab
MS
2060.B vf
2061and
2062.B vlan
2063parameters must be specified.
2064
761a1e60
CT
2065.sp
2066.BI rate " TXRATE"
f89a2a05
SC
2067-- change the allowed transmit bandwidth, in Mbps, for the specified VF.
2068Setting this parameter to 0 disables rate limiting.
2069.B vf
2070parameter must be specified.
2071Please use new API
2072.B "max_tx_rate"
2073option instead.
2074
2075.sp
2076.BI max_tx_rate " TXRATE"
f76ad635
SH
2077- change the allowed maximum transmit bandwidth, in Mbps, for the
2078specified VF. Setting this parameter to 0 disables rate limiting.
f89a2a05
SC
2079.B vf
2080parameter must be specified.
2081
2082.sp
2083.BI min_tx_rate " TXRATE"
2084- change the allowed minimum transmit bandwidth, in Mbps, for the specified VF.
2085Minimum TXRATE should be always <= Maximum TXRATE.
c7db3921 2086Setting this parameter to 0 disables rate limiting.
761a1e60
CT
2087.B vf
2088parameter must be specified.
2089
2090.sp
2091.BI spoofchk " on|off"
2092- turn packet spoof checking on or off for the specified VF.
63f60e3a 2093.sp
8e45e44b 2094.BI query_rss " on|off"
f76ad635
SH
2095- toggle the ability of querying the RSS configuration of a specific
2096 VF. VF RSS information like RSS hash key may be considered sensitive
2097 on some devices where this information is shared between VF and PF
2098 and thus its querying may be prohibited by default.
8e45e44b 2099.sp
63f60e3a 2100.BI state " auto|enable|disable"
f76ad635
SH
2101- set the virtual link state as seen by the specified VF. Setting to
2102auto means a reflection of the PF link state, enable lets the VF to
2103communicate with other VFs on this host even if the PF link state is
2104down, disable causes the HW to drop any packets sent by the VF.
b6d77d9e
HS
2105.sp
2106.BI trust " on|off"
f76ad635
SH
2107- trust the specified VF user. This enables that VF user can set a
2108specific feature which may impact security and/or
2109performance. (e.g. VF multicast promiscuous mode)
d91fb3f4
EC
2110.sp
2111.BI node_guid " eui64"
5a3ec4ba 2112- configure node GUID for Infiniband VFs.
d91fb3f4
EC
2113.sp
2114.BI port_guid " eui64"
5a3ec4ba 2115- configure port GUID for Infiniband VFs.
761a1e60
CT
2116.in -8
2117
c7272ca7
DB
2118.TP
2119.B xdp object "|" pinned "|" off
a872b870 2120set (or unset) a XDP ("eXpress Data Path") BPF program to run on every
c7272ca7 2121packet at driver level.
a872b870
DB
2122.B ip link
2123output will indicate a
2124.B xdp
2125flag for the networking device. If the driver does not have native XDP
2126support, the kernel will fall back to a slower, driver-independent "generic"
2127XDP variant. The
2128.B ip link
2129output will in that case indicate
2130.B xdpgeneric
2131instead of
2132.B xdp
2133only. If the driver does have native XDP support, but the program is
2134loaded under
2135.B xdpgeneric object "|" pinned
2136then the kernel will use the generic XDP variant instead of the native one.
14683814
JK
2137.B xdpdrv
2138has the opposite effect of requestsing that the automatic fallback to the
2139generic XDP variant be disabled and in case driver is not XDP-capable error
2140should be returned.
2141.B xdpdrv
2142also disables hardware offloads.
1b5e8094
JK
2143.B xdpoffload
2144in ip link output indicates that the program has been offloaded to hardware
2145and can also be used to request the "offload" mode, much like
2146.B xdpgeneric
2147it forces program to be installed specifically in HW/FW of the apater.
c7272ca7
DB
2148
2149.B off
2150(or
2151.B none
2152)
2153- Detaches any currently attached XDP/BPF program from the given device.
2154
2155.BI object " FILE "
2156- Attaches a XDP/BPF program to the given device. The
2157.I FILE
2158points to a BPF ELF file (f.e. generated by LLVM) that contains the BPF
2159program code, map specifications, etc. If a XDP/BPF program is already
2160attached to the given device, an error will be thrown. If no XDP/BPF
2161program is currently attached, the device supports XDP and the program
2162from the BPF ELF file passes the kernel verifier, then it will be attached
2163to the device. If the option
2164.I -force
2165is passed to
2166.B ip
2167then any prior attached XDP/BPF program will be atomically overridden and
2168no error will be thrown in this case. If no
2169.B section
2170option is passed, then the default section name ("prog") will be assumed,
2171otherwise the provided section name will be used. If no
2172.B verbose
2173option is passed, then a verifier log will only be dumped on load error.
2174See also
2175.B EXAMPLES
2176section for usage examples.
2177
2178.BI section " NAME "
2179- Specifies a section name that contains the BPF program code. If no section
2180name is specified, the default one ("prog") will be used. This option is
2181to be passed with the
2182.B object
2183option.
2184
2185.BI verbose
2186- Act in verbose mode. For example, even in case of success, this will
2187print the verifier log in case a program was loaded from a BPF ELF file.
2188
2189.BI pinned " FILE "
2190- Attaches a XDP/BPF program to the given device. The
2191.I FILE
2192points to an already pinned BPF program in the BPF file system. The option
2193.B section
2194doesn't apply here, but otherwise semantics are the same as with the option
2195.B object
2196described already.
2197
761a1e60
CT
2198.TP
2199.BI master " DEVICE"
2200set master device of the device (enslave device).
2201
2202.TP
2203.BI nomaster
2204unset master device of the device (release device).
2205
503aa4e2 2206.TP
8f0777a8
BM
2207.BI addrgenmode " eui64|none|stable_secret|random"
2208set the IPv6 address generation mode
2209
2210.I eui64
2211- use a Modified EUI-64 format interface identifier
2212
2213.I none
2214- disable automatic address generation
2215
2216.I stable_secret
f76ad635
SH
2217- generate the interface identifier based on a preset
2218 /proc/sys/net/ipv6/conf/{default,DEVICE}/stable_secret
8f0777a8
BM
2219
2220.I random
2221- like stable_secret, but auto-generate a new random secret if none is set
503aa4e2
2222
2223.TP
2224.BR "link-netnsid "
2225set peer netnsid for a cross-netns interface
2226
3dd4b893
PS
2227.TP
2228.BI type " ETYPE TYPE_ARGS"
2229Change type-specific settings. For a list of supported types and arguments refer
2230to the description of
2231.B "ip link add"
2232above. In addition to that, it is possible to manipulate settings to slave
2233devices:
2234
2235.TP
2236Bridge Slave Support
2237For a link with master
2238.B bridge
2239the following additional arguments are supported:
2240
2241.B "ip link set type bridge_slave"
2242[
e83435fc
HL
2243.B fdb_flush
2244] [
3dd4b893
PS
2245.BI state " STATE"
2246] [
2247.BI priority " PRIO"
2248] [
2249.BI cost " COST"
2250] [
2251.BR guard " { " on " | " off " }"
2252] [
2253.BR hairpin " { " on " | " off " }"
2254] [
2255.BR fastleave " { " on " | " off " }"
2256] [
2257.BR root_block " { " on " | " off " }"
2258] [
2259.BR learning " { " on " | " off " }"
2260] [
2261.BR flood " { " on " | " off " }"
2262] [
2263.BR proxy_arp " { " on " | " off " }"
2264] [
2265.BR proxy_arp_wifi " { " on " | " off " }"
2266] [
2267.BI mcast_router " MULTICAST_ROUTER"
2268] [
9208b4e7
NA
2269.BR mcast_fast_leave " { " on " | " off "}"
2270] [
fdbdd356
NA
2271.BR mcast_flood " { " on " | " off " }"
2272] [
b5a754b1
TJ
2273.BR mcast_to_unicast " { " on " | " off " }"
2274] [
a5e3f41b
NA
2275.BR group_fwd_mask " MASK"
2276] [
05001bcf 2277.BR neigh_suppress " { " on " | " off " }"
8cfde5c9 2278] [
05001bcf
NA
2279.BR vlan_tunnel " { " on " | " off " }"
2280] [
d13d52d0
NA
2281.BR isolated " { " on " | " off " }"
2282] [
2283.BR backup_port " DEVICE"
2284] [
2285.BR nobackup_port " ]"
3dd4b893
PS
2286
2287.in +8
2288.sp
e83435fc
HL
2289.B fdb_flush
2290- flush bridge slave's fdb dynamic entries.
2291
3dd4b893
PS
2292.BI state " STATE"
2293- Set port state.
2294.I STATE
2295is a number representing the following states:
2296.BR 0 " (disabled),"
2297.BR 1 " (listening),"
2298.BR 2 " (learning),"
2299.BR 3 " (forwarding),"
2300.BR 4 " (blocking)."
2301
2302.BI priority " PRIO"
058d28b4 2303- set port priority (allowed values are between 0 and 63, inclusively).
3dd4b893
PS
2304
2305.BI cost " COST"
058d28b4 2306- set port cost (allowed values are between 1 and 65535, inclusively).
3dd4b893
PS
2307
2308.BR guard " { " on " | " off " }"
2309- block incoming BPDU packets on this port.
2310
2311.BR hairpin " { " on " | " off " }"
2312- enable hairpin mode on this port. This will allow incoming packets on this
2313port to be reflected back.
2314
2315.BR fastleave " { " on " | " off " }"
2316- enable multicast fast leave on this port.
2317
2318.BR root_block " { " on " | " off " }"
2319- block this port from becoming the bridge's root port.
2320
2321.BR learning " { " on " | " off " }"
2322- allow MAC address learning on this port.
2323
2324.BR flood " { " on " | " off " }"
2325- open the flood gates on this port, i.e. forward all unicast frames to this
2326port also. Requires
2327.BR proxy_arp " and " proxy_arp_wifi
2328to be turned off.
2329
2330.BR proxy_arp " { " on " | " off " }"
2331- enable proxy ARP on this port.
2332
2333.BR proxy_arp_wifi " { " on " | " off " }"
2334- enable proxy ARP on this port which meets extended requirements by IEEE
2335802.11 and Hotspot 2.0 specifications.
2336
2337.BI mcast_router " MULTICAST_ROUTER"
2338- configure this port for having multicast routers attached. A port with a
2339multicast router will receive all multicast traffic.
2340.I MULTICAST_ROUTER
2341may be either
2342.B 0
2343to disable multicast routers on this port,
2344.B 1
2345to let the system detect the presence of of routers (this is the default),
2346.B 2
2347to permanently enable multicast traffic forwarding on this port or
2348.B 3
2349to enable multicast routers temporarily on this port, not depending on incoming
2350queries.
2351
2352.BR mcast_fast_leave " { " on " | " off " }"
2353- this is a synonym to the
2354.B fastleave
2355option above.
2356
9208b4e7 2357.BR mcast_flood " { " on " | " off " }"
f76ad635
SH
2358- controls whether a given port will flood multicast traffic for which
2359 there is no MDB entry.
9208b4e7 2360
b5a754b1 2361.BR mcast_to_unicast " { " on " | " off " }"
f76ad635
SH
2362- controls whether a given port will replicate packets using unicast
2363 instead of multicast. By default this flag is off.
b5a754b1 2364
fdbdd356 2365.BI group_fwd_mask " MASK "
f76ad635
SH
2366- set the group forward mask. This is the bitmask that is applied to
2367decide whether to forward incoming frames destined to link-local
2368addresses, ie addresses of the form 01:80:C2:00:00:0X (defaults to
23690, ie the bridge does not forward any link-local frames coming on
2370this port).
fdbdd356 2371
a5e3f41b 2372.BR neigh_suppress " { " on " | " off " }"
f76ad635
SH
2373- controls whether neigh discovery (arp and nd) proxy and suppression
2374is enabled on the port. By default this flag is off.
8cfde5c9
RP
2375
2376.BR vlan_tunnel " { " on " | " off " }"
f76ad635
SH
2377- controls whether vlan to tunnel mapping is enabled on the port. By
2378default this flag is off.
d13d52d0
NA
2379
2380.BI backup_port " DEVICE"
f76ad635
SH
2381- if the port loses carrier all traffic will be redirected to the
2382configured backup port
d13d52d0
NA
2383
2384.BR nobackup_port
2385- removes the currently configured backup port
a5e3f41b 2386
3dd4b893
PS
2387.in -8
2388
2389.TP
2390Bonding Slave Support
2391For a link with master
2392.B bond
2393the following additional arguments are supported:
2394
2395.B "ip link set type bond_slave"
2396[
2397.BI queue_id " ID"
2398]
2399
2400.in +8
2401.sp
2402.BI queue_id " ID"
2403- set the slave's queue ID (a 16bit unsigned value).
2404
2405.in -8
2406
aa1b44ca 2407.TP
2408MACVLAN and MACVTAP Support
2409Modify list of allowed macaddr for link in source mode.
2410
2411.B "ip link set type { macvlan | macvap } "
2412[
2413.BI macaddr " " "" COMMAND " " MACADDR " ..."
2414]
2415
2416Commands:
2417.in +8
2418.B add
2419- add MACADDR to allowed list
2420.sp
2421.B set
2422- replace allowed list
2423.sp
2424.B del
2425- remove MACADDR from allowed list
2426.sp
2427.B flush
2428- flush whole allowed list
2429.sp
2430.in -8
2431
2432
761a1e60
CT
2433.SS ip link show - display device attributes
2434
2435.TP
2436.BI dev " NAME " (default)
2437.I NAME
2438specifies the network device to show.
761a1e60
CT
2439
2440.TP
2441.BI group " GROUP "
2442.I GROUP
2443specifies what group of devices to show.
2444
2445.TP
2446.B up
2447only display running interfaces.
2448
1b944148
VK
2449.TP
2450.BI master " DEVICE "
2451.I DEVICE
2452specifies the master device which enslaves devices to show.
2453
104444c2
DA
2454.TP
2455.BI vrf " NAME "
2456.I NAME
2457speficies the VRF which enslaves devices to show.
2458
712249d8
VK
2459.TP
2460.BI type " TYPE "
2461.I TYPE
2462specifies the type of devices to show.
2463
3462c116
PS
2464Note that the type name is not checked against the list of supported types -
2465instead it is sent as-is to the kernel. Later it is used to filter the returned
2466interface list by comparing it with the relevant attribute in case the kernel
2467didn't filter already. Therefore any string is accepted, but may lead to empty
2468output.
2469
94f1a22a
NA
2470.SS ip link xstats - display extended statistics
2471
2472.TP
2473.BI type " TYPE "
2474.I TYPE
2475specifies the type of devices to display extended statistics for.
2476
837552b4
RS
2477.SS ip link afstats - display address-family specific statistics
2478
2479.TP
2480.BI dev " DEVICE "
2481.I DEVICE
2482specifies the device to display address-family statistics for.
2483
1f299e92 2484.SS ip link help - display help
2485
2486.PP
2487.I "TYPE"
2488specifies which help of link type to dislpay.
2489
032b4f4d
VK
2490.SS
2491.I GROUP
2492may be a number or a string from the file
699589f6 2493.B @SYSCONFDIR@/group
032b4f4d
VK
2494which can be manually filled.
2495
761a1e60
CT
2496.SH "EXAMPLES"
2497.PP
2498ip link show
2499.RS 4
2500Shows the state of all network interfaces on the system.
2501.RE
2502.PP
712249d8
VK
2503ip link show type bridge
2504.RS 4
2505Shows the bridge devices.
2506.RE
2507.PP
2508ip link show type vlan
2509.RS 4
2510Shows the vlan devices.
2511.RE
2512.PP
417b2180
VK
2513ip link show master br0
2514.RS 4
2515Shows devices enslaved by br0
2516.RE
2517.PP
761a1e60
CT
2518ip link set dev ppp0 mtu 1400
2519.RS 4
2520Change the MTU the ppp0 device.
2521.RE
2522.PP
2523ip link add link eth0 name eth0.10 type vlan id 10
2524.RS 4
2525Creates a new vlan device eth0.10 on device eth0.
2526.RE
2527.PP
2528ip link delete dev eth0.10
2529.RS 4
2530Removes vlan device.
2531.RE
2532
1f299e92 2533ip link help gre
2534.RS 4
2535Display help for the gre link type.
90f1df71
TH
2536.RE
2537.PP
2538ip link add name tun1 type ipip remote 192.168.1.1
2539local 192.168.1.2 ttl 225 encap gue encap-sport auto
2540encap-dport 5555 encap-csum encap-remcsum
2541.RS 4
2542Creates an IPIP that is encapsulated with Generic UDP Encapsulation,
2543and the outer UDP checksum and remote checksum offload are enabled.
c7272ca7
DB
2544.RE
2545.PP
2546ip link set dev eth0 xdp obj prog.o
2547.RS 4
2548Attaches a XDP/BPF program to device eth0, where the program is
2549located in prog.o, section "prog" (default section). In case a
2550XDP/BPF program is already attached, throw an error.
2551.RE
2552.PP
2553ip -force link set dev eth0 xdp obj prog.o sec foo
2554.RS 4
2555Attaches a XDP/BPF program to device eth0, where the program is
2556located in prog.o, section "foo". In case a XDP/BPF program is
2557already attached, it will be overridden by the new one.
2558.RE
2559.PP
2560ip -force link set dev eth0 xdp pinned /sys/fs/bpf/foo
2561.RS 4
2562Attaches a XDP/BPF program to device eth0, where the program was
2563previously pinned as an object node into BPF file system under
2564name foo.
2565.RE
2566.PP
2567ip link set dev eth0 xdp off
2568.RS 4
2569If a XDP/BPF program is attached on device eth0, detach it and
2570effectively turn off XDP for device eth0.
2c0feda8
LB
2571.RE
2572.PP
2573ip link add link wpan0 lowpan0 type lowpan
2574.RS 4
2575Creates a 6LoWPAN interface named lowpan0 on the underlying
2576IEEE 802.15.4 device wpan0.
1f299e92 2577.RE
28976362
WT
2578.PP
2579ip link add dev ip6erspan11 type ip6erspan seq key 102
2580local fc00:100::2 remote fc00:100::1
2581erspan_ver 2 erspan_dir ingress erspan_hwid 17
2582.RS 4
2583Creates a IP6ERSPAN version 2 interface named ip6erspan00.
2584.RE
1f299e92 2585
761a1e60
CT
2586.SH SEE ALSO
2587.br
d5910297 2588.BR ip (8),
e612883c 2589.BR ip-netns (8),
ab872442
VK
2590.BR ethtool (8),
2591.BR iptables (8)
761a1e60
CT
2592
2593.SH AUTHOR
2594Original Manpage by Michail Litvak <mci@owl.openwall.com>