]> git.proxmox.com Git - mirror_iproute2.git/blob - man/man8/ip-link.8.in
ip netns: Show error message if mkdir failed to create /var/run/netns
[mirror_iproute2.git] / man / man8 / ip-link.8.in
1 .TH IP\-LINK 8 "13 Dec 2012" "iproute2" "Linux"
2 .SH "NAME"
3 ip-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
26 .BI "ip link add"
27 .RB "[ " link
28 .IR DEVICE " ]"
29 .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 " ]"
42 .RB "[ " index
43 .IR IDX " ]"
44 .br
45 .RB "[ " numtxqueues
46 .IR QUEUE_COUNT " ]"
47 .RB "[ " numrxqueues
48 .IR QUEUE_COUNT " ]"
49 .br
50 .BR type " TYPE"
51 .RI "[ " ARGS " ]"
52
53 .ti -8
54 .IR TYPE " := [ "
55 .BR bridge " | "
56 .BR bond " ]"
57 .BR can " | "
58 .BR dummy " | "
59 .BR hsr " | "
60 .BR ifb " | "
61 .BR ipoib " |"
62 .BR macvlan " | "
63 .BR macvtap " | "
64 .BR vcan " | "
65 .BR veth " | "
66 .BR vlan " | "
67 .BR vxlan " |"
68 .BR ip6tnl " |"
69 .BR ipip " |"
70 .BR sit " |"
71 .BR gre " |"
72 .BR gretap " |"
73 .BR ip6gre " |"
74 .BR ip6gretap " ]"
75
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 " ] ["
128 .B max_tx_rate
129 .IR TXRATE " ] ["
130 .B min_tx_rate
131 .IR TXRATE " ] ["
132 .B spoofchk { on | off } ] [
133 .B state { auto | enable | disable}
134 ] |
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 "
154 specifies the physical device to act operate on.
155
156 .I NAME
157 specifies the name of the new virtual device.
158
159 .I TYPE
160 specifies the type of the new device.
161 .sp
162 Link types:
163
164 .in +8
165 .B bridge
166 - Ethernet Bridge device
167 .sp
168 .B bond
169 - Bonding device
170 .sp
171 .B dummy
172 - Dummy network interface
173 .sp
174 .B ifb
175 - Intermediate Functional Block device
176 .sp
177 .B ipoib
178 - IP over Infiniband device
179 .sp
180 .B macvlan
181 - Virtual interface base on link layer address (MAC)
182 .sp
183 .B macvtap
184 - Virtual interface based on link layer address (MAC) and TAP.
185 .sp
186 .B vcan
187 - Virtual Controller Area Network interface
188 .sp
189 .B veth
190 - Virtual ethernet interface
191 .sp
192 .BR vlan
193 - 802.1q tagged virtual LAN interface
194 .sp
195 .BR vxlan
196 - Virtual eXtended LAN
197 .sp
198 .BR ip6tnl
199 - Virtual tunnel interface IPv4|IPv6 over IPv6
200 .sp
201 .BR ipip
202 - Virtual tunnel interface IPv4 over IPv4
203 .sp
204 .BR sit
205 - Virtual tunnel interface IPv6 over IPv4
206 .sp
207 .BR gre
208 - Virtual tunnel interface GRE over IPv4
209 .sp
210 .BR gretap
211 - Virtual L2 tuunel interface GRE over IPv4
212 .sp
213 .BR ip6gre
214 - Virtual tuunel interface GRE over IPv6
215 .sp
216 .BR ip6gretap
217 - Virtual L2 tuunel interface GRE over IPv6
218 .in -8
219
220 .TP
221 .BI numtxqueues " QUEUE_COUNT "
222 specifies the number of transmit queues for new device.
223
224 .TP
225 .BI numrxqueues " QUEUE_COUNT "
226 specifies the number of receive queues for new device.
227
228 .TP
229 .BI index " IDX "
230 specifies the desired index of the new virtual device. The link creation fails, if the index is busy.
231
232 .TP
233 VXLAN Type Support
234 For a link of type
235 .I VXLAN
236 the following additional arguments are supported:
237
238 .BI "ip link add " DEVICE
239 .BI type " vxlan " id " ID
240 .R " [ "
241 .BI dev " PHYS_DEV "
242 .RB " ] [ { " group " | " remote " } "
243 .I IPADDR
244 .R " ] [ "
245 .BI local " IPADDR "
246 .R " ] [ "
247 .BI ttl " TTL "
248 .R " ] [ "
249 .BI tos " TOS "
250 .R " ] [ "
251 .BI port " MIN MAX "
252 .R " ] [ "
253 .I "[no]learning "
254 .R " ] [ "
255 .I "[no]proxy "
256 .R " ] [ "
257 .I "[no]rsc "
258 .R " ] [ "
259 .I "[no]l2miss "
260 .R " ] [ "
261 .I "[no]l3miss "
262 .R " ]"
263
264 .in +8
265 .sp
266 .BI id " VNI "
267 - specifies the VXLAN Network Identifer (or VXLAN Segment
268 Identifier) to use.
269
270 .BI dev " PHYS_DEV"
271 - specifies the physical device to use for tunnel endpoint communication.
272
273 .sp
274 .BI group " IPADDR"
275 - specifies the multicast IP address to join.
276 This parameter cannot be specified with the
277 .B remote
278 parameter.
279
280 .sp
281 .BI remote " IPADDR"
282 - specifies the unicast destination IP address to use in outgoing packets
283 when the destination link layer address is not known in the VXLAN device
284 forwarding database. This parameter cannot be specified with the
285 .B group
286 parameter.
287
288 .sp
289 .BI local " IPADDR"
290 - specifies the source IP address to use in outgoing packets.
291
292 .sp
293 .BI ttl " TTL"
294 - specifies the TTL value to use in outgoing packets.
295
296 .sp
297 .BI tos " TOS"
298 - specifies the TOS value to use in outgoing packets.
299
300 .sp
301 .BI port " MIN MAX"
302 - specifies the range of port numbers to use as UDP
303 source ports to communicate to the remote VXLAN tunnel endpoint.
304
305 .sp
306 .I [no]learning
307 - specifies if unknown source link layer addresses and IP addresses
308 are entered into the VXLAN device forwarding database.
309
310 .sp
311 .I [no]rsc
312 - specifies if route short circuit is turned on.
313
314 .sp
315 .I [no]proxy
316 - specifies ARP proxy is turned on.
317
318 .sp
319 .I [no]l2miss
320 - specifies if netlink LLADDR miss notifications are generated.
321
322 .sp
323 .I [no]l3miss
324 - specifies if netlink IP ADDR miss notifications are generated.
325
326 .in -8
327
328 .TP
329 IP6GRE/IP6GRETAP Type Support
330 For a link of type
331 .I IP6GRE/IP6GRETAP
332 the following additional arguments are supported:
333
334 .BI "ip link add " DEVICE
335 .BI type " { ip6gre | ip6gretap } " remote " ADDR " local " ADDR
336 .R " [ "
337 .I "[i|o]seq]"
338 .R " ] [ "
339 .I "[i|o]key" KEY
340 .R " ] [ "
341 .I " [i|o]csum "
342 .R " ] [ "
343 .BI hoplimit " TTL "
344 .R " ] [ "
345 .BI encaplimit " ELIM "
346 .R " ] [ "
347 .BI tclass " TCLASS "
348 .R " ] [ "
349 .BI flowlabel " FLOWLABEL "
350 .R " ] [ "
351 .BI "dscp inherit"
352 .R " ] [ "
353 .BI dev " PHYS_DEV "
354 .R " ]"
355
356 .in +8
357 .sp
358 .BI remote " ADDR "
359 - specifies the remote IPv6 address of the tunnel.
360
361 .sp
362 .BI local " ADDR "
363 - specifies the fixed local IPv6 address for tunneled packets.
364 It must be and address on another interface on this host.
365
366 .sp
367 .BI [i|o]seq
368 - serialize packets.
369 The
370 .B oseq
371 flag enables sequencing of outgoing packets.
372 The
373 .B iseq
374 flag requires that all input packets are serialized.
375
376 .sp
377 .BI [i|o]key " KEY"
378 - use keyed GRE with key
379 .IR KEY ". "KEY
380 is either a number or an IPv4 address-like dotted quad.
381 The
382 .B key
383 parameter specifies the same key to use in both directions.
384 The
385 .BR ikey " and " okey
386 parameters specify different keys for input and output.
387
388 .sp
389 .BI [i|o]csum
390 - generate/require checksums for tunneled packets.
391 The
392 .B ocsum
393 flag calculates checksums for outgoing packets.
394 The
395 .B icsum
396 flag requires that all input packets have the correct
397 checksum. The
398 .B csum
399 flag is equivalent to the combination
400 .BR "icsum ocsum" .
401
402 .sp
403 .BI hoplimit " TTL"
404 - specifies Hop Limit value to use in outgoing packets.
405
406 .sp
407 .BI encaplimit " ELIM"
408 - specifies a fixed encapsulation limit. Default is 4.
409
410 .sp
411 .BI flowlabel " FLOWLABEL"
412 - specifies a fixed flowlabel.
413
414 .sp
415 .BI tclass " TCLASS"
416 - specifies the traffic class field on
417 tunneled packets, which can be specified as either a two-digit
418 hex value (e.g. c0) or a predefined string (e.g. internet).
419 The value
420 .B inherit
421 causes the field to be copied from the original IP header. The
422 values
423 .BI "inherit/" STRING
424 or
425 .BI "inherit/" 00 ".." ff
426 will set the field to
427 .I STRING
428 or
429 .IR 00 ".." ff
430 when tunneling non-IP packets. The default value is 00.
431
432 .in -8
433
434 .SS ip link delete - delete virtual link
435 .I DEVICE
436 specifies the virtual device to act operate on.
437 .I TYPE
438 specifies the type of the device.
439
440
441 .TP
442 .BI dev " DEVICE "
443 specifies the physical device to act operate on.
444
445 .SS ip link set - change device attributes
446
447 .TP
448 .BI dev " DEVICE "
449 .I DEVICE
450 specifies network device to operate on. When configuring SR-IOV Virtual Function
451 (VF) devices, this keyword should specify the associated Physical Function (PF)
452 device.
453
454 .TP
455 .BI group " GROUP "
456 .I GROUP
457 has a dual role: If both group and dev are present, then move the device to the
458 specified group. If only a group is specified, then the command operates on
459 all devices in that group.
460
461 .TP
462 .BR up " and " down
463 change the state of the device to
464 .B UP
465 or
466 .BR "DOWN" .
467
468 .TP
469 .BR "arp on " or " arp off"
470 change the
471 .B NOARP
472 flag on the device.
473
474 .TP
475 .BR "multicast on " or " multicast off"
476 change the
477 .B MULTICAST
478 flag on the device.
479
480 .TP
481 .BR "dynamic on " or " dynamic off"
482 change the
483 .B DYNAMIC
484 flag on the device.
485
486 .TP
487 .BI name " NAME"
488 change the name of the device. This operation is not
489 recommended if the device is running or has some addresses
490 already configured.
491
492 .TP
493 .BI txqueuelen " NUMBER"
494 .TP
495 .BI txqlen " NUMBER"
496 change the transmit queue length of the device.
497
498 .TP
499 .BI mtu " NUMBER"
500 change the
501 .I MTU
502 of the device.
503
504 .TP
505 .BI address " LLADDRESS"
506 change the station address of the interface.
507
508 .TP
509 .BI broadcast " LLADDRESS"
510 .TP
511 .BI brd " LLADDRESS"
512 .TP
513 .BI peer " LLADDRESS"
514 change the link layer broadcast address or the peer address when
515 the interface is
516 .IR "POINTOPOINT" .
517
518 .TP
519 .BI netns " PID"
520 move the device to the network namespace associated with the process
521 .IR "PID".
522
523 .TP
524 .BI netns " NETNSNAME"
525 move the device to the network namespace associated with name
526 .IR "NETNSNAME".
527
528 .TP
529 .BI alias " NAME"
530 give the device a symbolic name for easy reference.
531
532 .TP
533 .BI group " GROUP"
534 specify the group the device belongs to.
535 The available groups are listed in file
536 .BR "@SYSCONFDIR@/group" .
537
538 .TP
539 .BI vf " NUM"
540 specify a Virtual Function device to be configured. The associated PF device
541 must be specified using the
542 .B dev
543 parameter.
544
545 .in +8
546 .BI mac " LLADDRESS"
547 - change the station address for the specified VF. The
548 .B vf
549 parameter must be specified.
550
551 .sp
552 .BI vlan " VLANID"
553 - change the assigned VLAN for the specified VF. When specified, all traffic
554 sent from the VF will be tagged with the specified VLAN ID. Incoming traffic
555 will be filtered for the specified VLAN ID, and will have all VLAN tags
556 stripped before being passed to the VF. Setting this parameter to 0 disables
557 VLAN tagging and filtering. The
558 .B vf
559 parameter must be specified.
560
561 .sp
562 .BI qos " VLAN-QOS"
563 - assign VLAN QOS (priority) bits for the VLAN tag. When specified, all VLAN
564 tags transmitted by the VF will include the specified priority bits in the
565 VLAN tag. If not specified, the value is assumed to be 0. Both the
566 .B vf
567 and
568 .B vlan
569 parameters must be specified. Setting both
570 .B vlan
571 and
572 .B qos
573 as 0 disables VLAN tagging and filtering for the VF.
574
575 .sp
576 .BI rate " TXRATE"
577 -- change the allowed transmit bandwidth, in Mbps, for the specified VF.
578 Setting this parameter to 0 disables rate limiting.
579 .B vf
580 parameter must be specified.
581 Please use new API
582 .B "max_tx_rate"
583 option instead.
584
585 .sp
586 .BI max_tx_rate " TXRATE"
587 - change the allowed maximum transmit bandwidth, in Mbps, for the specified VF.
588 .B vf
589 parameter must be specified.
590
591 .sp
592 .BI min_tx_rate " TXRATE"
593 - change the allowed minimum transmit bandwidth, in Mbps, for the specified VF.
594 Minimum TXRATE should be always <= Maximum TXRATE.
595 .B vf
596 parameter must be specified.
597
598 .sp
599 .BI spoofchk " on|off"
600 - turn packet spoof checking on or off for the specified VF.
601 .sp
602 .BI state " auto|enable|disable"
603 - set the virtual link state as seen by the specified VF. Setting to auto means a
604 reflection of the PF link state, enable lets the VF to communicate with other VFs on
605 this host even if the PF link state is down, disable causes the HW to drop any packets
606 sent by the VF.
607 .in -8
608
609 .TP
610 .BI master " DEVICE"
611 set master device of the device (enslave device).
612
613 .TP
614 .BI nomaster
615 unset master device of the device (release device).
616
617 .PP
618 .B Warning:
619 If multiple parameter changes are requested,
620 .B ip
621 aborts immediately after any of the changes have failed.
622 This is the only case when
623 .B ip
624 can move the system to an unpredictable state. The solution
625 is to avoid changing several parameters with one
626 .B ip link set
627 call.
628
629 .SS ip link show - display device attributes
630
631 .TP
632 .BI dev " NAME " (default)
633 .I NAME
634 specifies the network device to show.
635 If this argument is omitted all devices in the default group are listed.
636
637 .TP
638 .BI group " GROUP "
639 .I GROUP
640 specifies what group of devices to show.
641
642 .TP
643 .B up
644 only display running interfaces.
645
646 .SH "EXAMPLES"
647 .PP
648 ip link show
649 .RS 4
650 Shows the state of all network interfaces on the system.
651 .RE
652 .PP
653 ip link set dev ppp0 mtu 1400
654 .RS 4
655 Change the MTU the ppp0 device.
656 .RE
657 .PP
658 ip link add link eth0 name eth0.10 type vlan id 10
659 .RS 4
660 Creates a new vlan device eth0.10 on device eth0.
661 .RE
662 .PP
663 ip link delete dev eth0.10
664 .RS 4
665 Removes vlan device.
666 .RE
667
668 .SH SEE ALSO
669 .br
670 .BR ip (8)
671
672 .SH AUTHOR
673 Original Manpage by Michail Litvak <mci@owl.openwall.com>