]> git.proxmox.com Git - mirror_iproute2.git/blame - man/man8/ip-link.8.in
vxlan: add support to set flow label
[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] [
2eb90dc7 425.B gbp
1ab0f02f 426]
2816a568
TR
427
428.in +8
429.sp
430.BI id " VNI "
431- specifies the VXLAN Network Identifer (or VXLAN Segment
432Identifier) to use.
433
434.BI dev " PHYS_DEV"
435- specifies the physical device to use for tunnel endpoint communication.
436
437.sp
438.BI group " IPADDR"
439- specifies the multicast IP address to join.
7cfa3802
AW
440This parameter cannot be specified with the
441.B remote
442parameter.
443
444.sp
445.BI remote " IPADDR"
446- specifies the unicast destination IP address to use in outgoing packets
447when the destination link layer address is not known in the VXLAN device
a89d5329 448forwarding database. This parameter cannot be specified with the
7cfa3802
AW
449.B group
450parameter.
2816a568
TR
451
452.sp
453.BI local " IPADDR"
454- specifies the source IP address to use in outgoing packets.
455
456.sp
457.BI ttl " TTL"
458- specifies the TTL value to use in outgoing packets.
459
460.sp
461.BI tos " TOS"
462- specifies the TOS value to use in outgoing packets.
463
f8eb79a6
DB
464.sp
465.BI flowlabel " FLOWLABEL"
466- specifies the flow label to use in outgoing packets.
467
2816a568 468.sp
503aa4e2
469.BI dstport " PORT"
470- specifies the UDP destination port to communicate to the remote VXLAN tunnel endpoint.
471
472.sp
473.BI srcport " MIN MAX"
2816a568
TR
474- specifies the range of port numbers to use as UDP
475source ports to communicate to the remote VXLAN tunnel endpoint.
476
477.sp
478.I [no]learning
479- specifies if unknown source link layer addresses and IP addresses
480are entered into the VXLAN device forwarding database.
481
482.sp
483.I [no]rsc
484- specifies if route short circuit is turned on.
485
486.sp
487.I [no]proxy
488- specifies ARP proxy is turned on.
489
490.sp
491.I [no]l2miss
492- specifies if netlink LLADDR miss notifications are generated.
493
494.sp
495.I [no]l3miss
496- specifies if netlink IP ADDR miss notifications are generated.
497
503aa4e2
498.sp
499.I [no]udpcsum
4853ee52 500- specifies if UDP checksum is calculated for transmitted packets over IPv4.
503aa4e2
501
502.sp
503.I [no]udp6zerocsumtx
4853ee52 504- skip UDP checksum calculation for transmitted packets over IPv6.
503aa4e2
505
506.sp
507.I [no]udp6zerocsumrx
4853ee52 508- allow incoming UDP packets over IPv6 with zero checksum field.
503aa4e2 509
c2fbc57e
ND
510.sp
511.BI ageing " SECONDS"
512- specifies the lifetime in seconds of FDB entries learnt by the kernel.
513
514.sp
515.BI maxaddress " NUMBER"
516- specifies the maximum number of FDB entries.
517
2eb90dc7
TG
518.sp
519.B gbp
520- enables the Group Policy extension (VXLAN-GBP).
521
522.in +4
523Allows to transport group policy context across VXLAN network peers.
524If enabled, includes the mark of a packet in the VXLAN header for outgoing
525packets and fills the packet mark based on the information found in the
526VXLAN header for incomming packets.
527
528Format of upper 16 bits of packet mark (flags);
529
530.in +2
531+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
532.br
533|-|-|-|-|-|-|-|-|-|D|-|-|A|-|-|-|
534.br
535+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
536
537.B D :=
538Don't Learn bit. When set, this bit indicates that the egress
539VTEP MUST NOT learn the source address of the encapsulated frame.
540
541.B A :=
542Indicates that the group policy has already been applied to
543this packet. Policies MUST NOT be applied by devices when the A bit is set.
544.in -2
545
546Format of lower 16 bits of packet mark (policy ID):
547
548.in +2
549+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
550.br
551| Group Policy ID |
552.br
553+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
554.in -2
555
556Example:
557 iptables -A OUTPUT [...] -j MARK --set-mark 0x800FF
558
559.in -4
560
2816a568
TR
561.in -8
562
90f1df71
TH
563.TP
564GRE, IPIP, SIT Type Support
565For a link of types
566.I GRE/IPIP/SIT
567the following additional arguments are supported:
568
569.BI "ip link add " DEVICE
570.BR type " { gre | ipip | sit } "
571.BI " remote " ADDR " local " ADDR
1ab0f02f 572[
90f1df71 573.BR encap " { fou | gue | none } "
1ab0f02f 574] [
90f1df71 575.BI "encap-sport { " PORT " | auto } "
1ab0f02f 576] [
90f1df71 577.BI "encap-dport " PORT
1ab0f02f 578] [
90f1df71 579.I " [no]encap-csum "
1ab0f02f 580] [
90f1df71 581.I " [no]encap-remcsum "
1ab0f02f 582]
90f1df71
TH
583
584.in +8
585.sp
586.BI remote " ADDR "
587- specifies the remote address of the tunnel.
588
589.sp
590.BI local " ADDR "
591- specifies the fixed local address for tunneled packets.
592It must be an address on another interface on this host.
593
594.sp
595.BR encap " { fou | gue | none } "
596- specifies type of secondary UDP encapsulation. "fou" indicates
597Foo-Over-UDP, "gue" indicates Generic UDP Encapsulation.
598
599.sp
600.BI "encap-sport { " PORT " | auto } "
601- specifies the source port in UDP encapsulation.
602.IR PORT
603indicates the port by number, "auto"
604indicates that the port number should be chosen automatically
605(the kernel picks a flow based on the flow hash of the
606encapsulated packet).
607
608.sp
609.I [no]encap-csum
610- specifies if UDP checksums are enabled in the secondary
611encapsulation.
612
613.sp
614.I [no]encap-remcsum
615- specifies if Remote Checksum Offload is enabled. This is only
616applicable for Generic UDP Encapsulation.
617
618.in -8
619
9abde37c 620.TP
621IP6GRE/IP6GRETAP Type Support
63f60e3a 622For a link of type
9abde37c 623.I IP6GRE/IP6GRETAP
624the following additional arguments are supported:
625
626.BI "ip link add " DEVICE
627.BI type " { ip6gre | ip6gretap } " remote " ADDR " local " ADDR
1ab0f02f 628[
9abde37c 629.I "[i|o]seq]"
1ab0f02f 630] [
9abde37c 631.I "[i|o]key" KEY
1ab0f02f 632] [
9abde37c 633.I " [i|o]csum "
1ab0f02f 634] [
9abde37c 635.BI hoplimit " TTL "
1ab0f02f 636] [
9abde37c 637.BI encaplimit " ELIM "
1ab0f02f 638] [
9abde37c 639.BI tclass " TCLASS "
1ab0f02f 640] [
9abde37c 641.BI flowlabel " FLOWLABEL "
1ab0f02f 642] [
9abde37c 643.BI "dscp inherit"
1ab0f02f 644] [
9abde37c 645.BI dev " PHYS_DEV "
1ab0f02f 646]
9abde37c 647
648.in +8
649.sp
650.BI remote " ADDR "
651- specifies the remote IPv6 address of the tunnel.
652
653.sp
654.BI local " ADDR "
655- specifies the fixed local IPv6 address for tunneled packets.
90f1df71 656It must be an address on another interface on this host.
9abde37c 657
658.sp
659.BI [i|o]seq
660- serialize packets.
661The
662.B oseq
663flag enables sequencing of outgoing packets.
664The
665.B iseq
666flag requires that all input packets are serialized.
667
668.sp
669.BI [i|o]key " KEY"
670- use keyed GRE with key
671.IR KEY ". "KEY
672is either a number or an IPv4 address-like dotted quad.
673The
674.B key
675parameter specifies the same key to use in both directions.
676The
677.BR ikey " and " okey
678parameters specify different keys for input and output.
679
680.sp
681.BI [i|o]csum
682- generate/require checksums for tunneled packets.
683The
684.B ocsum
685flag calculates checksums for outgoing packets.
686The
687.B icsum
688flag requires that all input packets have the correct
a89d5329 689checksum. The
9abde37c 690.B csum
691flag is equivalent to the combination
692.BR "icsum ocsum" .
693
694.sp
695.BI hoplimit " TTL"
696- specifies Hop Limit value to use in outgoing packets.
697
698.sp
699.BI encaplimit " ELIM"
a89d5329 700- specifies a fixed encapsulation limit. Default is 4.
9abde37c 701
702.sp
703.BI flowlabel " FLOWLABEL"
63f60e3a 704- specifies a fixed flowlabel.
9abde37c 705
706.sp
707.BI tclass " TCLASS"
708- specifies the traffic class field on
709tunneled packets, which can be specified as either a two-digit
710hex value (e.g. c0) or a predefined string (e.g. internet).
711The value
712.B inherit
713causes the field to be copied from the original IP header. The
714values
715.BI "inherit/" STRING
716or
717.BI "inherit/" 00 ".." ff
718will set the field to
719.I STRING
720or
721.IR 00 ".." ff
722when tunneling non-IP packets. The default value is 00.
723
724.in -8
725
8ca8fac7
OG
726.TP
727IPoIB Type Support
728For a link of type
729.I IPoIB
730the following additional arguments are supported:
731
732.BI "ip link add " DEVICE " name " NAME
733.BI type " ipoib [ " pkey " PKEY ] [" mode " MODE " ]
734
735.in +8
736.sp
737.BI pkey " PKEY "
738- specifies the IB P-Key to use.
739
740.BI mode " MODE "
741- specifies the mode (datagram or connected) to use.
742
c1a1d8bc
JL
743.TP
744GENEVE Type Support
745For a link of type
746.I GENEVE
747the following additional arguments are supported:
748
749.BI "ip link add " DEVICE
750.BI type " geneve " id " ID " remote " IPADDR"
1ab0f02f 751[
f4c05c2e 752.BI ttl " TTL "
1ab0f02f 753] [
f4739b2e 754.BI tos " TOS "
1ab0f02f 755]
c1a1d8bc
JL
756
757.in +8
758.sp
759.BI id " VNI "
760- specifies the Virtual Network Identifer to use.
761
762.sp
763.BI remote " IPADDR"
764- specifies the unicast destination IP address to use in outgoing packets.
765
f4c05c2e
JL
766.sp
767.BI ttl " TTL"
768- specifies the TTL value to use in outgoing packets.
769
f4739b2e
JL
770.sp
771.BI tos " TOS"
772- specifies the TOS value to use in outgoing packets.
773
c1a1d8bc
JL
774.in -8
775
a60223bc
PS
776.TP
777MACVLAN and MACVTAP Type Support
778For a link of type
779.I MACVLAN
780or
781.I MACVTAP
782the following additional arguments are supported:
783
784.BI "ip link add link " DEVICE " name " NAME
785.BR type " { " macvlan " | " macvtap " } "
786.BR mode " { " private " | " vepa " | " bridge " | " passthru
787.BR " [ " nopromisc " ] } "
788
789.in +8
790.sp
791.BR type " { " macvlan " | " macvtap " } "
792- specifies the link type to use.
793.BR macvlan " creates just a virtual interface, while "
794.BR macvtap " in addition creates a character device "
795.BR /dev/tapX " to be used just like a " tuntap " device."
796
797.B mode private
798- Do not allow communication between
799.B macvlan
800instances on the same physical interface, even if the external switch supports
801hairpin mode.
802
803.B mode vepa
804- Virtual Ethernet Port Aggregator mode. Data from one
805.B macvlan
806instance to the other on the same physical interface is transmitted over the
807physical interface. Either the attached switch needs to support hairpin mode,
808or there must be a TCP/IP router forwarding the packets in order to allow
809communication. This is the default mode.
810
811.B mode bridge
812- In bridge mode, all endpoints are directly connected to each other,
813communication is not redirected through the physical interface's peer.
814
815.BR mode " " passthru " [ " nopromisc " ] "
816- This mode gives more power to a single endpoint, usually in
817.BR macvtap " mode. It is not allowed for more than one endpoint on the same "
818physical interface. All traffic will be forwarded to this endpoint, allowing
819virtio guests to change MAC address or set promiscuous mode in order to bridge
820the interface or create vlan interfaces on top of it. By default, this mode
821forces the underlying interface into promiscuous mode. Passing the
822.BR nopromisc " flag prevents this, so the promisc flag may be controlled "
823using standard tools.
824.in -8
825
761a1e60 826.SS ip link delete - delete virtual link
761a1e60
CT
827
828.TP
829.BI dev " DEVICE "
7f74cf6d
VK
830specifies the virtual device to act operate on.
831
832.TP
833.BI group " GROUP "
834specifies the group of virtual links to delete. Group 0 is not allowed to be
835deleted since it is the default group.
836
837.TP
838.BI type " TYPE "
839specifies the type of the device.
761a1e60
CT
840
841.SS ip link set - change device attributes
842
843.TP
844.BI dev " DEVICE "
845.I DEVICE
6274b0b7 846specifies network device to operate on. When configuring SR-IOV Virtual Function
761a1e60
CT
847(VF) devices, this keyword should specify the associated Physical Function (PF)
848device.
849
850.TP
851.BI group " GROUP "
852.I GROUP
853has a dual role: If both group and dev are present, then move the device to the
a89d5329 854specified group. If only a group is specified, then the command operates on
761a1e60
CT
855all devices in that group.
856
857.TP
858.BR up " and " down
859change the state of the device to
860.B UP
861or
862.BR "DOWN" .
863
864.TP
865.BR "arp on " or " arp off"
866change the
867.B NOARP
868flag on the device.
869
870.TP
871.BR "multicast on " or " multicast off"
872change the
873.B MULTICAST
874flag on the device.
875
18864827
AK
876.TP
877.BR "protodown on " or " protodown off"
878change the
879.B PROTODOWN
880state 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.
881
761a1e60
CT
882.TP
883.BR "dynamic on " or " dynamic off"
884change the
885.B DYNAMIC
34c8a95c
VK
886flag on the device. Indicates that address can change when interface goes down (currently
887.B NOT
888used by the Linux).
761a1e60
CT
889
890.TP
891.BI name " NAME"
a89d5329 892change the name of the device. This operation is not
761a1e60
CT
893recommended if the device is running or has some addresses
894already configured.
895
896.TP
897.BI txqueuelen " NUMBER"
898.TP
899.BI txqlen " NUMBER"
900change the transmit queue length of the device.
901
902.TP
903.BI mtu " NUMBER"
904change the
905.I MTU
906of the device.
907
908.TP
909.BI address " LLADDRESS"
910change the station address of the interface.
911
912.TP
913.BI broadcast " LLADDRESS"
914.TP
915.BI brd " LLADDRESS"
916.TP
917.BI peer " LLADDRESS"
918change the link layer broadcast address or the peer address when
919the interface is
920.IR "POINTOPOINT" .
921
922.TP
36324eba 923.BI netns " NETNSNAME " \fR| " PID"
761a1e60 924move the device to the network namespace associated with name
36324eba
VK
925.IR "NETNSNAME " or
926.RI process " PID".
927
928Some devices are not allowed to change network namespace: loopback, bridge,
929ppp, wireless. These are network namespace local devices. In such case
930.B ip
931tool will return "Invalid argument" error. It is possible to find out if device is local
932to a single network namespace by checking
933.B netns-local
934flag in the output of the
935.BR ethtool ":"
936
937.in +8
938.B ethtool -k
939.I DEVICE
940.in -8
941
942To change network namespace for wireless devices the
943.B iw
944tool can be used. But it allows to change network namespace only for physical devices and by process
945.IR PID .
761a1e60
CT
946
947.TP
948.BI alias " NAME"
949give the device a symbolic name for easy reference.
950
503aa4e2
951.TP
952.BI group " GROUP"
953specify the group the device belongs to.
954The available groups are listed in file
955.BR "@SYSCONFDIR@/group" .
956
761a1e60
CT
957.TP
958.BI vf " NUM"
959specify a Virtual Function device to be configured. The associated PF device
960must be specified using the
961.B dev
962parameter.
963
964.in +8
965.BI mac " LLADDRESS"
966- change the station address for the specified VF. The
967.B vf
968parameter must be specified.
969
970.sp
971.BI vlan " VLANID"
972- change the assigned VLAN for the specified VF. When specified, all traffic
973sent from the VF will be tagged with the specified VLAN ID. Incoming traffic
974will be filtered for the specified VLAN ID, and will have all VLAN tags
975stripped before being passed to the VF. Setting this parameter to 0 disables
976VLAN tagging and filtering. The
977.B vf
978parameter must be specified.
979
980.sp
981.BI qos " VLAN-QOS"
982- assign VLAN QOS (priority) bits for the VLAN tag. When specified, all VLAN
983tags transmitted by the VF will include the specified priority bits in the
984VLAN tag. If not specified, the value is assumed to be 0. Both the
985.B vf
986and
987.B vlan
988parameters must be specified. Setting both
989.B vlan
990and
991.B qos
992as 0 disables VLAN tagging and filtering for the VF.
993
994.sp
995.BI rate " TXRATE"
f89a2a05
SC
996-- change the allowed transmit bandwidth, in Mbps, for the specified VF.
997Setting this parameter to 0 disables rate limiting.
998.B vf
999parameter must be specified.
1000Please use new API
1001.B "max_tx_rate"
1002option instead.
1003
1004.sp
1005.BI max_tx_rate " TXRATE"
1006- change the allowed maximum transmit bandwidth, in Mbps, for the specified VF.
1007.B vf
1008parameter must be specified.
1009
1010.sp
1011.BI min_tx_rate " TXRATE"
1012- change the allowed minimum transmit bandwidth, in Mbps, for the specified VF.
1013Minimum TXRATE should be always <= Maximum TXRATE.
761a1e60
CT
1014.B vf
1015parameter must be specified.
1016
1017.sp
1018.BI spoofchk " on|off"
1019- turn packet spoof checking on or off for the specified VF.
63f60e3a
OG
1020.sp
1021.BI state " auto|enable|disable"
1022- set the virtual link state as seen by the specified VF. Setting to auto means a
1023reflection of the PF link state, enable lets the VF to communicate with other VFs on
1024this host even if the PF link state is down, disable causes the HW to drop any packets
1025sent by the VF.
b6d77d9e
HS
1026.sp
1027.BI trust " on|off"
1028- trust the specified VF user. This enables that VF user can set a specific feature
1029which may impact security and/or performance. (e.g. VF multicast promiscuous mode)
761a1e60
CT
1030.in -8
1031
1032.TP
1033.BI master " DEVICE"
1034set master device of the device (enslave device).
1035
1036.TP
1037.BI nomaster
1038unset master device of the device (release device).
1039
503aa4e2 1040.TP
8f0777a8
BM
1041.BI addrgenmode " eui64|none|stable_secret|random"
1042set the IPv6 address generation mode
1043
1044.I eui64
1045- use a Modified EUI-64 format interface identifier
1046
1047.I none
1048- disable automatic address generation
1049
1050.I stable_secret
1051- generate the interface identifier based on a preset /proc/sys/net/ipv6/conf/{default,DEVICE}/stable_secret
1052
1053.I random
1054- like stable_secret, but auto-generate a new random secret if none is set
503aa4e2
1055
1056.TP
1057.BR "link-netnsid "
1058set peer netnsid for a cross-netns interface
1059
761a1e60
CT
1060.PP
1061.B Warning:
1062If multiple parameter changes are requested,
1063.B ip
1064aborts immediately after any of the changes have failed.
1065This is the only case when
1066.B ip
a89d5329 1067can move the system to an unpredictable state. The solution
761a1e60
CT
1068is to avoid changing several parameters with one
1069.B ip link set
1070call.
1071
1072.SS ip link show - display device attributes
1073
1074.TP
1075.BI dev " NAME " (default)
1076.I NAME
1077specifies the network device to show.
1078If this argument is omitted all devices in the default group are listed.
1079
1080.TP
1081.BI group " GROUP "
1082.I GROUP
1083specifies what group of devices to show.
1084
1085.TP
1086.B up
1087only display running interfaces.
1088
1b944148
VK
1089.TP
1090.BI master " DEVICE "
1091.I DEVICE
1092specifies the master device which enslaves devices to show.
1093
712249d8
VK
1094.TP
1095.BI type " TYPE "
1096.I TYPE
1097specifies the type of devices to show.
1098
8322d28d 1099.TP
1e264abc
SH
1100The show command has additional formatting options:
1101
8322d28d 1102.RS
1e264abc
SH
1103.TP
1104.BR "\-s" , " \-stats", " \-statistics"
1105output more statistics about packet usage.
1106
1107.TP
1108.BR "\-d", " \-details"
1109output more detailed information.
1110
1111.TP
e52f3ef7 1112.BR "\-h", " \-human", " \-human-readable"
1e264abc
SH
1113output statistics with human readable values number followed by suffix
1114
1115.TP
1116.BR "\-iec"
1117print human readable rates in IEC units (ie. 1K = 1024).
8322d28d 1118.RE
b68d9837 1119
1f299e92 1120.SS ip link help - display help
1121
1122.PP
1123.I "TYPE"
1124specifies which help of link type to dislpay.
1125
032b4f4d
VK
1126.SS
1127.I GROUP
1128may be a number or a string from the file
699589f6 1129.B @SYSCONFDIR@/group
032b4f4d
VK
1130which can be manually filled.
1131
761a1e60
CT
1132.SH "EXAMPLES"
1133.PP
1134ip link show
1135.RS 4
1136Shows the state of all network interfaces on the system.
1137.RE
1138.PP
712249d8
VK
1139ip link show type bridge
1140.RS 4
1141Shows the bridge devices.
1142.RE
1143.PP
1144ip link show type vlan
1145.RS 4
1146Shows the vlan devices.
1147.RE
1148.PP
417b2180
VK
1149ip link show master br0
1150.RS 4
1151Shows devices enslaved by br0
1152.RE
1153.PP
761a1e60
CT
1154ip link set dev ppp0 mtu 1400
1155.RS 4
1156Change the MTU the ppp0 device.
1157.RE
1158.PP
1159ip link add link eth0 name eth0.10 type vlan id 10
1160.RS 4
1161Creates a new vlan device eth0.10 on device eth0.
1162.RE
1163.PP
1164ip link delete dev eth0.10
1165.RS 4
1166Removes vlan device.
1167.RE
1168
1f299e92 1169ip link help gre
1170.RS 4
1171Display help for the gre link type.
90f1df71
TH
1172.RE
1173.PP
1174ip link add name tun1 type ipip remote 192.168.1.1
1175local 192.168.1.2 ttl 225 encap gue encap-sport auto
1176encap-dport 5555 encap-csum encap-remcsum
1177.RS 4
1178Creates an IPIP that is encapsulated with Generic UDP Encapsulation,
1179and the outer UDP checksum and remote checksum offload are enabled.
1180
2c0feda8
LB
1181.RE
1182.PP
1183ip link add link wpan0 lowpan0 type lowpan
1184.RS 4
1185Creates a 6LoWPAN interface named lowpan0 on the underlying
1186IEEE 802.15.4 device wpan0.
1f299e92 1187.RE
1188
761a1e60
CT
1189.SH SEE ALSO
1190.br
d5910297 1191.BR ip (8),
e612883c 1192.BR ip-netns (8),
ab872442
VK
1193.BR ethtool (8),
1194.BR iptables (8)
761a1e60
CT
1195
1196.SH AUTHOR
1197Original Manpage by Michail Litvak <mci@owl.openwall.com>