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