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