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