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