blob: 383917a63669a0a30ac9dbefc6b7d3e8cacc80b1 [file] [log] [blame]
Nicolas Dichtel77987912012-12-13 03:42:52 +00001.TH IP\-LINK 8 "13 Dec 2012" "iproute2" "Linux"
Christoph J. Thompson761a1e62012-03-01 17:45:45 +01002.SH "NAME"
3ip-link \- network device configuration
4.SH "SYNOPSIS"
5.sp
6.ad l
7.in +8
8.ti -8
9.B ip
10.RI "[ " OPTIONS " ]"
11.B link
12.RI " { " COMMAND " | "
13.BR help " }"
14.sp
15
16.ti -8
17.IR OPTIONS " := { "
18\fB\-V\fR[\fIersion\fR] |
19\fB\-s\fR[\fItatistics\fR] |
20\fB\-r\fR[\fIesolve\fR] |
21\fB\-f\fR[\fIamily\fR] {
22.BR inet " | " inet6 " | " ipx " | " dnet " | " link " } | "
23\fB\-o\fR[\fIneline\fR] }
24
25.ti -8
Andreas Henriksson9fc56972012-05-21 15:48:06 +020026.BI "ip link add"
27.RB "[ " link
28.IR DEVICE " ]"
Christoph J. Thompson761a1e62012-03-01 17:45:45 +010029.RB "[ " name " ]"
30.I NAME
31.br
32.RB "[ " txqueuelen
33.IR PACKETS " ]"
34.br
35.RB "[ " address
36.IR LLADDR " ]"
37.RB "[ " broadcast
38.IR LLADDR " ]"
39.br
40.RB "[ " mtu
41.IR MTU " ]"
Pavel Emelyanov4de8d882013-12-30 13:55:17 +040042.RB "[ " index
43.IR IDX " ]"
Christoph J. Thompson761a1e62012-03-01 17:45:45 +010044.br
Jiri Pirkod992f3e2012-08-01 16:19:55 -070045.RB "[ " numtxqueues
46.IR QUEUE_COUNT " ]"
47.RB "[ " numrxqueues
48.IR QUEUE_COUNT " ]"
49.br
Christoph J. Thompson761a1e62012-03-01 17:45:45 +010050.BR type " TYPE"
51.RI "[ " ARGS " ]"
52
53.ti -8
54.IR TYPE " := [ "
Stephen Hemmingerf1a6f4e2012-10-25 09:01:29 -070055.BR bridge " | "
Jiri Pirkocc26a892013-10-18 17:50:01 +020056.BR bond " ]"
Stephen Hemmingerf1a6f4e2012-10-25 09:01:29 -070057.BR can " | "
58.BR dummy " | "
Arvid Brodin5c0aec92013-12-17 02:22:46 +010059.BR hsr " | "
Stephen Hemmingerf1a6f4e2012-10-25 09:01:29 -070060.BR ifb " | "
61.BR ipoib " |"
62.BR macvlan " | "
Rami Rosene4c35682014-07-19 12:00:25 +030063.BR macvtap " | "
Stephen Hemmingerf1a6f4e2012-10-25 09:01:29 -070064.BR vcan " | "
65.BR veth " | "
66.BR vlan " | "
Nicolas Dichtel77987912012-12-13 03:42:52 +000067.BR vxlan " |"
68.BR ip6tnl " |"
69.BR ipip " |"
xeb@mail.ru9abde372013-10-01 11:18:34 +040070.BR sit " |"
71.BR gre " |"
72.BR gretap " |"
73.BR ip6gre " |"
74.BR ip6gretap " ]"
Christoph J. Thompson761a1e62012-03-01 17:45:45 +010075
76.ti -8
77.BI "ip link delete " DEVICE
78.BI type " TYPE"
79.RI "[ " ARGS " ]"
80
81.ti -8
82.BR "ip link set " {
83.IR DEVICE " | "
84.BI "group " GROUP
85.RB "} { " up " | " down " | " arp " { " on " | " off " } |"
86.br
87.BR promisc " { " on " | " off " } |"
88.br
89.BR allmulticast " { " on " | " off " } |"
90.br
91.BR dynamic " { " on " | " off " } |"
92.br
93.BR multicast " { " on " | " off " } |"
94.br
95.B txqueuelen
96.IR PACKETS " |"
97.br
98.B name
99.IR NEWNAME " |"
100.br
101.B address
102.IR LLADDR " |"
103.B broadcast
104.IR LLADDR " |"
105.br
106.B mtu
107.IR MTU " |"
108.br
109.B netns
110.IR PID " |"
111.br
112.B netns
113.IR NETNSNAME " |"
114.br
115.B alias
116.IR NAME " |"
117.br
118.B vf
119.IR NUM " ["
120.B mac
121.IR LLADDR " ] ["
122.B vlan
123.IR VLANID " [ "
124.B qos
125.IR VLAN-QOS " ] ] ["
126.B rate
127.IR TXRATE " ] ["
Sucheta Chakrabortyf89a2a02014-05-22 09:59:37 -0400128.B max_tx_rate
129.IR TXRATE " ] ["
130.B min_tx_rate
131.IR TXRATE " ] ["
Or Gerlitz63f60e32014-05-11 09:22:19 +0300132.B spoofchk { on | off } ] [
133.B state { auto | enable | disable}
Christoph J. Thompson761a1e62012-03-01 17:45:45 +0100134] |
135.br
136.B master
137.IR DEVICE
138.br
139.B nomaster
140.BR " }"
141
142
143.ti -8
144.B ip link show
145.RI "[ " DEVICE " | "
146.B group
147.IR GROUP " ]"
148
149.SH "DESCRIPTION"
150.SS ip link add - add virtual link
151
152.TP
153.BI link " DEVICE "
154specifies the physical device to act operate on.
155
156.I NAME
157specifies the name of the new virtual device.
158
159.I TYPE
160specifies the type of the new device.
161.sp
162Link types:
163
164.in +8
Stephen Hemmingerf1a6f4e2012-10-25 09:01:29 -0700165.B bridge
166- Ethernet Bridge device
Christoph J. Thompson761a1e62012-03-01 17:45:45 +0100167.sp
Jiri Pirkocc26a892013-10-18 17:50:01 +0200168.B bond
169- Bonding device
170.sp
Christoph J. Thompson761a1e62012-03-01 17:45:45 +0100171.B dummy
172- Dummy network interface
173.sp
vadimk2f937352014-08-31 01:57:48 +0300174.B hsr
175- High-availability Seamless Redundancy device
176.sp
Christoph J. Thompson761a1e62012-03-01 17:45:45 +0100177.B ifb
178- Intermediate Functional Block device
179.sp
Or Gerlitzde038992012-10-25 16:57:59 +0200180.B ipoib
181- IP over Infiniband device
Stephen Hemmingerf1a6f4e2012-10-25 09:01:29 -0700182.sp
183.B macvlan
184- Virtual interface base on link layer address (MAC)
185.sp
Rami Rosene4c35682014-07-19 12:00:25 +0300186.B macvtap
187- Virtual interface based on link layer address (MAC) and TAP.
188.sp
Stephen Hemmingerf1a6f4e2012-10-25 09:01:29 -0700189.B vcan
Oliver Hartkopp2b70fe12014-05-15 19:52:19 +0200190- Virtual Controller Area Network interface
Stephen Hemmingerf1a6f4e2012-10-25 09:01:29 -0700191.sp
192.B veth
193- Virtual ethernet interface
194.sp
195.BR vlan
196- 802.1q tagged virtual LAN interface
197.sp
198.BR vxlan
199- Virtual eXtended LAN
Nicolas Dichtel77987912012-12-13 03:42:52 +0000200.sp
201.BR ip6tnl
202- Virtual tunnel interface IPv4|IPv6 over IPv6
203.sp
204.BR ipip
205- Virtual tunnel interface IPv4 over IPv4
206.sp
207.BR sit
208- Virtual tunnel interface IPv6 over IPv4
xeb@mail.ru9abde372013-10-01 11:18:34 +0400209.sp
210.BR gre
211- Virtual tunnel interface GRE over IPv4
212.sp
213.BR gretap
214- Virtual L2 tuunel interface GRE over IPv4
215.sp
216.BR ip6gre
217- Virtual tuunel interface GRE over IPv6
218.sp
219.BR ip6gretap
220- Virtual L2 tuunel interface GRE over IPv6
Christoph J. Thompson761a1e62012-03-01 17:45:45 +0100221.in -8
222
Jiri Pirkod992f3e2012-08-01 16:19:55 -0700223.TP
224.BI numtxqueues " QUEUE_COUNT "
225specifies the number of transmit queues for new device.
226
227.TP
228.BI numrxqueues " QUEUE_COUNT "
229specifies the number of receive queues for new device.
230
Thomas Richter2816a562013-07-08 14:05:43 +0200231.TP
Pavel Emelyanov4de8d882013-12-30 13:55:17 +0400232.BI index " IDX "
233specifies the desired index of the new virtual device. The link creation fails, if the index is busy.
234
235.TP
Thomas Richter2816a562013-07-08 14:05:43 +0200236VXLAN Type Support
Or Gerlitz63f60e32014-05-11 09:22:19 +0300237For a link of type
Thomas Richter2816a562013-07-08 14:05:43 +0200238.I VXLAN
239the following additional arguments are supported:
240
241.BI "ip link add " DEVICE
242.BI type " vxlan " id " ID
243.R " [ "
244.BI dev " PHYS_DEV "
Atzm Watanabe7cfa3802013-07-24 14:01:01 +0900245.RB " ] [ { " group " | " remote " } "
246.I IPADDR
Thomas Richter2816a562013-07-08 14:05:43 +0200247.R " ] [ "
248.BI local " IPADDR "
249.R " ] [ "
250.BI ttl " TTL "
251.R " ] [ "
252.BI tos " TOS "
253.R " ] [ "
254.BI port " MIN MAX "
255.R " ] [ "
256.I "[no]learning "
257.R " ] [ "
258.I "[no]proxy "
259.R " ] [ "
260.I "[no]rsc "
261.R " ] [ "
262.I "[no]l2miss "
263.R " ] [ "
264.I "[no]l3miss "
Nicolas Dichtelc2fbc572014-09-09 16:55:10 +0200265.R " ] [ "
266.BI ageing " SECONDS "
267.R " ] [ "
268.BI maxaddress " NUMBER "
Thomas Richter2816a562013-07-08 14:05:43 +0200269.R " ]"
270
271.in +8
272.sp
273.BI id " VNI "
274- specifies the VXLAN Network Identifer (or VXLAN Segment
275Identifier) to use.
276
277.BI dev " PHYS_DEV"
278- specifies the physical device to use for tunnel endpoint communication.
279
280.sp
281.BI group " IPADDR"
282- specifies the multicast IP address to join.
Atzm Watanabe7cfa3802013-07-24 14:01:01 +0900283This parameter cannot be specified with the
284.B remote
285parameter.
286
287.sp
288.BI remote " IPADDR"
289- specifies the unicast destination IP address to use in outgoing packets
290when the destination link layer address is not known in the VXLAN device
291forwarding database. This parameter cannot be specified with the
292.B group
293parameter.
Thomas Richter2816a562013-07-08 14:05:43 +0200294
295.sp
296.BI local " IPADDR"
297- specifies the source IP address to use in outgoing packets.
298
299.sp
300.BI ttl " TTL"
301- specifies the TTL value to use in outgoing packets.
302
303.sp
304.BI tos " TOS"
305- specifies the TOS value to use in outgoing packets.
306
307.sp
308.BI port " MIN MAX"
309- specifies the range of port numbers to use as UDP
310source ports to communicate to the remote VXLAN tunnel endpoint.
311
312.sp
313.I [no]learning
314- specifies if unknown source link layer addresses and IP addresses
315are entered into the VXLAN device forwarding database.
316
317.sp
318.I [no]rsc
319- specifies if route short circuit is turned on.
320
321.sp
322.I [no]proxy
323- specifies ARP proxy is turned on.
324
325.sp
326.I [no]l2miss
327- specifies if netlink LLADDR miss notifications are generated.
328
329.sp
330.I [no]l3miss
331- specifies if netlink IP ADDR miss notifications are generated.
332
Nicolas Dichtelc2fbc572014-09-09 16:55:10 +0200333.sp
334.BI ageing " SECONDS"
335- specifies the lifetime in seconds of FDB entries learnt by the kernel.
336
337.sp
338.BI maxaddress " NUMBER"
339- specifies the maximum number of FDB entries.
340
Thomas Richter2816a562013-07-08 14:05:43 +0200341.in -8
342
xeb@mail.ru9abde372013-10-01 11:18:34 +0400343.TP
344IP6GRE/IP6GRETAP Type Support
Or Gerlitz63f60e32014-05-11 09:22:19 +0300345For a link of type
xeb@mail.ru9abde372013-10-01 11:18:34 +0400346.I IP6GRE/IP6GRETAP
347the following additional arguments are supported:
348
349.BI "ip link add " DEVICE
350.BI type " { ip6gre | ip6gretap } " remote " ADDR " local " ADDR
351.R " [ "
352.I "[i|o]seq]"
353.R " ] [ "
354.I "[i|o]key" KEY
355.R " ] [ "
356.I " [i|o]csum "
357.R " ] [ "
358.BI hoplimit " TTL "
359.R " ] [ "
360.BI encaplimit " ELIM "
361.R " ] [ "
362.BI tclass " TCLASS "
363.R " ] [ "
364.BI flowlabel " FLOWLABEL "
365.R " ] [ "
366.BI "dscp inherit"
367.R " ] [ "
368.BI dev " PHYS_DEV "
369.R " ]"
370
371.in +8
372.sp
373.BI remote " ADDR "
374- specifies the remote IPv6 address of the tunnel.
375
376.sp
377.BI local " ADDR "
378- specifies the fixed local IPv6 address for tunneled packets.
379It must be and address on another interface on this host.
380
381.sp
382.BI [i|o]seq
383- serialize packets.
384The
385.B oseq
386flag enables sequencing of outgoing packets.
387The
388.B iseq
389flag requires that all input packets are serialized.
390
391.sp
392.BI [i|o]key " KEY"
393- use keyed GRE with key
394.IR KEY ". "KEY
395is either a number or an IPv4 address-like dotted quad.
396The
397.B key
398parameter specifies the same key to use in both directions.
399The
400.BR ikey " and " okey
401parameters specify different keys for input and output.
402
403.sp
404.BI [i|o]csum
405- generate/require checksums for tunneled packets.
406The
407.B ocsum
408flag calculates checksums for outgoing packets.
409The
410.B icsum
411flag requires that all input packets have the correct
412checksum. The
413.B csum
414flag is equivalent to the combination
415.BR "icsum ocsum" .
416
417.sp
418.BI hoplimit " TTL"
419- specifies Hop Limit value to use in outgoing packets.
420
421.sp
422.BI encaplimit " ELIM"
423- specifies a fixed encapsulation limit. Default is 4.
424
425.sp
426.BI flowlabel " FLOWLABEL"
Or Gerlitz63f60e32014-05-11 09:22:19 +0300427- specifies a fixed flowlabel.
xeb@mail.ru9abde372013-10-01 11:18:34 +0400428
429.sp
430.BI tclass " TCLASS"
431- specifies the traffic class field on
432tunneled packets, which can be specified as either a two-digit
433hex value (e.g. c0) or a predefined string (e.g. internet).
434The value
435.B inherit
436causes the field to be copied from the original IP header. The
437values
438.BI "inherit/" STRING
439or
440.BI "inherit/" 00 ".." ff
441will set the field to
442.I STRING
443or
444.IR 00 ".." ff
445when tunneling non-IP packets. The default value is 00.
446
447.in -8
448
Christoph J. Thompson761a1e62012-03-01 17:45:45 +0100449.SS ip link delete - delete virtual link
450.I DEVICE
451specifies the virtual device to act operate on.
452.I TYPE
453specifies the type of the device.
454
455
456.TP
457.BI dev " DEVICE "
458specifies the physical device to act operate on.
459
460.SS ip link set - change device attributes
461
462.TP
463.BI dev " DEVICE "
464.I DEVICE
Petr Sabata6274b0b2013-04-04 03:36:57 +0000465specifies network device to operate on. When configuring SR-IOV Virtual Function
Christoph J. Thompson761a1e62012-03-01 17:45:45 +0100466(VF) devices, this keyword should specify the associated Physical Function (PF)
467device.
468
469.TP
470.BI group " GROUP "
471.I GROUP
472has a dual role: If both group and dev are present, then move the device to the
473specified group. If only a group is specified, then the command operates on
474all devices in that group.
475
476.TP
477.BR up " and " down
478change the state of the device to
479.B UP
480or
481.BR "DOWN" .
482
483.TP
484.BR "arp on " or " arp off"
485change the
486.B NOARP
487flag on the device.
488
489.TP
490.BR "multicast on " or " multicast off"
491change the
492.B MULTICAST
493flag on the device.
494
495.TP
496.BR "dynamic on " or " dynamic off"
497change the
498.B DYNAMIC
499flag on the device.
500
501.TP
502.BI name " NAME"
503change the name of the device. This operation is not
504recommended if the device is running or has some addresses
505already configured.
506
507.TP
508.BI txqueuelen " NUMBER"
509.TP
510.BI txqlen " NUMBER"
511change the transmit queue length of the device.
512
513.TP
514.BI mtu " NUMBER"
515change the
516.I MTU
517of the device.
518
519.TP
520.BI address " LLADDRESS"
521change the station address of the interface.
522
523.TP
524.BI broadcast " LLADDRESS"
525.TP
526.BI brd " LLADDRESS"
527.TP
528.BI peer " LLADDRESS"
529change the link layer broadcast address or the peer address when
530the interface is
531.IR "POINTOPOINT" .
532
533.TP
534.BI netns " PID"
535move the device to the network namespace associated with the process
536.IR "PID".
537
538.TP
539.BI netns " NETNSNAME"
540move the device to the network namespace associated with name
541.IR "NETNSNAME".
542
543.TP
544.BI alias " NAME"
545give the device a symbolic name for easy reference.
546
547.TP
548.BI group " GROUP"
549specify the group the device belongs to.
550The available groups are listed in file
551.BR "@SYSCONFDIR@/group" .
552
553.TP
554.BI vf " NUM"
555specify a Virtual Function device to be configured. The associated PF device
556must be specified using the
557.B dev
558parameter.
559
560.in +8
561.BI mac " LLADDRESS"
562- change the station address for the specified VF. The
563.B vf
564parameter must be specified.
565
566.sp
567.BI vlan " VLANID"
568- change the assigned VLAN for the specified VF. When specified, all traffic
569sent from the VF will be tagged with the specified VLAN ID. Incoming traffic
570will be filtered for the specified VLAN ID, and will have all VLAN tags
571stripped before being passed to the VF. Setting this parameter to 0 disables
572VLAN tagging and filtering. The
573.B vf
574parameter must be specified.
575
576.sp
577.BI qos " VLAN-QOS"
578- assign VLAN QOS (priority) bits for the VLAN tag. When specified, all VLAN
579tags transmitted by the VF will include the specified priority bits in the
580VLAN tag. If not specified, the value is assumed to be 0. Both the
581.B vf
582and
583.B vlan
584parameters must be specified. Setting both
585.B vlan
586and
587.B qos
588as 0 disables VLAN tagging and filtering for the VF.
589
590.sp
591.BI rate " TXRATE"
Sucheta Chakrabortyf89a2a02014-05-22 09:59:37 -0400592-- change the allowed transmit bandwidth, in Mbps, for the specified VF.
593Setting this parameter to 0 disables rate limiting.
594.B vf
595parameter must be specified.
596Please use new API
597.B "max_tx_rate"
598option instead.
599
600.sp
601.BI max_tx_rate " TXRATE"
602- change the allowed maximum transmit bandwidth, in Mbps, for the specified VF.
603.B vf
604parameter must be specified.
605
606.sp
607.BI min_tx_rate " TXRATE"
608- change the allowed minimum transmit bandwidth, in Mbps, for the specified VF.
609Minimum TXRATE should be always <= Maximum TXRATE.
Christoph J. Thompson761a1e62012-03-01 17:45:45 +0100610.B vf
611parameter must be specified.
612
613.sp
614.BI spoofchk " on|off"
615- turn packet spoof checking on or off for the specified VF.
Or Gerlitz63f60e32014-05-11 09:22:19 +0300616.sp
617.BI state " auto|enable|disable"
618- set the virtual link state as seen by the specified VF. Setting to auto means a
619reflection of the PF link state, enable lets the VF to communicate with other VFs on
620this host even if the PF link state is down, disable causes the HW to drop any packets
621sent by the VF.
Christoph J. Thompson761a1e62012-03-01 17:45:45 +0100622.in -8
623
624.TP
625.BI master " DEVICE"
626set master device of the device (enslave device).
627
628.TP
629.BI nomaster
630unset master device of the device (release device).
631
632.PP
633.B Warning:
634If multiple parameter changes are requested,
635.B ip
636aborts immediately after any of the changes have failed.
637This is the only case when
638.B ip
639can move the system to an unpredictable state. The solution
640is to avoid changing several parameters with one
641.B ip link set
642call.
643
644.SS ip link show - display device attributes
645
646.TP
647.BI dev " NAME " (default)
648.I NAME
649specifies the network device to show.
650If this argument is omitted all devices in the default group are listed.
651
652.TP
653.BI group " GROUP "
654.I GROUP
655specifies what group of devices to show.
656
657.TP
658.B up
659only display running interfaces.
660
661.SH "EXAMPLES"
662.PP
663ip link show
664.RS 4
665Shows the state of all network interfaces on the system.
666.RE
667.PP
668ip link set dev ppp0 mtu 1400
669.RS 4
670Change the MTU the ppp0 device.
671.RE
672.PP
673ip link add link eth0 name eth0.10 type vlan id 10
674.RS 4
675Creates a new vlan device eth0.10 on device eth0.
676.RE
677.PP
678ip link delete dev eth0.10
679.RS 4
680Removes vlan device.
681.RE
682
683.SH SEE ALSO
684.br
685.BR ip (8)
686
687.SH AUTHOR
688Original Manpage by Michail Litvak <mci@owl.openwall.com>