]> git.proxmox.com Git - mirror_iproute2.git/blame - man/man8/ip-link.8.in
man/man8/tc-flow.8: minor corrections
[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
105.RB "[ " vlan
761a1e60
CT
106.IR VLANID " [ "
107.B qos
ca611d64 108.IR VLAN-QOS " ] ]"
761a1e60 109.br
ca611d64
PS
110.RB "[ " rate
111.IR TXRATE " ]"
112.br
113.RB "[ " max_tx_rate
114.IR TXRATE " ]"
115.br
116.RB "[ " min_tx_rate
117.IR TXRATE " ]"
761a1e60 118.br
ca611d64 119.RB "[ " spoofchk " { " on " | " off " } ]"
503aa4e2 120.br
8e45e44b
PS
121.RB "[ " query_rss " { " on " | " off " } ]"
122.br
ca611d64 123.RB "[ " state " { " auto " | " enable " | " disable " } ]"
503aa4e2 124.br
d91fb3f4
EC
125.RB "[ " trust " { " on " | " off " } ]"
126.br
127.RB "[ " node_guid " eui64 ]"
128.br
129.RB "[ " port_guid " eui64 ] ]"
ca611d64
PS
130.br
131.in -9
132.RB "[ " master
133.IR DEVICE " ]"
134.br
135.RB "[ " nomaster " ]"
136.br
104444c2
DA
137.RB "[ " vrf
138.IR NAME " ]"
139.br
ca611d64 140.RB "[ " addrgenmode " { " eui64 " | " none " | " stable_secret " | " random " } ]"
761a1e60
CT
141
142
143.ti -8
144.B ip link show
145.RI "[ " DEVICE " | "
146.B group
ca611d64
PS
147.IR GROUP " ] ["
148.BR up " ] ["
1b944148 149.B master
ca611d64 150.IR DEVICE " ] ["
712249d8 151.B type
657426c5 152.IR ETYPE " ]"
104444c2
DA
153.B vrf
154.IR NAME " ]"
761a1e60 155
1f299e92 156.ti -8
157.B ip link help
158.RI "[ " TYPE " ]"
159
657426c5
PS
160.ti -8
161.IR TYPE " := [ "
162.BR bridge " | "
163.BR bond " | "
164.BR can " | "
165.BR dummy " | "
166.BR hsr " | "
167.BR ifb " | "
168.BR ipoib " |"
169.BR macvlan " | "
170.BR macvtap " | "
171.BR vcan " | "
172.BR veth " | "
173.BR vlan " | "
174.BR vxlan " |"
175.BR ip6tnl " |"
176.BR ipip " |"
177.BR sit " |"
178.BR gre " |"
179.BR gretap " |"
180.BR ip6gre " |"
181.BR ip6gretap " |"
182.BR vti " |"
183.BR nlmon " |"
184.BR ipvlan " |"
185.BR lowpan " |"
186.BR geneve " |"
187.BR vrf " ]"
188
189.ti -8
190.IR ETYPE " := [ " TYPE " |"
191.BR bridge_slave " | " bond_slave " ]"
192
761a1e60
CT
193.SH "DESCRIPTION"
194.SS ip link add - add virtual link
195
196.TP
197.BI link " DEVICE "
198specifies the physical device to act operate on.
199
200.I NAME
201specifies the name of the new virtual device.
202
203.I TYPE
204specifies the type of the new device.
205.sp
206Link types:
207
208.in +8
f1a6f4e9
SH
209.B bridge
210- Ethernet Bridge device
761a1e60 211.sp
cc26a890
JP
212.B bond
213- Bonding device
503aa4e2
214.B can
215- Controller Area Network interface
cc26a890 216.sp
761a1e60
CT
217.B dummy
218- Dummy network interface
219.sp
2f937359 220.B hsr
221- High-availability Seamless Redundancy device
222.sp
761a1e60
CT
223.B ifb
224- Intermediate Functional Block device
225.sp
f1a6f4e9
SH
226.B ipoib
227- IP over Infiniband device
228.sp
761a1e60 229.B macvlan
f1a6f4e9 230- Virtual interface base on link layer address (MAC)
761a1e60 231.sp
e4c35682
RR
232.B macvtap
233- Virtual interface based on link layer address (MAC) and TAP.
234.sp
f1a6f4e9 235.B vcan
2b70fe15 236- Virtual Controller Area Network interface
761a1e60 237.sp
f1a6f4e9
SH
238.B veth
239- Virtual ethernet interface
de038993 240.sp
f1a6f4e9
SH
241.BR vlan
242- 802.1q tagged virtual LAN interface
243.sp
244.BR vxlan
245- Virtual eXtended LAN
77987911
ND
246.sp
247.BR ip6tnl
248- Virtual tunnel interface IPv4|IPv6 over IPv6
249.sp
250.BR ipip
251- Virtual tunnel interface IPv4 over IPv4
252.sp
253.BR sit
254- Virtual tunnel interface IPv6 over IPv4
9abde37c 255.sp
256.BR gre
257- Virtual tunnel interface GRE over IPv4
258.sp
259.BR gretap
d36d9d41 260- Virtual L2 tunnel interface GRE over IPv4
9abde37c 261.sp
262.BR ip6gre
d36d9d41 263- Virtual tunnel interface GRE over IPv6
9abde37c 264.sp
265.BR ip6gretap
d36d9d41 266- Virtual L2 tunnel interface GRE over IPv6
b6d6b5a1
VK
267.sp
268.BR vti
269- Virtual tunnel interface
270.sp
271.BR nlmon
272- Netlink monitoring device
273.sp
274.BR ipvlan
275- Interface for L3 (IPv6/IPv4) based VLANs
2c0feda8
LB
276.sp
277.BR lowpan
278- Interface for 6LoWPAN (IPv6) over IEEE 802.15.4 / Bluetooth
c1a1d8bc
JL
279.sp
280.BR geneve
281- GEneric NEtwork Virtualization Encapsulation
b26fc590
SD
282.sp
283.BR macsec
284- Interface for IEEE 802.1AE MAC Security (MACsec)
2a6f9cfa
DA
285.sp
286.BR vrf
287- Interface for L3 VRF domains
761a1e60
CT
288.in -8
289
d992f3e6
JP
290.TP
291.BI numtxqueues " QUEUE_COUNT "
292specifies the number of transmit queues for new device.
293
294.TP
295.BI numrxqueues " QUEUE_COUNT "
296specifies the number of receive queues for new device.
297
4de8d885
PE
298.TP
299.BI index " IDX "
300specifies the desired index of the new virtual device. The link creation fails, if the index is busy.
301
503aa4e2
302.TP
303VLAN Type Support
304For a link of type
305.I VLAN
306the following additional arguments are supported:
307
308.BI "ip link add
309.BI link " DEVICE "
310.BI name " NAME "
52a59869 311.B "type vlan"
1ab0f02f 312[
503aa4e2 313.BI protocol " VLAN_PROTO "
1ab0f02f 314]
503aa4e2 315.BI id " VLANID "
1ab0f02f 316[
503aa4e2 317.BR reorder_hdr " { " on " | " off " } "
1ab0f02f
TF
318]
319[
503aa4e2 320.BR gvrp " { " on " | " off " } "
1ab0f02f
TF
321]
322[
503aa4e2 323.BR mvrp " { " on " | " off " } "
1ab0f02f
TF
324]
325[
503aa4e2 326.BR loose_binding " { " on " | " off " } "
1ab0f02f
TF
327]
328[
503aa4e2 329.BI ingress-qos-map " QOS-MAP "
1ab0f02f
TF
330]
331[
503aa4e2 332.BI egress-qos-map " QOS-MAP "
1ab0f02f 333]
503aa4e2
334
335.in +8
336.sp
337.BI protocol " VLAN_PROTO "
338- either 802.1Q or 802.1ad.
339
340.BI id " VLANID "
341- specifies the VLAN Identifer to use. Note that numbers with a leading " 0 " or " 0x " are interpreted as octal or hexadeimal, respectively.
342
343.BR reorder_hdr " { " on " | " off " } "
e612883c
VK
344- specifies whether ethernet headers are reordered or not (default is
345.BR on ")."
346
347.in +4
348If
349.BR reorder_hdr " is " on
350then VLAN header will be not inserted immediately but only before passing to the
351physical device (if this device does not support VLAN offloading), the similar
352on the RX direction - by default the packet will be untagged before being
353received by VLAN device. Reordering allows to accelerate tagging on egress and
354to hide VLAN header on ingress so the packet looks like regular Ethernet packet,
79c7078e 355at the same time it might be confusing for packet capture as the VLAN header
e612883c
VK
356does not exist within the packet.
357
358VLAN offloading can be checked by
359.BR ethtool "(8):"
360.in +4
361.sp
362.B ethtool -k
363<phy_dev> |
364.RB grep " tx-vlan-offload"
365.sp
366.in -4
367where <phy_dev> is the physical device to which VLAN device is bound.
368.in -4
503aa4e2
369
370.BR gvrp " { " on " | " off " } "
371- specifies whether this VLAN should be registered using GARP VLAN Registration Protocol.
372
373.BR mvrp " { " on " | " off " } "
374- specifies whether this VLAN should be registered using Multiple VLAN Registration Protocol.
375
376.BR loose_binding " { " on " | " off " } "
377- specifies whether the VLAN device state is bound to the physical device state.
378
379.BI ingress-qos-map " QOS-MAP "
ab872442
VK
380- defines a mapping of VLAN header prio field to the Linux internal packet
381priority on incoming frames. The format is FROM:TO with multiple mappings
382separated by spaces.
503aa4e2
383
384.BI egress-qos-map " QOS-MAP "
ab872442
VK
385- defines a mapping of Linux internal packet priority to VLAN header prio field
386but for outgoing frames. The format is the same as for ingress-qos-map.
387.in +4
388
389Linux packet priority can be set by
390.BR iptables "(8)":
391.in +4
392.sp
393.B iptables
394-t mangle -A POSTROUTING [...] -j CLASSIFY --set-class 0:4
395.sp
396.in -4
397and this "4" priority can be used in the egress qos mapping to set VLAN prio "5":
398.sp
399.in +4
400.B ip
401link set veth0.10 type vlan egress 4:5
402.in -4
403.in -4
503aa4e2
404.in -8
405
2816a568
TR
406.TP
407VXLAN Type Support
63f60e3a 408For a link of type
2816a568
TR
409.I VXLAN
410the following additional arguments are supported:
411
412.BI "ip link add " DEVICE
52a59869 413.BI type " vxlan " id " VNI"
1ab0f02f 414[
2816a568 415.BI dev " PHYS_DEV "
7cfa3802
AW
416.RB " ] [ { " group " | " remote " } "
417.I IPADDR
1ab0f02f 418] [
5cd64c97
TF
419.B local
420.RI "{ "IPADDR " | "any " } "
1ab0f02f 421] [
2816a568 422.BI ttl " TTL "
1ab0f02f 423] [
2816a568 424.BI tos " TOS "
1ab0f02f 425] [
f8eb79a6
DB
426.BI flowlabel " FLOWLABEL "
427] [
503aa4e2 428.BI dstport " PORT "
1ab0f02f 429] [
503aa4e2 430.BI srcport " MIN MAX "
1ab0f02f 431] [
52a59869 432.RB [ no ] learning
1ab0f02f 433] [
52a59869 434.RB [ no ] proxy
1ab0f02f 435] [
52a59869 436.RB [ no ] rsc
1ab0f02f 437] [
52a59869 438.RB [ no ] l2miss
1ab0f02f 439] [
52a59869 440.RB [ no ] l3miss
1ab0f02f 441] [
52a59869 442.RB [ no ] udpcsum
1ab0f02f 443] [
52a59869 444.RB [ no ] udp6zerocsumtx
1ab0f02f 445] [
52a59869 446.RB [ no ] udp6zerocsumrx
1ab0f02f 447] [
c2fbc57e 448.BI ageing " SECONDS "
1ab0f02f 449] [
c2fbc57e 450.BI maxaddress " NUMBER "
1ab0f02f 451] [
52a59869 452.RB [ no ] external
42d17a61 453] [
2eb90dc7 454.B gbp
346410bd
JB
455] [
456.B gpe
1ab0f02f 457]
2816a568
TR
458
459.in +8
460.sp
461.BI id " VNI "
462- specifies the VXLAN Network Identifer (or VXLAN Segment
463Identifier) to use.
464
465.BI dev " PHYS_DEV"
466- specifies the physical device to use for tunnel endpoint communication.
467
468.sp
469.BI group " IPADDR"
470- specifies the multicast IP address to join.
7cfa3802
AW
471This parameter cannot be specified with the
472.B remote
473parameter.
474
475.sp
476.BI remote " IPADDR"
477- specifies the unicast destination IP address to use in outgoing packets
478when the destination link layer address is not known in the VXLAN device
a89d5329 479forwarding database. This parameter cannot be specified with the
7cfa3802
AW
480.B group
481parameter.
2816a568
TR
482
483.sp
484.BI local " IPADDR"
485- specifies the source IP address to use in outgoing packets.
486
487.sp
488.BI ttl " TTL"
489- specifies the TTL value to use in outgoing packets.
490
491.sp
492.BI tos " TOS"
493- specifies the TOS value to use in outgoing packets.
494
f8eb79a6
DB
495.sp
496.BI flowlabel " FLOWLABEL"
497- specifies the flow label to use in outgoing packets.
498
2816a568 499.sp
503aa4e2
500.BI dstport " PORT"
501- specifies the UDP destination port to communicate to the remote VXLAN tunnel endpoint.
502
503.sp
504.BI srcport " MIN MAX"
2816a568
TR
505- specifies the range of port numbers to use as UDP
506source ports to communicate to the remote VXLAN tunnel endpoint.
507
508.sp
52a59869 509.RB [ no ] learning
2816a568
TR
510- specifies if unknown source link layer addresses and IP addresses
511are entered into the VXLAN device forwarding database.
512
513.sp
52a59869 514.RB [ no ] rsc
2816a568
TR
515- specifies if route short circuit is turned on.
516
517.sp
52a59869 518.RB [ no ] proxy
2816a568
TR
519- specifies ARP proxy is turned on.
520
521.sp
52a59869 522.RB [ no ] l2miss
2816a568
TR
523- specifies if netlink LLADDR miss notifications are generated.
524
525.sp
52a59869 526.RB [ no ] l3miss
2816a568
TR
527- specifies if netlink IP ADDR miss notifications are generated.
528
503aa4e2 529.sp
52a59869 530.RB [ no ] udpcsum
4853ee52 531- specifies if UDP checksum is calculated for transmitted packets over IPv4.
503aa4e2
532
533.sp
52a59869 534.RB [ no ] udp6zerocsumtx
4853ee52 535- skip UDP checksum calculation for transmitted packets over IPv6.
503aa4e2
536
537.sp
52a59869 538.RB [ no ] udp6zerocsumrx
4853ee52 539- allow incoming UDP packets over IPv6 with zero checksum field.
503aa4e2 540
c2fbc57e
ND
541.sp
542.BI ageing " SECONDS"
543- specifies the lifetime in seconds of FDB entries learnt by the kernel.
544
545.sp
546.BI maxaddress " NUMBER"
547- specifies the maximum number of FDB entries.
548
42d17a61 549.sp
52a59869 550.RB [ no ] external
42d17a61
JB
551- specifies whether an external control plane
552.RB "(e.g. " "ip route encap" )
553or the internal FDB should be used.
554
2eb90dc7
TG
555.sp
556.B gbp
557- enables the Group Policy extension (VXLAN-GBP).
558
559.in +4
560Allows to transport group policy context across VXLAN network peers.
561If enabled, includes the mark of a packet in the VXLAN header for outgoing
562packets and fills the packet mark based on the information found in the
563VXLAN header for incomming packets.
564
565Format of upper 16 bits of packet mark (flags);
566
567.in +2
568+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
569.br
570|-|-|-|-|-|-|-|-|-|D|-|-|A|-|-|-|
571.br
572+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
573
574.B D :=
575Don't Learn bit. When set, this bit indicates that the egress
576VTEP MUST NOT learn the source address of the encapsulated frame.
577
578.B A :=
579Indicates that the group policy has already been applied to
580this packet. Policies MUST NOT be applied by devices when the A bit is set.
581.in -2
582
583Format of lower 16 bits of packet mark (policy ID):
584
585.in +2
586+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
587.br
588| Group Policy ID |
589.br
590+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
591.in -2
592
593Example:
594 iptables -A OUTPUT [...] -j MARK --set-mark 0x800FF
595
596.in -4
597
346410bd
JB
598.sp
599.B gpe
600- enables the Generic Protocol extension (VXLAN-GPE). Currently, this is
601only supported together with the
602.B external
603keyword.
604
2816a568
TR
605.in -8
606
90f1df71
TH
607.TP
608GRE, IPIP, SIT Type Support
609For a link of types
610.I GRE/IPIP/SIT
611the following additional arguments are supported:
612
613.BI "ip link add " DEVICE
52a59869 614.BR type " { " gre " | " ipip " | " sit " }"
90f1df71 615.BI " remote " ADDR " local " ADDR
1ab0f02f 616[
52a59869 617.BR encap " { " fou " | " gue " | " none " }"
1ab0f02f 618] [
52a59869 619.BR encap-sport " { " \fIPORT " | " auto " }"
1ab0f02f 620] [
90f1df71 621.BI "encap-dport " PORT
1ab0f02f 622] [
52a59869 623.RB [ no ] encap-csum
1ab0f02f 624] [
52a59869 625.RB [ no ] encap-remcsum
1ab0f02f 626]
90f1df71
TH
627
628.in +8
629.sp
630.BI remote " ADDR "
631- specifies the remote address of the tunnel.
632
633.sp
634.BI local " ADDR "
635- specifies the fixed local address for tunneled packets.
636It must be an address on another interface on this host.
637
638.sp
52a59869 639.BR encap " { " fou " | " gue " | " none " }"
90f1df71
TH
640- specifies type of secondary UDP encapsulation. "fou" indicates
641Foo-Over-UDP, "gue" indicates Generic UDP Encapsulation.
642
643.sp
52a59869 644.BR encap-sport " { " \fIPORT " | " auto " }"
90f1df71
TH
645- specifies the source port in UDP encapsulation.
646.IR PORT
647indicates the port by number, "auto"
648indicates that the port number should be chosen automatically
649(the kernel picks a flow based on the flow hash of the
650encapsulated packet).
651
652.sp
52a59869 653.RB [ no ] encap-csum
90f1df71
TH
654- specifies if UDP checksums are enabled in the secondary
655encapsulation.
656
657.sp
52a59869 658.RB [ no ] encap-remcsum
90f1df71
TH
659- specifies if Remote Checksum Offload is enabled. This is only
660applicable for Generic UDP Encapsulation.
661
662.in -8
663
9abde37c 664.TP
665IP6GRE/IP6GRETAP Type Support
63f60e3a 666For a link of type
9abde37c 667.I IP6GRE/IP6GRETAP
668the following additional arguments are supported:
669
670.BI "ip link add " DEVICE
52a59869
PS
671.BR type " { " ip6gre " | " ip6gretap " }"
672.BI remote " ADDR " local " ADDR"
1ab0f02f 673[
52a59869 674.RB [ i | o ] seq
1ab0f02f 675] [
52a59869
PS
676.RB [ i | o ] key
677.I KEY
1ab0f02f 678] [
52a59869 679.RB [ i | o ] csum
1ab0f02f 680] [
9abde37c 681.BI hoplimit " TTL "
1ab0f02f 682] [
9abde37c 683.BI encaplimit " ELIM "
1ab0f02f 684] [
9abde37c 685.BI tclass " TCLASS "
1ab0f02f 686] [
9abde37c 687.BI flowlabel " FLOWLABEL "
1ab0f02f 688] [
9abde37c 689.BI "dscp inherit"
1ab0f02f 690] [
9abde37c 691.BI dev " PHYS_DEV "
1ab0f02f 692]
9abde37c 693
694.in +8
695.sp
696.BI remote " ADDR "
697- specifies the remote IPv6 address of the tunnel.
698
699.sp
700.BI local " ADDR "
701- specifies the fixed local IPv6 address for tunneled packets.
90f1df71 702It must be an address on another interface on this host.
9abde37c 703
704.sp
52a59869 705.RB [ i | o ] seq
9abde37c 706- serialize packets.
707The
708.B oseq
709flag enables sequencing of outgoing packets.
710The
711.B iseq
712flag requires that all input packets are serialized.
713
714.sp
52a59869 715.RB [ i | o ] key " \fIKEY"
9abde37c 716- use keyed GRE with key
717.IR KEY ". "KEY
718is either a number or an IPv4 address-like dotted quad.
719The
720.B key
721parameter specifies the same key to use in both directions.
722The
723.BR ikey " and " okey
724parameters specify different keys for input and output.
725
726.sp
52a59869 727.RB [ i | o ] csum
9abde37c 728- generate/require checksums for tunneled packets.
729The
730.B ocsum
731flag calculates checksums for outgoing packets.
732The
733.B icsum
734flag requires that all input packets have the correct
a89d5329 735checksum. The
9abde37c 736.B csum
737flag is equivalent to the combination
738.BR "icsum ocsum" .
739
740.sp
741.BI hoplimit " TTL"
742- specifies Hop Limit value to use in outgoing packets.
743
744.sp
745.BI encaplimit " ELIM"
a89d5329 746- specifies a fixed encapsulation limit. Default is 4.
9abde37c 747
748.sp
749.BI flowlabel " FLOWLABEL"
63f60e3a 750- specifies a fixed flowlabel.
9abde37c 751
752.sp
753.BI tclass " TCLASS"
754- specifies the traffic class field on
755tunneled packets, which can be specified as either a two-digit
756hex value (e.g. c0) or a predefined string (e.g. internet).
757The value
758.B inherit
759causes the field to be copied from the original IP header. The
760values
761.BI "inherit/" STRING
762or
763.BI "inherit/" 00 ".." ff
764will set the field to
765.I STRING
766or
767.IR 00 ".." ff
768when tunneling non-IP packets. The default value is 00.
769
770.in -8
771
8ca8fac7
OG
772.TP
773IPoIB Type Support
774For a link of type
775.I IPoIB
776the following additional arguments are supported:
777
778.BI "ip link add " DEVICE " name " NAME
52a59869 779.BR "type ipoib " [ " pkey \fIPKEY" " ] [ " mode " \fIMODE \fR]"
8ca8fac7
OG
780
781.in +8
782.sp
783.BI pkey " PKEY "
784- specifies the IB P-Key to use.
785
786.BI mode " MODE "
787- specifies the mode (datagram or connected) to use.
788
c1a1d8bc
JL
789.TP
790GENEVE Type Support
791For a link of type
792.I GENEVE
793the following additional arguments are supported:
794
795.BI "ip link add " DEVICE
52a59869 796.BI type " geneve " id " VNI " remote " IPADDR"
1ab0f02f 797[
f4c05c2e 798.BI ttl " TTL "
1ab0f02f 799] [
f4739b2e 800.BI tos " TOS "
29bb2373
DB
801] [
802.BI flowlabel " FLOWLABEL "
1ab0f02f 803]
c1a1d8bc
JL
804
805.in +8
806.sp
807.BI id " VNI "
808- specifies the Virtual Network Identifer to use.
809
810.sp
811.BI remote " IPADDR"
812- specifies the unicast destination IP address to use in outgoing packets.
813
f4c05c2e
JL
814.sp
815.BI ttl " TTL"
816- specifies the TTL value to use in outgoing packets.
817
f4739b2e
JL
818.sp
819.BI tos " TOS"
820- specifies the TOS value to use in outgoing packets.
821
29bb2373
DB
822.sp
823.BI flowlabel " FLOWLABEL"
824- specifies the flow label to use in outgoing packets.
825
c1a1d8bc
JL
826.in -8
827
a60223bc
PS
828.TP
829MACVLAN and MACVTAP Type Support
830For a link of type
831.I MACVLAN
832or
833.I MACVTAP
834the following additional arguments are supported:
835
836.BI "ip link add link " DEVICE " name " NAME
837.BR type " { " macvlan " | " macvtap " } "
838.BR mode " { " private " | " vepa " | " bridge " | " passthru
52a59869 839.RB " [ " nopromisc " ] } "
a60223bc
PS
840
841.in +8
842.sp
843.BR type " { " macvlan " | " macvtap " } "
844- specifies the link type to use.
845.BR macvlan " creates just a virtual interface, while "
846.BR macvtap " in addition creates a character device "
847.BR /dev/tapX " to be used just like a " tuntap " device."
848
849.B mode private
850- Do not allow communication between
851.B macvlan
852instances on the same physical interface, even if the external switch supports
853hairpin mode.
854
855.B mode vepa
856- Virtual Ethernet Port Aggregator mode. Data from one
857.B macvlan
858instance to the other on the same physical interface is transmitted over the
859physical interface. Either the attached switch needs to support hairpin mode,
860or there must be a TCP/IP router forwarding the packets in order to allow
861communication. This is the default mode.
862
863.B mode bridge
864- In bridge mode, all endpoints are directly connected to each other,
865communication is not redirected through the physical interface's peer.
866
867.BR mode " " passthru " [ " nopromisc " ] "
868- This mode gives more power to a single endpoint, usually in
869.BR macvtap " mode. It is not allowed for more than one endpoint on the same "
870physical interface. All traffic will be forwarded to this endpoint, allowing
871virtio guests to change MAC address or set promiscuous mode in order to bridge
872the interface or create vlan interfaces on top of it. By default, this mode
873forces the underlying interface into promiscuous mode. Passing the
874.BR nopromisc " flag prevents this, so the promisc flag may be controlled "
875using standard tools.
876.in -8
877
9b3c971a
PH
878.TP
879High-availability Seamless Redundancy (HSR) Support
880For a link of type
881.I HSR
882the following additional arguments are supported:
883
52a59869 884.BI "ip link add link " DEVICE " name " NAME " type hsr"
9b3c971a 885.BI slave1 " SLAVE1-IF " slave2 " SLAVE2-IF "
52a59869
PS
886.RB [ " supervision"
887.IR ADDR-BYTE " ] ["
888.BR version " { " 0 " | " 1 " } ]"
9b3c971a
PH
889
890.in +8
891.sp
892.BR type " hsr "
893- specifies the link type to use, here HSR.
894
895.BI slave1 " SLAVE1-IF "
896- Specifies the physical device used for the first of the two ring ports.
897
898.BI slave2 " SLAVE2-IF "
899- Specifies the physical device used for the second of the two ring ports.
900
52a59869 901.BI supervision " ADDR-BYTE"
9b3c971a
PH
902- The last byte of the multicast address used for HSR supervision frames.
903Default option is "0", possible values 0-255.
904
52a59869 905.BR version " { " 0 " | " 1 " }"
9b3c971a
PH
906- Selects the protocol version of the interface. Default option is "0", which
907corresponds to the 2010 version of the HSR standard. Option "1" activates the
9082012 version.
909.in -8
910
b26fc590
SD
911.TP
912MACsec Type Support
913For a link of type
914.I MACsec
915the following additional arguments are supported:
916
917.BI "ip link add link " DEVICE " name " NAME " type macsec"
918[
919.BI port " PORT"
920|
921.BI sci " SCI"
922] [
923.BI cipher " CIPHER_SUITE"
924] [
925.BR encrypt " {"
926.BR on " | " off " } ] [ "
927.BR send_sci " { " on " | " off " } ] ["
928.BR es " { " on " | " off " } ] ["
929.BR scb " { " on " | " off " } ] ["
930.BR protect " { " on " | " off " } ] ["
931.BR replay " { " on " | " off " }"
932.BR window " { "
933.IR 0..2^32-1 " } ] ["
934.BR validate " { " strict " | " check " | " disabled " } ] ["
935.BR encoding " { "
936.IR 0..3 " } ]"
937
938.in +8
939.sp
940.BI port " PORT "
941- sets the port number for this MACsec device.
942
943.sp
944.BI sci " SCI "
945- sets the SCI for this MACsec device.
946
947.sp
948.BI cipher " CIPHER_SUITE "
949- defines the cipher suite to use.
950
951.sp
952.BR "encrypt on " or " encrypt off"
953- switches between authenticated encryption, or authenticity mode only.
954
955.sp
956.BR "send_sci on " or " send_sci off"
957- specifies whether the SCI is included in every packet, or only when it is necessary.
958
959.sp
960.BR "es on " or " es off"
961- sets the End Station bit.
962
963.sp
964.BR "scb on " or " scb off"
965- sets the Single Copy Broadcast bit.
966
967.sp
968.BR "protect on " or " protect off"
969- enables MACsec protection on the device.
970
971.sp
972.BR "replay on " or " replay off"
973- enables replay protection on the device.
974
975.in +8
976
977.sp
978.BI window " SIZE "
979- sets the size of the replay window.
980
981.in -8
982
983.sp
984.BR "validate strict " or " validate check " or " validate disabled"
985- sets the validation mode on the device.
986
987.sp
988.BI encoding " AN "
989- sets the active secure association for transmission.
990
991.in -8
992
2a6f9cfa
DA
993.TP
994VRF Type Support
995For a link of type
996.I VRF
997the following additional arguments are supported:
998
999.BI "ip link add " DEVICE " type vrf table " TABLE
1000
1001.in +8
1002.sp
1003.BR table " table id associated with VRF device"
1004
1005.in -8
1006
761a1e60 1007.SS ip link delete - delete virtual link
761a1e60
CT
1008
1009.TP
1010.BI dev " DEVICE "
7f74cf6d
VK
1011specifies the virtual device to act operate on.
1012
1013.TP
1014.BI group " GROUP "
1015specifies the group of virtual links to delete. Group 0 is not allowed to be
1016deleted since it is the default group.
1017
1018.TP
1019.BI type " TYPE "
1020specifies the type of the device.
761a1e60
CT
1021
1022.SS ip link set - change device attributes
1023
f9e9f928
PS
1024.PP
1025.B Warning:
1026If multiple parameter changes are requested,
1027.B ip
1028aborts immediately after any of the changes have failed.
1029This is the only case when
1030.B ip
1031can move the system to an unpredictable state. The solution
1032is to avoid changing several parameters with one
1033.B ip link set
1034call.
1035
761a1e60
CT
1036.TP
1037.BI dev " DEVICE "
1038.I DEVICE
6274b0b7 1039specifies network device to operate on. When configuring SR-IOV Virtual Function
761a1e60
CT
1040(VF) devices, this keyword should specify the associated Physical Function (PF)
1041device.
1042
1043.TP
1044.BI group " GROUP "
1045.I GROUP
1046has a dual role: If both group and dev are present, then move the device to the
a89d5329 1047specified group. If only a group is specified, then the command operates on
761a1e60
CT
1048all devices in that group.
1049
1050.TP
1051.BR up " and " down
1052change the state of the device to
1053.B UP
1054or
1055.BR "DOWN" .
1056
1057.TP
1058.BR "arp on " or " arp off"
1059change the
1060.B NOARP
1061flag on the device.
1062
1063.TP
1064.BR "multicast on " or " multicast off"
1065change the
1066.B MULTICAST
1067flag on the device.
1068
18864827
AK
1069.TP
1070.BR "protodown on " or " protodown off"
1071change the
1072.B PROTODOWN
1073state 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.
1074
761a1e60
CT
1075.TP
1076.BR "dynamic on " or " dynamic off"
1077change the
1078.B DYNAMIC
34c8a95c
VK
1079flag on the device. Indicates that address can change when interface goes down (currently
1080.B NOT
1081used by the Linux).
761a1e60
CT
1082
1083.TP
1084.BI name " NAME"
a89d5329 1085change the name of the device. This operation is not
761a1e60
CT
1086recommended if the device is running or has some addresses
1087already configured.
1088
1089.TP
1090.BI txqueuelen " NUMBER"
1091.TP
1092.BI txqlen " NUMBER"
1093change the transmit queue length of the device.
1094
1095.TP
1096.BI mtu " NUMBER"
1097change the
1098.I MTU
1099of the device.
1100
1101.TP
1102.BI address " LLADDRESS"
1103change the station address of the interface.
1104
1105.TP
1106.BI broadcast " LLADDRESS"
1107.TP
1108.BI brd " LLADDRESS"
1109.TP
1110.BI peer " LLADDRESS"
1111change the link layer broadcast address or the peer address when
1112the interface is
1113.IR "POINTOPOINT" .
1114
1115.TP
36324eba 1116.BI netns " NETNSNAME " \fR| " PID"
761a1e60 1117move the device to the network namespace associated with name
36324eba
VK
1118.IR "NETNSNAME " or
1119.RI process " PID".
1120
1121Some devices are not allowed to change network namespace: loopback, bridge,
1122ppp, wireless. These are network namespace local devices. In such case
1123.B ip
1124tool will return "Invalid argument" error. It is possible to find out if device is local
1125to a single network namespace by checking
1126.B netns-local
1127flag in the output of the
1128.BR ethtool ":"
1129
1130.in +8
1131.B ethtool -k
1132.I DEVICE
1133.in -8
1134
1135To change network namespace for wireless devices the
1136.B iw
1137tool can be used. But it allows to change network namespace only for physical devices and by process
1138.IR PID .
761a1e60
CT
1139
1140.TP
1141.BI alias " NAME"
1142give the device a symbolic name for easy reference.
1143
503aa4e2
1144.TP
1145.BI group " GROUP"
1146specify the group the device belongs to.
1147The available groups are listed in file
1148.BR "@SYSCONFDIR@/group" .
1149
761a1e60
CT
1150.TP
1151.BI vf " NUM"
1152specify a Virtual Function device to be configured. The associated PF device
1153must be specified using the
1154.B dev
1155parameter.
1156
1157.in +8
1158.BI mac " LLADDRESS"
1159- change the station address for the specified VF. The
1160.B vf
1161parameter must be specified.
1162
1163.sp
1164.BI vlan " VLANID"
1165- change the assigned VLAN for the specified VF. When specified, all traffic
1166sent from the VF will be tagged with the specified VLAN ID. Incoming traffic
1167will be filtered for the specified VLAN ID, and will have all VLAN tags
1168stripped before being passed to the VF. Setting this parameter to 0 disables
1169VLAN tagging and filtering. The
1170.B vf
1171parameter must be specified.
1172
1173.sp
1174.BI qos " VLAN-QOS"
1175- assign VLAN QOS (priority) bits for the VLAN tag. When specified, all VLAN
1176tags transmitted by the VF will include the specified priority bits in the
1177VLAN tag. If not specified, the value is assumed to be 0. Both the
1178.B vf
1179and
1180.B vlan
1181parameters must be specified. Setting both
1182.B vlan
1183and
1184.B qos
1185as 0 disables VLAN tagging and filtering for the VF.
1186
1187.sp
1188.BI rate " TXRATE"
f89a2a05
SC
1189-- change the allowed transmit bandwidth, in Mbps, for the specified VF.
1190Setting this parameter to 0 disables rate limiting.
1191.B vf
1192parameter must be specified.
1193Please use new API
1194.B "max_tx_rate"
1195option instead.
1196
1197.sp
1198.BI max_tx_rate " TXRATE"
1199- change the allowed maximum transmit bandwidth, in Mbps, for the specified VF.
1200.B vf
1201parameter must be specified.
1202
1203.sp
1204.BI min_tx_rate " TXRATE"
1205- change the allowed minimum transmit bandwidth, in Mbps, for the specified VF.
1206Minimum TXRATE should be always <= Maximum TXRATE.
761a1e60
CT
1207.B vf
1208parameter must be specified.
1209
1210.sp
1211.BI spoofchk " on|off"
1212- turn packet spoof checking on or off for the specified VF.
63f60e3a 1213.sp
8e45e44b
PS
1214.BI query_rss " on|off"
1215- 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.
1216.sp
63f60e3a
OG
1217.BI state " auto|enable|disable"
1218- set the virtual link state as seen by the specified VF. Setting to auto means a
1219reflection of the PF link state, enable lets the VF to communicate with other VFs on
1220this host even if the PF link state is down, disable causes the HW to drop any packets
1221sent by the VF.
b6d77d9e
HS
1222.sp
1223.BI trust " on|off"
1224- trust the specified VF user. This enables that VF user can set a specific feature
1225which may impact security and/or performance. (e.g. VF multicast promiscuous mode)
d91fb3f4
EC
1226.sp
1227.BI node_guid " eui64"
1228- configure node GUID for the VF.
1229.sp
1230.BI port_guid " eui64"
1231- configure port GUID for the VF.
761a1e60
CT
1232.in -8
1233
1234.TP
1235.BI master " DEVICE"
1236set master device of the device (enslave device).
1237
1238.TP
1239.BI nomaster
1240unset master device of the device (release device).
1241
503aa4e2 1242.TP
8f0777a8
BM
1243.BI addrgenmode " eui64|none|stable_secret|random"
1244set the IPv6 address generation mode
1245
1246.I eui64
1247- use a Modified EUI-64 format interface identifier
1248
1249.I none
1250- disable automatic address generation
1251
1252.I stable_secret
1253- generate the interface identifier based on a preset /proc/sys/net/ipv6/conf/{default,DEVICE}/stable_secret
1254
1255.I random
1256- like stable_secret, but auto-generate a new random secret if none is set
503aa4e2
1257
1258.TP
1259.BR "link-netnsid "
1260set peer netnsid for a cross-netns interface
1261
3dd4b893
PS
1262.TP
1263.BI type " ETYPE TYPE_ARGS"
1264Change type-specific settings. For a list of supported types and arguments refer
1265to the description of
1266.B "ip link add"
1267above. In addition to that, it is possible to manipulate settings to slave
1268devices:
1269
1270.TP
1271Bridge Slave Support
1272For a link with master
1273.B bridge
1274the following additional arguments are supported:
1275
1276.B "ip link set type bridge_slave"
1277[
1278.BI state " STATE"
1279] [
1280.BI priority " PRIO"
1281] [
1282.BI cost " COST"
1283] [
1284.BR guard " { " on " | " off " }"
1285] [
1286.BR hairpin " { " on " | " off " }"
1287] [
1288.BR fastleave " { " on " | " off " }"
1289] [
1290.BR root_block " { " on " | " off " }"
1291] [
1292.BR learning " { " on " | " off " }"
1293] [
1294.BR flood " { " on " | " off " }"
1295] [
1296.BR proxy_arp " { " on " | " off " }"
1297] [
1298.BR proxy_arp_wifi " { " on " | " off " }"
1299] [
1300.BI mcast_router " MULTICAST_ROUTER"
1301] [
1302.BR mcast_fast_leave " { " on " | " off "} ]"
1303
1304.in +8
1305.sp
1306.BI state " STATE"
1307- Set port state.
1308.I STATE
1309is a number representing the following states:
1310.BR 0 " (disabled),"
1311.BR 1 " (listening),"
1312.BR 2 " (learning),"
1313.BR 3 " (forwarding),"
1314.BR 4 " (blocking)."
1315
1316.BI priority " PRIO"
1317- set port priority (a 16bit unsigned value).
1318
1319.BI cost " COST"
1320- set port cost (a 32bit unsigned value).
1321
1322.BR guard " { " on " | " off " }"
1323- block incoming BPDU packets on this port.
1324
1325.BR hairpin " { " on " | " off " }"
1326- enable hairpin mode on this port. This will allow incoming packets on this
1327port to be reflected back.
1328
1329.BR fastleave " { " on " | " off " }"
1330- enable multicast fast leave on this port.
1331
1332.BR root_block " { " on " | " off " }"
1333- block this port from becoming the bridge's root port.
1334
1335.BR learning " { " on " | " off " }"
1336- allow MAC address learning on this port.
1337
1338.BR flood " { " on " | " off " }"
1339- open the flood gates on this port, i.e. forward all unicast frames to this
1340port also. Requires
1341.BR proxy_arp " and " proxy_arp_wifi
1342to be turned off.
1343
1344.BR proxy_arp " { " on " | " off " }"
1345- enable proxy ARP on this port.
1346
1347.BR proxy_arp_wifi " { " on " | " off " }"
1348- enable proxy ARP on this port which meets extended requirements by IEEE
1349802.11 and Hotspot 2.0 specifications.
1350
1351.BI mcast_router " MULTICAST_ROUTER"
1352- configure this port for having multicast routers attached. A port with a
1353multicast router will receive all multicast traffic.
1354.I MULTICAST_ROUTER
1355may be either
1356.B 0
1357to disable multicast routers on this port,
1358.B 1
1359to let the system detect the presence of of routers (this is the default),
1360.B 2
1361to permanently enable multicast traffic forwarding on this port or
1362.B 3
1363to enable multicast routers temporarily on this port, not depending on incoming
1364queries.
1365
1366.BR mcast_fast_leave " { " on " | " off " }"
1367- this is a synonym to the
1368.B fastleave
1369option above.
1370
1371.in -8
1372
1373.TP
1374Bonding Slave Support
1375For a link with master
1376.B bond
1377the following additional arguments are supported:
1378
1379.B "ip link set type bond_slave"
1380[
1381.BI queue_id " ID"
1382]
1383
1384.in +8
1385.sp
1386.BI queue_id " ID"
1387- set the slave's queue ID (a 16bit unsigned value).
1388
1389.in -8
1390
761a1e60
CT
1391.SS ip link show - display device attributes
1392
1393.TP
1394.BI dev " NAME " (default)
1395.I NAME
1396specifies the network device to show.
1397If this argument is omitted all devices in the default group are listed.
1398
1399.TP
1400.BI group " GROUP "
1401.I GROUP
1402specifies what group of devices to show.
1403
1404.TP
1405.B up
1406only display running interfaces.
1407
1b944148
VK
1408.TP
1409.BI master " DEVICE "
1410.I DEVICE
1411specifies the master device which enslaves devices to show.
1412
104444c2
DA
1413.TP
1414.BI vrf " NAME "
1415.I NAME
1416speficies the VRF which enslaves devices to show.
1417
712249d8
VK
1418.TP
1419.BI type " TYPE "
1420.I TYPE
1421specifies the type of devices to show.
1422
3462c116
PS
1423Note that the type name is not checked against the list of supported types -
1424instead it is sent as-is to the kernel. Later it is used to filter the returned
1425interface list by comparing it with the relevant attribute in case the kernel
1426didn't filter already. Therefore any string is accepted, but may lead to empty
1427output.
1428
1f299e92 1429.SS ip link help - display help
1430
1431.PP
1432.I "TYPE"
1433specifies which help of link type to dislpay.
1434
032b4f4d
VK
1435.SS
1436.I GROUP
1437may be a number or a string from the file
699589f6 1438.B @SYSCONFDIR@/group
032b4f4d
VK
1439which can be manually filled.
1440
761a1e60
CT
1441.SH "EXAMPLES"
1442.PP
1443ip link show
1444.RS 4
1445Shows the state of all network interfaces on the system.
1446.RE
1447.PP
712249d8
VK
1448ip link show type bridge
1449.RS 4
1450Shows the bridge devices.
1451.RE
1452.PP
1453ip link show type vlan
1454.RS 4
1455Shows the vlan devices.
1456.RE
1457.PP
417b2180
VK
1458ip link show master br0
1459.RS 4
1460Shows devices enslaved by br0
1461.RE
1462.PP
761a1e60
CT
1463ip link set dev ppp0 mtu 1400
1464.RS 4
1465Change the MTU the ppp0 device.
1466.RE
1467.PP
1468ip link add link eth0 name eth0.10 type vlan id 10
1469.RS 4
1470Creates a new vlan device eth0.10 on device eth0.
1471.RE
1472.PP
1473ip link delete dev eth0.10
1474.RS 4
1475Removes vlan device.
1476.RE
1477
1f299e92 1478ip link help gre
1479.RS 4
1480Display help for the gre link type.
90f1df71
TH
1481.RE
1482.PP
1483ip link add name tun1 type ipip remote 192.168.1.1
1484local 192.168.1.2 ttl 225 encap gue encap-sport auto
1485encap-dport 5555 encap-csum encap-remcsum
1486.RS 4
1487Creates an IPIP that is encapsulated with Generic UDP Encapsulation,
1488and the outer UDP checksum and remote checksum offload are enabled.
1489
2c0feda8
LB
1490.RE
1491.PP
1492ip link add link wpan0 lowpan0 type lowpan
1493.RS 4
1494Creates a 6LoWPAN interface named lowpan0 on the underlying
1495IEEE 802.15.4 device wpan0.
1f299e92 1496.RE
1497
761a1e60
CT
1498.SH SEE ALSO
1499.br
d5910297 1500.BR ip (8),
e612883c 1501.BR ip-netns (8),
ab872442
VK
1502.BR ethtool (8),
1503.BR iptables (8)
761a1e60
CT
1504
1505.SH AUTHOR
1506Original Manpage by Michail Litvak <mci@owl.openwall.com>