]> git.proxmox.com Git - mirror_iproute2.git/blame - man/man8/ip-link.8.in
tc action policer: enable timestamp display
[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
42.ti -8
43.IR TYPE " := [ "
f1a6f4e9 44.BR bridge " | "
e37a9c73 45.BR bond " | "
f1a6f4e9
SH
46.BR can " | "
47.BR dummy " | "
5c0aec93 48.BR hsr " | "
f1a6f4e9
SH
49.BR ifb " | "
50.BR ipoib " |"
51.BR macvlan " | "
e4c35682 52.BR macvtap " | "
f1a6f4e9
SH
53.BR vcan " | "
54.BR veth " | "
55.BR vlan " | "
77987911
ND
56.BR vxlan " |"
57.BR ip6tnl " |"
58.BR ipip " |"
9abde37c 59.BR sit " |"
60.BR gre " |"
61.BR gretap " |"
62.BR ip6gre " |"
b6d6b5a1
VK
63.BR ip6gretap " |"
64.BR vti " |"
65.BR nlmon " |"
2c0feda8 66.BR ipvlan " |"
c1a1d8bc
JL
67.BR lowpan " |"
68.BR geneve " ]"
761a1e60
CT
69
70.ti -8
7f74cf6d
VK
71.BR "ip link delete " {
72.IR DEVICE " | "
73.BI "group " GROUP
74}
761a1e60
CT
75.BI type " TYPE"
76.RI "[ " ARGS " ]"
77
78.ti -8
79.BR "ip link set " {
80.IR DEVICE " | "
81.BI "group " GROUP
ca611d64 82.RB "} [ { " up " | " down " } ]"
761a1e60 83.br
ca611d64 84.RB "[ " arp " { " on " | " off " } ]"
761a1e60 85.br
ca611d64 86.RB "[ " dynamic " { " on " | " off " } ]"
761a1e60 87.br
ca611d64 88.RB "[ " multicast " { " on " | " off " } ]"
761a1e60 89.br
ca611d64 90.RB "[ " allmulticast " { " on " | " off " } ]"
761a1e60 91.br
ca611d64 92.RB "[ " promisc " { " on " | " off " } ]"
18864827 93.br
ca611d64 94.RB "[ " protodown " { " on " | " off " } ]"
761a1e60 95.br
ca611d64 96.RB "[ " trailers " { " on " | " off " } ]"
761a1e60 97.br
ca611d64
PS
98.RB "[ " txqueuelen
99.IR PACKETS " ]"
100.br
101.RB "[ " name
102.IR NEWNAME " ]"
103.br
104.RB "[ " address
105.IR LLADDR " ]"
761a1e60 106.br
ca611d64
PS
107.RB "[ " broadcast
108.IR LLADDR " ]"
109.br
110.RB "[ " mtu
111.IR MTU " ]"
761a1e60 112.br
ca611d64
PS
113.RB "[ " netns " {"
114.IR PID " | " NETNSNAME " } ]"
761a1e60 115.br
ca611d64
PS
116.RB "[ " link-netnsid
117.IR ID " ]"
761a1e60 118.br
ca611d64
PS
119.RB "[ " alias
120.IR NAME " ]"
761a1e60 121.br
ca611d64 122.RB "[ " vf
761a1e60
CT
123.IR NUM " ["
124.B mac
ca611d64
PS
125.IR LLADDR " ]"
126.br
127.in +9
128.RB "[ " vlan
761a1e60
CT
129.IR VLANID " [ "
130.B qos
ca611d64 131.IR VLAN-QOS " ] ]"
761a1e60 132.br
ca611d64
PS
133.RB "[ " rate
134.IR TXRATE " ]"
135.br
136.RB "[ " max_tx_rate
137.IR TXRATE " ]"
138.br
139.RB "[ " min_tx_rate
140.IR TXRATE " ]"
761a1e60 141.br
ca611d64 142.RB "[ " spoofchk " { " on " | " off " } ]"
503aa4e2 143.br
ca611d64 144.RB "[ " state " { " auto " | " enable " | " disable " } ]"
503aa4e2 145.br
ca611d64
PS
146.RB "[ " trust " { " on " | " off " } ] ]"
147.br
148.in -9
149.RB "[ " master
150.IR DEVICE " ]"
151.br
152.RB "[ " nomaster " ]"
153.br
154.RB "[ " addrgenmode " { " eui64 " | " none " | " stable_secret " | " random " } ]"
761a1e60
CT
155
156
157.ti -8
158.B ip link show
159.RI "[ " DEVICE " | "
160.B group
ca611d64
PS
161.IR GROUP " ] ["
162.BR up " ] ["
1b944148 163.B master
ca611d64 164.IR DEVICE " ] ["
712249d8
VK
165.B type
166.IR TYPE " ]"
761a1e60 167
1f299e92 168.ti -8
169.B ip link help
170.RI "[ " TYPE " ]"
171
761a1e60
CT
172.SH "DESCRIPTION"
173.SS ip link add - add virtual link
174
175.TP
176.BI link " DEVICE "
177specifies the physical device to act operate on.
178
179.I NAME
180specifies the name of the new virtual device.
181
182.I TYPE
183specifies the type of the new device.
184.sp
185Link types:
186
187.in +8
f1a6f4e9
SH
188.B bridge
189- Ethernet Bridge device
761a1e60 190.sp
cc26a890
JP
191.B bond
192- Bonding device
503aa4e2
193.B can
194- Controller Area Network interface
cc26a890 195.sp
761a1e60
CT
196.B dummy
197- Dummy network interface
198.sp
2f937359 199.B hsr
200- High-availability Seamless Redundancy device
201.sp
761a1e60
CT
202.B ifb
203- Intermediate Functional Block device
204.sp
f1a6f4e9
SH
205.B ipoib
206- IP over Infiniband device
207.sp
761a1e60 208.B macvlan
f1a6f4e9 209- Virtual interface base on link layer address (MAC)
761a1e60 210.sp
e4c35682
RR
211.B macvtap
212- Virtual interface based on link layer address (MAC) and TAP.
213.sp
f1a6f4e9 214.B vcan
2b70fe15 215- Virtual Controller Area Network interface
761a1e60 216.sp
f1a6f4e9
SH
217.B veth
218- Virtual ethernet interface
de038993 219.sp
f1a6f4e9
SH
220.BR vlan
221- 802.1q tagged virtual LAN interface
222.sp
223.BR vxlan
224- Virtual eXtended LAN
77987911
ND
225.sp
226.BR ip6tnl
227- Virtual tunnel interface IPv4|IPv6 over IPv6
228.sp
229.BR ipip
230- Virtual tunnel interface IPv4 over IPv4
231.sp
232.BR sit
233- Virtual tunnel interface IPv6 over IPv4
9abde37c 234.sp
235.BR gre
236- Virtual tunnel interface GRE over IPv4
237.sp
238.BR gretap
d36d9d41 239- Virtual L2 tunnel interface GRE over IPv4
9abde37c 240.sp
241.BR ip6gre
d36d9d41 242- Virtual tunnel interface GRE over IPv6
9abde37c 243.sp
244.BR ip6gretap
d36d9d41 245- Virtual L2 tunnel interface GRE over IPv6
b6d6b5a1
VK
246.sp
247.BR vti
248- Virtual tunnel interface
249.sp
250.BR nlmon
251- Netlink monitoring device
252.sp
253.BR ipvlan
254- Interface for L3 (IPv6/IPv4) based VLANs
2c0feda8
LB
255.sp
256.BR lowpan
257- Interface for 6LoWPAN (IPv6) over IEEE 802.15.4 / Bluetooth
c1a1d8bc
JL
258.sp
259.BR geneve
260- GEneric NEtwork Virtualization Encapsulation
761a1e60
CT
261.in -8
262
d992f3e6
JP
263.TP
264.BI numtxqueues " QUEUE_COUNT "
265specifies the number of transmit queues for new device.
266
267.TP
268.BI numrxqueues " QUEUE_COUNT "
269specifies the number of receive queues for new device.
270
4de8d885
PE
271.TP
272.BI index " IDX "
273specifies the desired index of the new virtual device. The link creation fails, if the index is busy.
274
503aa4e2
275.TP
276VLAN Type Support
277For a link of type
278.I VLAN
279the following additional arguments are supported:
280
281.BI "ip link add
282.BI link " DEVICE "
283.BI name " NAME "
284.BI type " vlan "
1ab0f02f 285[
503aa4e2 286.BI protocol " VLAN_PROTO "
1ab0f02f 287]
503aa4e2 288.BI id " VLANID "
1ab0f02f 289[
503aa4e2 290.BR reorder_hdr " { " on " | " off " } "
1ab0f02f
TF
291]
292[
503aa4e2 293.BR gvrp " { " on " | " off " } "
1ab0f02f
TF
294]
295[
503aa4e2 296.BR mvrp " { " on " | " off " } "
1ab0f02f
TF
297]
298[
503aa4e2 299.BR loose_binding " { " on " | " off " } "
1ab0f02f
TF
300]
301[
503aa4e2 302.BI ingress-qos-map " QOS-MAP "
1ab0f02f
TF
303]
304[
503aa4e2 305.BI egress-qos-map " QOS-MAP "
1ab0f02f 306]
503aa4e2
307
308.in +8
309.sp
310.BI protocol " VLAN_PROTO "
311- either 802.1Q or 802.1ad.
312
313.BI id " VLANID "
314- specifies the VLAN Identifer to use. Note that numbers with a leading " 0 " or " 0x " are interpreted as octal or hexadeimal, respectively.
315
316.BR reorder_hdr " { " on " | " off " } "
e612883c
VK
317- specifies whether ethernet headers are reordered or not (default is
318.BR on ")."
319
320.in +4
321If
322.BR reorder_hdr " is " on
323then VLAN header will be not inserted immediately but only before passing to the
324physical device (if this device does not support VLAN offloading), the similar
325on the RX direction - by default the packet will be untagged before being
326received by VLAN device. Reordering allows to accelerate tagging on egress and
327to hide VLAN header on ingress so the packet looks like regular Ethernet packet,
79c7078e 328at the same time it might be confusing for packet capture as the VLAN header
e612883c
VK
329does not exist within the packet.
330
331VLAN offloading can be checked by
332.BR ethtool "(8):"
333.in +4
334.sp
335.B ethtool -k
336<phy_dev> |
337.RB grep " tx-vlan-offload"
338.sp
339.in -4
340where <phy_dev> is the physical device to which VLAN device is bound.
341.in -4
503aa4e2
342
343.BR gvrp " { " on " | " off " } "
344- specifies whether this VLAN should be registered using GARP VLAN Registration Protocol.
345
346.BR mvrp " { " on " | " off " } "
347- specifies whether this VLAN should be registered using Multiple VLAN Registration Protocol.
348
349.BR loose_binding " { " on " | " off " } "
350- specifies whether the VLAN device state is bound to the physical device state.
351
352.BI ingress-qos-map " QOS-MAP "
ab872442
VK
353- defines a mapping of VLAN header prio field to the Linux internal packet
354priority on incoming frames. The format is FROM:TO with multiple mappings
355separated by spaces.
503aa4e2
356
357.BI egress-qos-map " QOS-MAP "
ab872442
VK
358- defines a mapping of Linux internal packet priority to VLAN header prio field
359but for outgoing frames. The format is the same as for ingress-qos-map.
360.in +4
361
362Linux packet priority can be set by
363.BR iptables "(8)":
364.in +4
365.sp
366.B iptables
367-t mangle -A POSTROUTING [...] -j CLASSIFY --set-class 0:4
368.sp
369.in -4
370and this "4" priority can be used in the egress qos mapping to set VLAN prio "5":
371.sp
372.in +4
373.B ip
374link set veth0.10 type vlan egress 4:5
375.in -4
376.in -4
503aa4e2
377.in -8
378
2816a568
TR
379.TP
380VXLAN Type Support
63f60e3a 381For a link of type
2816a568
TR
382.I VXLAN
383the following additional arguments are supported:
384
385.BI "ip link add " DEVICE
f66611d8 386.BI type " vxlan " id " ID"
1ab0f02f 387[
2816a568 388.BI dev " PHYS_DEV "
7cfa3802
AW
389.RB " ] [ { " group " | " remote " } "
390.I IPADDR
1ab0f02f 391] [
5cd64c97
TF
392.B local
393.RI "{ "IPADDR " | "any " } "
1ab0f02f 394] [
2816a568 395.BI ttl " TTL "
1ab0f02f 396] [
2816a568 397.BI tos " TOS "
1ab0f02f 398] [
f8eb79a6
DB
399.BI flowlabel " FLOWLABEL "
400] [
503aa4e2 401.BI dstport " PORT "
1ab0f02f 402] [
503aa4e2 403.BI srcport " MIN MAX "
1ab0f02f 404] [
2816a568 405.I "[no]learning "
1ab0f02f 406] [
2816a568 407.I "[no]proxy "
1ab0f02f 408] [
2816a568 409.I "[no]rsc "
1ab0f02f 410] [
2816a568 411.I "[no]l2miss "
1ab0f02f 412] [
2816a568 413.I "[no]l3miss "
1ab0f02f 414] [
503aa4e2 415.I "[no]udpcsum "
1ab0f02f 416] [
503aa4e2 417.I "[no]udp6zerocsumtx "
1ab0f02f 418] [
503aa4e2 419.I "[no]udp6zerocsumrx "
1ab0f02f 420] [
c2fbc57e 421.BI ageing " SECONDS "
1ab0f02f 422] [
c2fbc57e 423.BI maxaddress " NUMBER "
1ab0f02f 424] [
42d17a61
JB
425.RI "[no]external "
426] [
2eb90dc7 427.B gbp
346410bd
JB
428] [
429.B gpe
1ab0f02f 430]
2816a568
TR
431
432.in +8
433.sp
434.BI id " VNI "
435- specifies the VXLAN Network Identifer (or VXLAN Segment
436Identifier) to use.
437
438.BI dev " PHYS_DEV"
439- specifies the physical device to use for tunnel endpoint communication.
440
441.sp
442.BI group " IPADDR"
443- specifies the multicast IP address to join.
7cfa3802
AW
444This parameter cannot be specified with the
445.B remote
446parameter.
447
448.sp
449.BI remote " IPADDR"
450- specifies the unicast destination IP address to use in outgoing packets
451when the destination link layer address is not known in the VXLAN device
a89d5329 452forwarding database. This parameter cannot be specified with the
7cfa3802
AW
453.B group
454parameter.
2816a568
TR
455
456.sp
457.BI local " IPADDR"
458- specifies the source IP address to use in outgoing packets.
459
460.sp
461.BI ttl " TTL"
462- specifies the TTL value to use in outgoing packets.
463
464.sp
465.BI tos " TOS"
466- specifies the TOS value to use in outgoing packets.
467
f8eb79a6
DB
468.sp
469.BI flowlabel " FLOWLABEL"
470- specifies the flow label to use in outgoing packets.
471
2816a568 472.sp
503aa4e2
473.BI dstport " PORT"
474- specifies the UDP destination port to communicate to the remote VXLAN tunnel endpoint.
475
476.sp
477.BI srcport " MIN MAX"
2816a568
TR
478- specifies the range of port numbers to use as UDP
479source ports to communicate to the remote VXLAN tunnel endpoint.
480
481.sp
482.I [no]learning
483- specifies if unknown source link layer addresses and IP addresses
484are entered into the VXLAN device forwarding database.
485
486.sp
487.I [no]rsc
488- specifies if route short circuit is turned on.
489
490.sp
491.I [no]proxy
492- specifies ARP proxy is turned on.
493
494.sp
495.I [no]l2miss
496- specifies if netlink LLADDR miss notifications are generated.
497
498.sp
499.I [no]l3miss
500- specifies if netlink IP ADDR miss notifications are generated.
501
503aa4e2
502.sp
503.I [no]udpcsum
4853ee52 504- specifies if UDP checksum is calculated for transmitted packets over IPv4.
503aa4e2
505
506.sp
507.I [no]udp6zerocsumtx
4853ee52 508- skip UDP checksum calculation for transmitted packets over IPv6.
503aa4e2
509
510.sp
511.I [no]udp6zerocsumrx
4853ee52 512- allow incoming UDP packets over IPv6 with zero checksum field.
503aa4e2 513
c2fbc57e
ND
514.sp
515.BI ageing " SECONDS"
516- specifies the lifetime in seconds of FDB entries learnt by the kernel.
517
518.sp
519.BI maxaddress " NUMBER"
520- specifies the maximum number of FDB entries.
521
42d17a61
JB
522.sp
523.I [no]external
524- specifies whether an external control plane
525.RB "(e.g. " "ip route encap" )
526or the internal FDB should be used.
527
2eb90dc7
TG
528.sp
529.B gbp
530- enables the Group Policy extension (VXLAN-GBP).
531
532.in +4
533Allows to transport group policy context across VXLAN network peers.
534If enabled, includes the mark of a packet in the VXLAN header for outgoing
535packets and fills the packet mark based on the information found in the
536VXLAN header for incomming packets.
537
538Format of upper 16 bits of packet mark (flags);
539
540.in +2
541+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
542.br
543|-|-|-|-|-|-|-|-|-|D|-|-|A|-|-|-|
544.br
545+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
546
547.B D :=
548Don't Learn bit. When set, this bit indicates that the egress
549VTEP MUST NOT learn the source address of the encapsulated frame.
550
551.B A :=
552Indicates that the group policy has already been applied to
553this packet. Policies MUST NOT be applied by devices when the A bit is set.
554.in -2
555
556Format of lower 16 bits of packet mark (policy ID):
557
558.in +2
559+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
560.br
561| Group Policy ID |
562.br
563+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
564.in -2
565
566Example:
567 iptables -A OUTPUT [...] -j MARK --set-mark 0x800FF
568
569.in -4
570
346410bd
JB
571.sp
572.B gpe
573- enables the Generic Protocol extension (VXLAN-GPE). Currently, this is
574only supported together with the
575.B external
576keyword.
577
2816a568
TR
578.in -8
579
90f1df71
TH
580.TP
581GRE, IPIP, SIT Type Support
582For a link of types
583.I GRE/IPIP/SIT
584the following additional arguments are supported:
585
586.BI "ip link add " DEVICE
587.BR type " { gre | ipip | sit } "
588.BI " remote " ADDR " local " ADDR
1ab0f02f 589[
90f1df71 590.BR encap " { fou | gue | none } "
1ab0f02f 591] [
90f1df71 592.BI "encap-sport { " PORT " | auto } "
1ab0f02f 593] [
90f1df71 594.BI "encap-dport " PORT
1ab0f02f 595] [
90f1df71 596.I " [no]encap-csum "
1ab0f02f 597] [
90f1df71 598.I " [no]encap-remcsum "
1ab0f02f 599]
90f1df71
TH
600
601.in +8
602.sp
603.BI remote " ADDR "
604- specifies the remote address of the tunnel.
605
606.sp
607.BI local " ADDR "
608- specifies the fixed local address for tunneled packets.
609It must be an address on another interface on this host.
610
611.sp
612.BR encap " { fou | gue | none } "
613- specifies type of secondary UDP encapsulation. "fou" indicates
614Foo-Over-UDP, "gue" indicates Generic UDP Encapsulation.
615
616.sp
617.BI "encap-sport { " PORT " | auto } "
618- specifies the source port in UDP encapsulation.
619.IR PORT
620indicates the port by number, "auto"
621indicates that the port number should be chosen automatically
622(the kernel picks a flow based on the flow hash of the
623encapsulated packet).
624
625.sp
626.I [no]encap-csum
627- specifies if UDP checksums are enabled in the secondary
628encapsulation.
629
630.sp
631.I [no]encap-remcsum
632- specifies if Remote Checksum Offload is enabled. This is only
633applicable for Generic UDP Encapsulation.
634
635.in -8
636
9abde37c 637.TP
638IP6GRE/IP6GRETAP Type Support
63f60e3a 639For a link of type
9abde37c 640.I IP6GRE/IP6GRETAP
641the following additional arguments are supported:
642
643.BI "ip link add " DEVICE
644.BI type " { ip6gre | ip6gretap } " remote " ADDR " local " ADDR
1ab0f02f 645[
9abde37c 646.I "[i|o]seq]"
1ab0f02f 647] [
9abde37c 648.I "[i|o]key" KEY
1ab0f02f 649] [
9abde37c 650.I " [i|o]csum "
1ab0f02f 651] [
9abde37c 652.BI hoplimit " TTL "
1ab0f02f 653] [
9abde37c 654.BI encaplimit " ELIM "
1ab0f02f 655] [
9abde37c 656.BI tclass " TCLASS "
1ab0f02f 657] [
9abde37c 658.BI flowlabel " FLOWLABEL "
1ab0f02f 659] [
9abde37c 660.BI "dscp inherit"
1ab0f02f 661] [
9abde37c 662.BI dev " PHYS_DEV "
1ab0f02f 663]
9abde37c 664
665.in +8
666.sp
667.BI remote " ADDR "
668- specifies the remote IPv6 address of the tunnel.
669
670.sp
671.BI local " ADDR "
672- specifies the fixed local IPv6 address for tunneled packets.
90f1df71 673It must be an address on another interface on this host.
9abde37c 674
675.sp
676.BI [i|o]seq
677- serialize packets.
678The
679.B oseq
680flag enables sequencing of outgoing packets.
681The
682.B iseq
683flag requires that all input packets are serialized.
684
685.sp
686.BI [i|o]key " KEY"
687- use keyed GRE with key
688.IR KEY ". "KEY
689is either a number or an IPv4 address-like dotted quad.
690The
691.B key
692parameter specifies the same key to use in both directions.
693The
694.BR ikey " and " okey
695parameters specify different keys for input and output.
696
697.sp
698.BI [i|o]csum
699- generate/require checksums for tunneled packets.
700The
701.B ocsum
702flag calculates checksums for outgoing packets.
703The
704.B icsum
705flag requires that all input packets have the correct
a89d5329 706checksum. The
9abde37c 707.B csum
708flag is equivalent to the combination
709.BR "icsum ocsum" .
710
711.sp
712.BI hoplimit " TTL"
713- specifies Hop Limit value to use in outgoing packets.
714
715.sp
716.BI encaplimit " ELIM"
a89d5329 717- specifies a fixed encapsulation limit. Default is 4.
9abde37c 718
719.sp
720.BI flowlabel " FLOWLABEL"
63f60e3a 721- specifies a fixed flowlabel.
9abde37c 722
723.sp
724.BI tclass " TCLASS"
725- specifies the traffic class field on
726tunneled packets, which can be specified as either a two-digit
727hex value (e.g. c0) or a predefined string (e.g. internet).
728The value
729.B inherit
730causes the field to be copied from the original IP header. The
731values
732.BI "inherit/" STRING
733or
734.BI "inherit/" 00 ".." ff
735will set the field to
736.I STRING
737or
738.IR 00 ".." ff
739when tunneling non-IP packets. The default value is 00.
740
741.in -8
742
8ca8fac7
OG
743.TP
744IPoIB Type Support
745For a link of type
746.I IPoIB
747the following additional arguments are supported:
748
749.BI "ip link add " DEVICE " name " NAME
750.BI type " ipoib [ " pkey " PKEY ] [" mode " MODE " ]
751
752.in +8
753.sp
754.BI pkey " PKEY "
755- specifies the IB P-Key to use.
756
757.BI mode " MODE "
758- specifies the mode (datagram or connected) to use.
759
c1a1d8bc
JL
760.TP
761GENEVE Type Support
762For a link of type
763.I GENEVE
764the following additional arguments are supported:
765
766.BI "ip link add " DEVICE
767.BI type " geneve " id " ID " remote " IPADDR"
1ab0f02f 768[
f4c05c2e 769.BI ttl " TTL "
1ab0f02f 770] [
f4739b2e 771.BI tos " TOS "
29bb2373
DB
772] [
773.BI flowlabel " FLOWLABEL "
1ab0f02f 774]
c1a1d8bc
JL
775
776.in +8
777.sp
778.BI id " VNI "
779- specifies the Virtual Network Identifer to use.
780
781.sp
782.BI remote " IPADDR"
783- specifies the unicast destination IP address to use in outgoing packets.
784
f4c05c2e
JL
785.sp
786.BI ttl " TTL"
787- specifies the TTL value to use in outgoing packets.
788
f4739b2e
JL
789.sp
790.BI tos " TOS"
791- specifies the TOS value to use in outgoing packets.
792
29bb2373
DB
793.sp
794.BI flowlabel " FLOWLABEL"
795- specifies the flow label to use in outgoing packets.
796
c1a1d8bc
JL
797.in -8
798
a60223bc
PS
799.TP
800MACVLAN and MACVTAP Type Support
801For a link of type
802.I MACVLAN
803or
804.I MACVTAP
805the following additional arguments are supported:
806
807.BI "ip link add link " DEVICE " name " NAME
808.BR type " { " macvlan " | " macvtap " } "
809.BR mode " { " private " | " vepa " | " bridge " | " passthru
810.BR " [ " nopromisc " ] } "
811
812.in +8
813.sp
814.BR type " { " macvlan " | " macvtap " } "
815- specifies the link type to use.
816.BR macvlan " creates just a virtual interface, while "
817.BR macvtap " in addition creates a character device "
818.BR /dev/tapX " to be used just like a " tuntap " device."
819
820.B mode private
821- Do not allow communication between
822.B macvlan
823instances on the same physical interface, even if the external switch supports
824hairpin mode.
825
826.B mode vepa
827- Virtual Ethernet Port Aggregator mode. Data from one
828.B macvlan
829instance to the other on the same physical interface is transmitted over the
830physical interface. Either the attached switch needs to support hairpin mode,
831or there must be a TCP/IP router forwarding the packets in order to allow
832communication. This is the default mode.
833
834.B mode bridge
835- In bridge mode, all endpoints are directly connected to each other,
836communication is not redirected through the physical interface's peer.
837
838.BR mode " " passthru " [ " nopromisc " ] "
839- This mode gives more power to a single endpoint, usually in
840.BR macvtap " mode. It is not allowed for more than one endpoint on the same "
841physical interface. All traffic will be forwarded to this endpoint, allowing
842virtio guests to change MAC address or set promiscuous mode in order to bridge
843the interface or create vlan interfaces on top of it. By default, this mode
844forces the underlying interface into promiscuous mode. Passing the
845.BR nopromisc " flag prevents this, so the promisc flag may be controlled "
846using standard tools.
847.in -8
848
761a1e60 849.SS ip link delete - delete virtual link
761a1e60
CT
850
851.TP
852.BI dev " DEVICE "
7f74cf6d
VK
853specifies the virtual device to act operate on.
854
855.TP
856.BI group " GROUP "
857specifies the group of virtual links to delete. Group 0 is not allowed to be
858deleted since it is the default group.
859
860.TP
861.BI type " TYPE "
862specifies the type of the device.
761a1e60
CT
863
864.SS ip link set - change device attributes
865
866.TP
867.BI dev " DEVICE "
868.I DEVICE
6274b0b7 869specifies network device to operate on. When configuring SR-IOV Virtual Function
761a1e60
CT
870(VF) devices, this keyword should specify the associated Physical Function (PF)
871device.
872
873.TP
874.BI group " GROUP "
875.I GROUP
876has a dual role: If both group and dev are present, then move the device to the
a89d5329 877specified group. If only a group is specified, then the command operates on
761a1e60
CT
878all devices in that group.
879
880.TP
881.BR up " and " down
882change the state of the device to
883.B UP
884or
885.BR "DOWN" .
886
887.TP
888.BR "arp on " or " arp off"
889change the
890.B NOARP
891flag on the device.
892
893.TP
894.BR "multicast on " or " multicast off"
895change the
896.B MULTICAST
897flag on the device.
898
18864827
AK
899.TP
900.BR "protodown on " or " protodown off"
901change the
902.B PROTODOWN
903state 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.
904
761a1e60
CT
905.TP
906.BR "dynamic on " or " dynamic off"
907change the
908.B DYNAMIC
34c8a95c
VK
909flag on the device. Indicates that address can change when interface goes down (currently
910.B NOT
911used by the Linux).
761a1e60
CT
912
913.TP
914.BI name " NAME"
a89d5329 915change the name of the device. This operation is not
761a1e60
CT
916recommended if the device is running or has some addresses
917already configured.
918
919.TP
920.BI txqueuelen " NUMBER"
921.TP
922.BI txqlen " NUMBER"
923change the transmit queue length of the device.
924
925.TP
926.BI mtu " NUMBER"
927change the
928.I MTU
929of the device.
930
931.TP
932.BI address " LLADDRESS"
933change the station address of the interface.
934
935.TP
936.BI broadcast " LLADDRESS"
937.TP
938.BI brd " LLADDRESS"
939.TP
940.BI peer " LLADDRESS"
941change the link layer broadcast address or the peer address when
942the interface is
943.IR "POINTOPOINT" .
944
945.TP
36324eba 946.BI netns " NETNSNAME " \fR| " PID"
761a1e60 947move the device to the network namespace associated with name
36324eba
VK
948.IR "NETNSNAME " or
949.RI process " PID".
950
951Some devices are not allowed to change network namespace: loopback, bridge,
952ppp, wireless. These are network namespace local devices. In such case
953.B ip
954tool will return "Invalid argument" error. It is possible to find out if device is local
955to a single network namespace by checking
956.B netns-local
957flag in the output of the
958.BR ethtool ":"
959
960.in +8
961.B ethtool -k
962.I DEVICE
963.in -8
964
965To change network namespace for wireless devices the
966.B iw
967tool can be used. But it allows to change network namespace only for physical devices and by process
968.IR PID .
761a1e60
CT
969
970.TP
971.BI alias " NAME"
972give the device a symbolic name for easy reference.
973
503aa4e2
974.TP
975.BI group " GROUP"
976specify the group the device belongs to.
977The available groups are listed in file
978.BR "@SYSCONFDIR@/group" .
979
761a1e60
CT
980.TP
981.BI vf " NUM"
982specify a Virtual Function device to be configured. The associated PF device
983must be specified using the
984.B dev
985parameter.
986
987.in +8
988.BI mac " LLADDRESS"
989- change the station address for the specified VF. The
990.B vf
991parameter must be specified.
992
993.sp
994.BI vlan " VLANID"
995- change the assigned VLAN for the specified VF. When specified, all traffic
996sent from the VF will be tagged with the specified VLAN ID. Incoming traffic
997will be filtered for the specified VLAN ID, and will have all VLAN tags
998stripped before being passed to the VF. Setting this parameter to 0 disables
999VLAN tagging and filtering. The
1000.B vf
1001parameter must be specified.
1002
1003.sp
1004.BI qos " VLAN-QOS"
1005- assign VLAN QOS (priority) bits for the VLAN tag. When specified, all VLAN
1006tags transmitted by the VF will include the specified priority bits in the
1007VLAN tag. If not specified, the value is assumed to be 0. Both the
1008.B vf
1009and
1010.B vlan
1011parameters must be specified. Setting both
1012.B vlan
1013and
1014.B qos
1015as 0 disables VLAN tagging and filtering for the VF.
1016
1017.sp
1018.BI rate " TXRATE"
f89a2a05
SC
1019-- change the allowed transmit bandwidth, in Mbps, for the specified VF.
1020Setting this parameter to 0 disables rate limiting.
1021.B vf
1022parameter must be specified.
1023Please use new API
1024.B "max_tx_rate"
1025option instead.
1026
1027.sp
1028.BI max_tx_rate " TXRATE"
1029- change the allowed maximum transmit bandwidth, in Mbps, for the specified VF.
1030.B vf
1031parameter must be specified.
1032
1033.sp
1034.BI min_tx_rate " TXRATE"
1035- change the allowed minimum transmit bandwidth, in Mbps, for the specified VF.
1036Minimum TXRATE should be always <= Maximum TXRATE.
761a1e60
CT
1037.B vf
1038parameter must be specified.
1039
1040.sp
1041.BI spoofchk " on|off"
1042- turn packet spoof checking on or off for the specified VF.
63f60e3a
OG
1043.sp
1044.BI state " auto|enable|disable"
1045- set the virtual link state as seen by the specified VF. Setting to auto means a
1046reflection of the PF link state, enable lets the VF to communicate with other VFs on
1047this host even if the PF link state is down, disable causes the HW to drop any packets
1048sent by the VF.
b6d77d9e
HS
1049.sp
1050.BI trust " on|off"
1051- trust the specified VF user. This enables that VF user can set a specific feature
1052which may impact security and/or performance. (e.g. VF multicast promiscuous mode)
761a1e60
CT
1053.in -8
1054
1055.TP
1056.BI master " DEVICE"
1057set master device of the device (enslave device).
1058
1059.TP
1060.BI nomaster
1061unset master device of the device (release device).
1062
503aa4e2 1063.TP
8f0777a8
BM
1064.BI addrgenmode " eui64|none|stable_secret|random"
1065set the IPv6 address generation mode
1066
1067.I eui64
1068- use a Modified EUI-64 format interface identifier
1069
1070.I none
1071- disable automatic address generation
1072
1073.I stable_secret
1074- generate the interface identifier based on a preset /proc/sys/net/ipv6/conf/{default,DEVICE}/stable_secret
1075
1076.I random
1077- like stable_secret, but auto-generate a new random secret if none is set
503aa4e2
1078
1079.TP
1080.BR "link-netnsid "
1081set peer netnsid for a cross-netns interface
1082
761a1e60
CT
1083.PP
1084.B Warning:
1085If multiple parameter changes are requested,
1086.B ip
1087aborts immediately after any of the changes have failed.
1088This is the only case when
1089.B ip
a89d5329 1090can move the system to an unpredictable state. The solution
761a1e60
CT
1091is to avoid changing several parameters with one
1092.B ip link set
1093call.
1094
1095.SS ip link show - display device attributes
1096
1097.TP
1098.BI dev " NAME " (default)
1099.I NAME
1100specifies the network device to show.
1101If this argument is omitted all devices in the default group are listed.
1102
1103.TP
1104.BI group " GROUP "
1105.I GROUP
1106specifies what group of devices to show.
1107
1108.TP
1109.B up
1110only display running interfaces.
1111
1b944148
VK
1112.TP
1113.BI master " DEVICE "
1114.I DEVICE
1115specifies the master device which enslaves devices to show.
1116
712249d8
VK
1117.TP
1118.BI type " TYPE "
1119.I TYPE
1120specifies the type of devices to show.
1121
1f299e92 1122.SS ip link help - display help
1123
1124.PP
1125.I "TYPE"
1126specifies which help of link type to dislpay.
1127
032b4f4d
VK
1128.SS
1129.I GROUP
1130may be a number or a string from the file
699589f6 1131.B @SYSCONFDIR@/group
032b4f4d
VK
1132which can be manually filled.
1133
761a1e60
CT
1134.SH "EXAMPLES"
1135.PP
1136ip link show
1137.RS 4
1138Shows the state of all network interfaces on the system.
1139.RE
1140.PP
712249d8
VK
1141ip link show type bridge
1142.RS 4
1143Shows the bridge devices.
1144.RE
1145.PP
1146ip link show type vlan
1147.RS 4
1148Shows the vlan devices.
1149.RE
1150.PP
417b2180
VK
1151ip link show master br0
1152.RS 4
1153Shows devices enslaved by br0
1154.RE
1155.PP
761a1e60
CT
1156ip link set dev ppp0 mtu 1400
1157.RS 4
1158Change the MTU the ppp0 device.
1159.RE
1160.PP
1161ip link add link eth0 name eth0.10 type vlan id 10
1162.RS 4
1163Creates a new vlan device eth0.10 on device eth0.
1164.RE
1165.PP
1166ip link delete dev eth0.10
1167.RS 4
1168Removes vlan device.
1169.RE
1170
1f299e92 1171ip link help gre
1172.RS 4
1173Display help for the gre link type.
90f1df71
TH
1174.RE
1175.PP
1176ip link add name tun1 type ipip remote 192.168.1.1
1177local 192.168.1.2 ttl 225 encap gue encap-sport auto
1178encap-dport 5555 encap-csum encap-remcsum
1179.RS 4
1180Creates an IPIP that is encapsulated with Generic UDP Encapsulation,
1181and the outer UDP checksum and remote checksum offload are enabled.
1182
2c0feda8
LB
1183.RE
1184.PP
1185ip link add link wpan0 lowpan0 type lowpan
1186.RS 4
1187Creates a 6LoWPAN interface named lowpan0 on the underlying
1188IEEE 802.15.4 device wpan0.
1f299e92 1189.RE
1190
761a1e60
CT
1191.SH SEE ALSO
1192.br
d5910297 1193.BR ip (8),
e612883c 1194.BR ip-netns (8),
ab872442
VK
1195.BR ethtool (8),
1196.BR iptables (8)
761a1e60
CT
1197
1198.SH AUTHOR
1199Original Manpage by Michail Litvak <mci@owl.openwall.com>