]> git.proxmox.com Git - mirror_iproute2.git/blame - man/man8/ip-link.8.in
ip-link.8: Place 'ip link set' warning more prominently
[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 "
311.BI 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
f66611d8 413.BI type " vxlan " id " ID"
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] [
2816a568 432.I "[no]learning "
1ab0f02f 433] [
2816a568 434.I "[no]proxy "
1ab0f02f 435] [
2816a568 436.I "[no]rsc "
1ab0f02f 437] [
2816a568 438.I "[no]l2miss "
1ab0f02f 439] [
2816a568 440.I "[no]l3miss "
1ab0f02f 441] [
503aa4e2 442.I "[no]udpcsum "
1ab0f02f 443] [
503aa4e2 444.I "[no]udp6zerocsumtx "
1ab0f02f 445] [
503aa4e2 446.I "[no]udp6zerocsumrx "
1ab0f02f 447] [
c2fbc57e 448.BI ageing " SECONDS "
1ab0f02f 449] [
c2fbc57e 450.BI maxaddress " NUMBER "
1ab0f02f 451] [
42d17a61
JB
452.RI "[no]external "
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
509.I [no]learning
510- specifies if unknown source link layer addresses and IP addresses
511are entered into the VXLAN device forwarding database.
512
513.sp
514.I [no]rsc
515- specifies if route short circuit is turned on.
516
517.sp
518.I [no]proxy
519- specifies ARP proxy is turned on.
520
521.sp
522.I [no]l2miss
523- specifies if netlink LLADDR miss notifications are generated.
524
525.sp
526.I [no]l3miss
527- specifies if netlink IP ADDR miss notifications are generated.
528
503aa4e2
529.sp
530.I [no]udpcsum
4853ee52 531- specifies if UDP checksum is calculated for transmitted packets over IPv4.
503aa4e2
532
533.sp
534.I [no]udp6zerocsumtx
4853ee52 535- skip UDP checksum calculation for transmitted packets over IPv6.
503aa4e2
536
537.sp
538.I [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
JB
549.sp
550.I [no]external
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
614.BR type " { gre | ipip | sit } "
615.BI " remote " ADDR " local " ADDR
1ab0f02f 616[
90f1df71 617.BR encap " { fou | gue | none } "
1ab0f02f 618] [
90f1df71 619.BI "encap-sport { " PORT " | auto } "
1ab0f02f 620] [
90f1df71 621.BI "encap-dport " PORT
1ab0f02f 622] [
90f1df71 623.I " [no]encap-csum "
1ab0f02f 624] [
90f1df71 625.I " [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
639.BR encap " { fou | gue | none } "
640- specifies type of secondary UDP encapsulation. "fou" indicates
641Foo-Over-UDP, "gue" indicates Generic UDP Encapsulation.
642
643.sp
644.BI "encap-sport { " PORT " | auto } "
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
653.I [no]encap-csum
654- specifies if UDP checksums are enabled in the secondary
655encapsulation.
656
657.sp
658.I [no]encap-remcsum
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
671.BI type " { ip6gre | ip6gretap } " remote " ADDR " local " ADDR
1ab0f02f 672[
9abde37c 673.I "[i|o]seq]"
1ab0f02f 674] [
9abde37c 675.I "[i|o]key" KEY
1ab0f02f 676] [
9abde37c 677.I " [i|o]csum "
1ab0f02f 678] [
9abde37c 679.BI hoplimit " TTL "
1ab0f02f 680] [
9abde37c 681.BI encaplimit " ELIM "
1ab0f02f 682] [
9abde37c 683.BI tclass " TCLASS "
1ab0f02f 684] [
9abde37c 685.BI flowlabel " FLOWLABEL "
1ab0f02f 686] [
9abde37c 687.BI "dscp inherit"
1ab0f02f 688] [
9abde37c 689.BI dev " PHYS_DEV "
1ab0f02f 690]
9abde37c 691
692.in +8
693.sp
694.BI remote " ADDR "
695- specifies the remote IPv6 address of the tunnel.
696
697.sp
698.BI local " ADDR "
699- specifies the fixed local IPv6 address for tunneled packets.
90f1df71 700It must be an address on another interface on this host.
9abde37c 701
702.sp
703.BI [i|o]seq
704- serialize packets.
705The
706.B oseq
707flag enables sequencing of outgoing packets.
708The
709.B iseq
710flag requires that all input packets are serialized.
711
712.sp
713.BI [i|o]key " KEY"
714- use keyed GRE with key
715.IR KEY ". "KEY
716is either a number or an IPv4 address-like dotted quad.
717The
718.B key
719parameter specifies the same key to use in both directions.
720The
721.BR ikey " and " okey
722parameters specify different keys for input and output.
723
724.sp
725.BI [i|o]csum
726- generate/require checksums for tunneled packets.
727The
728.B ocsum
729flag calculates checksums for outgoing packets.
730The
731.B icsum
732flag requires that all input packets have the correct
a89d5329 733checksum. The
9abde37c 734.B csum
735flag is equivalent to the combination
736.BR "icsum ocsum" .
737
738.sp
739.BI hoplimit " TTL"
740- specifies Hop Limit value to use in outgoing packets.
741
742.sp
743.BI encaplimit " ELIM"
a89d5329 744- specifies a fixed encapsulation limit. Default is 4.
9abde37c 745
746.sp
747.BI flowlabel " FLOWLABEL"
63f60e3a 748- specifies a fixed flowlabel.
9abde37c 749
750.sp
751.BI tclass " TCLASS"
752- specifies the traffic class field on
753tunneled packets, which can be specified as either a two-digit
754hex value (e.g. c0) or a predefined string (e.g. internet).
755The value
756.B inherit
757causes the field to be copied from the original IP header. The
758values
759.BI "inherit/" STRING
760or
761.BI "inherit/" 00 ".." ff
762will set the field to
763.I STRING
764or
765.IR 00 ".." ff
766when tunneling non-IP packets. The default value is 00.
767
768.in -8
769
8ca8fac7
OG
770.TP
771IPoIB Type Support
772For a link of type
773.I IPoIB
774the following additional arguments are supported:
775
776.BI "ip link add " DEVICE " name " NAME
777.BI type " ipoib [ " pkey " PKEY ] [" mode " MODE " ]
778
779.in +8
780.sp
781.BI pkey " PKEY "
782- specifies the IB P-Key to use.
783
784.BI mode " MODE "
785- specifies the mode (datagram or connected) to use.
786
c1a1d8bc
JL
787.TP
788GENEVE Type Support
789For a link of type
790.I GENEVE
791the following additional arguments are supported:
792
793.BI "ip link add " DEVICE
794.BI type " geneve " id " ID " remote " IPADDR"
1ab0f02f 795[
f4c05c2e 796.BI ttl " TTL "
1ab0f02f 797] [
f4739b2e 798.BI tos " TOS "
29bb2373
DB
799] [
800.BI flowlabel " FLOWLABEL "
1ab0f02f 801]
c1a1d8bc
JL
802
803.in +8
804.sp
805.BI id " VNI "
806- specifies the Virtual Network Identifer to use.
807
808.sp
809.BI remote " IPADDR"
810- specifies the unicast destination IP address to use in outgoing packets.
811
f4c05c2e
JL
812.sp
813.BI ttl " TTL"
814- specifies the TTL value to use in outgoing packets.
815
f4739b2e
JL
816.sp
817.BI tos " TOS"
818- specifies the TOS value to use in outgoing packets.
819
29bb2373
DB
820.sp
821.BI flowlabel " FLOWLABEL"
822- specifies the flow label to use in outgoing packets.
823
c1a1d8bc
JL
824.in -8
825
a60223bc
PS
826.TP
827MACVLAN and MACVTAP Type Support
828For a link of type
829.I MACVLAN
830or
831.I MACVTAP
832the following additional arguments are supported:
833
834.BI "ip link add link " DEVICE " name " NAME
835.BR type " { " macvlan " | " macvtap " } "
836.BR mode " { " private " | " vepa " | " bridge " | " passthru
837.BR " [ " nopromisc " ] } "
838
839.in +8
840.sp
841.BR type " { " macvlan " | " macvtap " } "
842- specifies the link type to use.
843.BR macvlan " creates just a virtual interface, while "
844.BR macvtap " in addition creates a character device "
845.BR /dev/tapX " to be used just like a " tuntap " device."
846
847.B mode private
848- Do not allow communication between
849.B macvlan
850instances on the same physical interface, even if the external switch supports
851hairpin mode.
852
853.B mode vepa
854- Virtual Ethernet Port Aggregator mode. Data from one
855.B macvlan
856instance to the other on the same physical interface is transmitted over the
857physical interface. Either the attached switch needs to support hairpin mode,
858or there must be a TCP/IP router forwarding the packets in order to allow
859communication. This is the default mode.
860
861.B mode bridge
862- In bridge mode, all endpoints are directly connected to each other,
863communication is not redirected through the physical interface's peer.
864
865.BR mode " " passthru " [ " nopromisc " ] "
866- This mode gives more power to a single endpoint, usually in
867.BR macvtap " mode. It is not allowed for more than one endpoint on the same "
868physical interface. All traffic will be forwarded to this endpoint, allowing
869virtio guests to change MAC address or set promiscuous mode in order to bridge
870the interface or create vlan interfaces on top of it. By default, this mode
871forces the underlying interface into promiscuous mode. Passing the
872.BR nopromisc " flag prevents this, so the promisc flag may be controlled "
873using standard tools.
874.in -8
875
9b3c971a
PH
876.TP
877High-availability Seamless Redundancy (HSR) Support
878For a link of type
879.I HSR
880the following additional arguments are supported:
881
882.BI "ip link add link " DEVICE " name " NAME
883.BI type " hsr "
884.BI slave1 " SLAVE1-IF " slave2 " SLAVE2-IF "
885.BR " [ supervision " ADDR-BYTE " ] "
886.BR " [ version { " 0 " | " 1 " } ] "
887
888.in +8
889.sp
890.BR type " hsr "
891- specifies the link type to use, here HSR.
892
893.BI slave1 " SLAVE1-IF "
894- Specifies the physical device used for the first of the two ring ports.
895
896.BI slave2 " SLAVE2-IF "
897- Specifies the physical device used for the second of the two ring ports.
898
899.BR "supervision ADDR-BYTE "
900- The last byte of the multicast address used for HSR supervision frames.
901Default option is "0", possible values 0-255.
902
903.BR "version { 0 | 1 }"
904- Selects the protocol version of the interface. Default option is "0", which
905corresponds to the 2010 version of the HSR standard. Option "1" activates the
9062012 version.
907.in -8
908
b26fc590
SD
909.TP
910MACsec Type Support
911For a link of type
912.I MACsec
913the following additional arguments are supported:
914
915.BI "ip link add link " DEVICE " name " NAME " type macsec"
916[
917.BI port " PORT"
918|
919.BI sci " SCI"
920] [
921.BI cipher " CIPHER_SUITE"
922] [
923.BR encrypt " {"
924.BR on " | " off " } ] [ "
925.BR send_sci " { " on " | " off " } ] ["
926.BR es " { " on " | " off " } ] ["
927.BR scb " { " on " | " off " } ] ["
928.BR protect " { " on " | " off " } ] ["
929.BR replay " { " on " | " off " }"
930.BR window " { "
931.IR 0..2^32-1 " } ] ["
932.BR validate " { " strict " | " check " | " disabled " } ] ["
933.BR encoding " { "
934.IR 0..3 " } ]"
935
936.in +8
937.sp
938.BI port " PORT "
939- sets the port number for this MACsec device.
940
941.sp
942.BI sci " SCI "
943- sets the SCI for this MACsec device.
944
945.sp
946.BI cipher " CIPHER_SUITE "
947- defines the cipher suite to use.
948
949.sp
950.BR "encrypt on " or " encrypt off"
951- switches between authenticated encryption, or authenticity mode only.
952
953.sp
954.BR "send_sci on " or " send_sci off"
955- specifies whether the SCI is included in every packet, or only when it is necessary.
956
957.sp
958.BR "es on " or " es off"
959- sets the End Station bit.
960
961.sp
962.BR "scb on " or " scb off"
963- sets the Single Copy Broadcast bit.
964
965.sp
966.BR "protect on " or " protect off"
967- enables MACsec protection on the device.
968
969.sp
970.BR "replay on " or " replay off"
971- enables replay protection on the device.
972
973.in +8
974
975.sp
976.BI window " SIZE "
977- sets the size of the replay window.
978
979.in -8
980
981.sp
982.BR "validate strict " or " validate check " or " validate disabled"
983- sets the validation mode on the device.
984
985.sp
986.BI encoding " AN "
987- sets the active secure association for transmission.
988
989.in -8
990
2a6f9cfa
DA
991.TP
992VRF Type Support
993For a link of type
994.I VRF
995the following additional arguments are supported:
996
997.BI "ip link add " DEVICE " type vrf table " TABLE
998
999.in +8
1000.sp
1001.BR table " table id associated with VRF device"
1002
1003.in -8
1004
761a1e60 1005.SS ip link delete - delete virtual link
761a1e60
CT
1006
1007.TP
1008.BI dev " DEVICE "
7f74cf6d
VK
1009specifies the virtual device to act operate on.
1010
1011.TP
1012.BI group " GROUP "
1013specifies the group of virtual links to delete. Group 0 is not allowed to be
1014deleted since it is the default group.
1015
1016.TP
1017.BI type " TYPE "
1018specifies the type of the device.
761a1e60
CT
1019
1020.SS ip link set - change device attributes
1021
f9e9f928
PS
1022.PP
1023.B Warning:
1024If multiple parameter changes are requested,
1025.B ip
1026aborts immediately after any of the changes have failed.
1027This is the only case when
1028.B ip
1029can move the system to an unpredictable state. The solution
1030is to avoid changing several parameters with one
1031.B ip link set
1032call.
1033
761a1e60
CT
1034.TP
1035.BI dev " DEVICE "
1036.I DEVICE
6274b0b7 1037specifies network device to operate on. When configuring SR-IOV Virtual Function
761a1e60
CT
1038(VF) devices, this keyword should specify the associated Physical Function (PF)
1039device.
1040
1041.TP
1042.BI group " GROUP "
1043.I GROUP
1044has a dual role: If both group and dev are present, then move the device to the
a89d5329 1045specified group. If only a group is specified, then the command operates on
761a1e60
CT
1046all devices in that group.
1047
1048.TP
1049.BR up " and " down
1050change the state of the device to
1051.B UP
1052or
1053.BR "DOWN" .
1054
1055.TP
1056.BR "arp on " or " arp off"
1057change the
1058.B NOARP
1059flag on the device.
1060
1061.TP
1062.BR "multicast on " or " multicast off"
1063change the
1064.B MULTICAST
1065flag on the device.
1066
18864827
AK
1067.TP
1068.BR "protodown on " or " protodown off"
1069change the
1070.B PROTODOWN
1071state 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.
1072
761a1e60
CT
1073.TP
1074.BR "dynamic on " or " dynamic off"
1075change the
1076.B DYNAMIC
34c8a95c
VK
1077flag on the device. Indicates that address can change when interface goes down (currently
1078.B NOT
1079used by the Linux).
761a1e60
CT
1080
1081.TP
1082.BI name " NAME"
a89d5329 1083change the name of the device. This operation is not
761a1e60
CT
1084recommended if the device is running or has some addresses
1085already configured.
1086
1087.TP
1088.BI txqueuelen " NUMBER"
1089.TP
1090.BI txqlen " NUMBER"
1091change the transmit queue length of the device.
1092
1093.TP
1094.BI mtu " NUMBER"
1095change the
1096.I MTU
1097of the device.
1098
1099.TP
1100.BI address " LLADDRESS"
1101change the station address of the interface.
1102
1103.TP
1104.BI broadcast " LLADDRESS"
1105.TP
1106.BI brd " LLADDRESS"
1107.TP
1108.BI peer " LLADDRESS"
1109change the link layer broadcast address or the peer address when
1110the interface is
1111.IR "POINTOPOINT" .
1112
1113.TP
36324eba 1114.BI netns " NETNSNAME " \fR| " PID"
761a1e60 1115move the device to the network namespace associated with name
36324eba
VK
1116.IR "NETNSNAME " or
1117.RI process " PID".
1118
1119Some devices are not allowed to change network namespace: loopback, bridge,
1120ppp, wireless. These are network namespace local devices. In such case
1121.B ip
1122tool will return "Invalid argument" error. It is possible to find out if device is local
1123to a single network namespace by checking
1124.B netns-local
1125flag in the output of the
1126.BR ethtool ":"
1127
1128.in +8
1129.B ethtool -k
1130.I DEVICE
1131.in -8
1132
1133To change network namespace for wireless devices the
1134.B iw
1135tool can be used. But it allows to change network namespace only for physical devices and by process
1136.IR PID .
761a1e60
CT
1137
1138.TP
1139.BI alias " NAME"
1140give the device a symbolic name for easy reference.
1141
503aa4e2
1142.TP
1143.BI group " GROUP"
1144specify the group the device belongs to.
1145The available groups are listed in file
1146.BR "@SYSCONFDIR@/group" .
1147
761a1e60
CT
1148.TP
1149.BI vf " NUM"
1150specify a Virtual Function device to be configured. The associated PF device
1151must be specified using the
1152.B dev
1153parameter.
1154
1155.in +8
1156.BI mac " LLADDRESS"
1157- change the station address for the specified VF. The
1158.B vf
1159parameter must be specified.
1160
1161.sp
1162.BI vlan " VLANID"
1163- change the assigned VLAN for the specified VF. When specified, all traffic
1164sent from the VF will be tagged with the specified VLAN ID. Incoming traffic
1165will be filtered for the specified VLAN ID, and will have all VLAN tags
1166stripped before being passed to the VF. Setting this parameter to 0 disables
1167VLAN tagging and filtering. The
1168.B vf
1169parameter must be specified.
1170
1171.sp
1172.BI qos " VLAN-QOS"
1173- assign VLAN QOS (priority) bits for the VLAN tag. When specified, all VLAN
1174tags transmitted by the VF will include the specified priority bits in the
1175VLAN tag. If not specified, the value is assumed to be 0. Both the
1176.B vf
1177and
1178.B vlan
1179parameters must be specified. Setting both
1180.B vlan
1181and
1182.B qos
1183as 0 disables VLAN tagging and filtering for the VF.
1184
1185.sp
1186.BI rate " TXRATE"
f89a2a05
SC
1187-- change the allowed transmit bandwidth, in Mbps, for the specified VF.
1188Setting this parameter to 0 disables rate limiting.
1189.B vf
1190parameter must be specified.
1191Please use new API
1192.B "max_tx_rate"
1193option instead.
1194
1195.sp
1196.BI max_tx_rate " TXRATE"
1197- change the allowed maximum transmit bandwidth, in Mbps, for the specified VF.
1198.B vf
1199parameter must be specified.
1200
1201.sp
1202.BI min_tx_rate " TXRATE"
1203- change the allowed minimum transmit bandwidth, in Mbps, for the specified VF.
1204Minimum TXRATE should be always <= Maximum TXRATE.
761a1e60
CT
1205.B vf
1206parameter must be specified.
1207
1208.sp
1209.BI spoofchk " on|off"
1210- turn packet spoof checking on or off for the specified VF.
63f60e3a 1211.sp
8e45e44b
PS
1212.BI query_rss " on|off"
1213- 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.
1214.sp
63f60e3a
OG
1215.BI state " auto|enable|disable"
1216- set the virtual link state as seen by the specified VF. Setting to auto means a
1217reflection of the PF link state, enable lets the VF to communicate with other VFs on
1218this host even if the PF link state is down, disable causes the HW to drop any packets
1219sent by the VF.
b6d77d9e
HS
1220.sp
1221.BI trust " on|off"
1222- trust the specified VF user. This enables that VF user can set a specific feature
1223which may impact security and/or performance. (e.g. VF multicast promiscuous mode)
d91fb3f4
EC
1224.sp
1225.BI node_guid " eui64"
1226- configure node GUID for the VF.
1227.sp
1228.BI port_guid " eui64"
1229- configure port GUID for the VF.
761a1e60
CT
1230.in -8
1231
1232.TP
1233.BI master " DEVICE"
1234set master device of the device (enslave device).
1235
1236.TP
1237.BI nomaster
1238unset master device of the device (release device).
1239
503aa4e2 1240.TP
8f0777a8
BM
1241.BI addrgenmode " eui64|none|stable_secret|random"
1242set the IPv6 address generation mode
1243
1244.I eui64
1245- use a Modified EUI-64 format interface identifier
1246
1247.I none
1248- disable automatic address generation
1249
1250.I stable_secret
1251- generate the interface identifier based on a preset /proc/sys/net/ipv6/conf/{default,DEVICE}/stable_secret
1252
1253.I random
1254- like stable_secret, but auto-generate a new random secret if none is set
503aa4e2
1255
1256.TP
1257.BR "link-netnsid "
1258set peer netnsid for a cross-netns interface
1259
761a1e60
CT
1260.SS ip link show - display device attributes
1261
1262.TP
1263.BI dev " NAME " (default)
1264.I NAME
1265specifies the network device to show.
1266If this argument is omitted all devices in the default group are listed.
1267
1268.TP
1269.BI group " GROUP "
1270.I GROUP
1271specifies what group of devices to show.
1272
1273.TP
1274.B up
1275only display running interfaces.
1276
1b944148
VK
1277.TP
1278.BI master " DEVICE "
1279.I DEVICE
1280specifies the master device which enslaves devices to show.
1281
104444c2
DA
1282.TP
1283.BI vrf " NAME "
1284.I NAME
1285speficies the VRF which enslaves devices to show.
1286
712249d8
VK
1287.TP
1288.BI type " TYPE "
1289.I TYPE
1290specifies the type of devices to show.
1291
3462c116
PS
1292Note that the type name is not checked against the list of supported types -
1293instead it is sent as-is to the kernel. Later it is used to filter the returned
1294interface list by comparing it with the relevant attribute in case the kernel
1295didn't filter already. Therefore any string is accepted, but may lead to empty
1296output.
1297
1f299e92 1298.SS ip link help - display help
1299
1300.PP
1301.I "TYPE"
1302specifies which help of link type to dislpay.
1303
032b4f4d
VK
1304.SS
1305.I GROUP
1306may be a number or a string from the file
699589f6 1307.B @SYSCONFDIR@/group
032b4f4d
VK
1308which can be manually filled.
1309
761a1e60
CT
1310.SH "EXAMPLES"
1311.PP
1312ip link show
1313.RS 4
1314Shows the state of all network interfaces on the system.
1315.RE
1316.PP
712249d8
VK
1317ip link show type bridge
1318.RS 4
1319Shows the bridge devices.
1320.RE
1321.PP
1322ip link show type vlan
1323.RS 4
1324Shows the vlan devices.
1325.RE
1326.PP
417b2180
VK
1327ip link show master br0
1328.RS 4
1329Shows devices enslaved by br0
1330.RE
1331.PP
761a1e60
CT
1332ip link set dev ppp0 mtu 1400
1333.RS 4
1334Change the MTU the ppp0 device.
1335.RE
1336.PP
1337ip link add link eth0 name eth0.10 type vlan id 10
1338.RS 4
1339Creates a new vlan device eth0.10 on device eth0.
1340.RE
1341.PP
1342ip link delete dev eth0.10
1343.RS 4
1344Removes vlan device.
1345.RE
1346
1f299e92 1347ip link help gre
1348.RS 4
1349Display help for the gre link type.
90f1df71
TH
1350.RE
1351.PP
1352ip link add name tun1 type ipip remote 192.168.1.1
1353local 192.168.1.2 ttl 225 encap gue encap-sport auto
1354encap-dport 5555 encap-csum encap-remcsum
1355.RS 4
1356Creates an IPIP that is encapsulated with Generic UDP Encapsulation,
1357and the outer UDP checksum and remote checksum offload are enabled.
1358
2c0feda8
LB
1359.RE
1360.PP
1361ip link add link wpan0 lowpan0 type lowpan
1362.RS 4
1363Creates a 6LoWPAN interface named lowpan0 on the underlying
1364IEEE 802.15.4 device wpan0.
1f299e92 1365.RE
1366
761a1e60
CT
1367.SH SEE ALSO
1368.br
d5910297 1369.BR ip (8),
e612883c 1370.BR ip-netns (8),
ab872442
VK
1371.BR ethtool (8),
1372.BR iptables (8)
761a1e60
CT
1373
1374.SH AUTHOR
1375Original Manpage by Michail Litvak <mci@owl.openwall.com>