]> git.proxmox.com Git - mirror_iproute2.git/blob - man/man8/ip-link.8.in
f0f350eb1998400ef5380847a57d0684844528ad
[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 link
10 .RI " { " COMMAND " | "
11 .BR help " }"
12 .sp
13
14 .ti -8
15 .BI "ip link add"
16 .RB "[ " link
17 .IR DEVICE " ]"
18 .RB "[ " name " ]"
19 .I NAME
20 .br
21 .RB "[ " txqueuelen
22 .IR PACKETS " ]"
23 .br
24 .RB "[ " address
25 .IR LLADDR " ]"
26 .RB "[ " broadcast
27 .IR LLADDR " ]"
28 .br
29 .RB "[ " mtu
30 .IR MTU " ]"
31 .RB "[ " index
32 .IR IDX " ]"
33 .br
34 .RB "[ " numtxqueues
35 .IR QUEUE_COUNT " ]"
36 .RB "[ " numrxqueues
37 .IR QUEUE_COUNT " ]"
38 .br
39 .BI type " TYPE"
40 .RI "[ " ARGS " ]"
41
42 .ti -8
43 .BR "ip link delete " {
44 .IR DEVICE " | "
45 .BI "group " GROUP
46 }
47 .BI type " TYPE"
48 .RI "[ " ARGS " ]"
49
50 .ti -8
51 .BR "ip link set " {
52 .IR DEVICE " | "
53 .BI "group " GROUP
54 }
55 .br
56 .RB "[ { " up " | " down " } ]"
57 .br
58 .RB "[ " type
59 .IR "ETYPE TYPE_ARGS" " ]"
60 .br
61 .RB "[ " arp " { " on " | " off " } ]"
62 .br
63 .RB "[ " dynamic " { " on " | " off " } ]"
64 .br
65 .RB "[ " multicast " { " on " | " off " } ]"
66 .br
67 .RB "[ " allmulticast " { " on " | " off " } ]"
68 .br
69 .RB "[ " promisc " { " on " | " off " } ]"
70 .br
71 .RB "[ " protodown " { " on " | " off " } ]"
72 .br
73 .RB "[ " trailers " { " on " | " off " } ]"
74 .br
75 .RB "[ " txqueuelen
76 .IR PACKETS " ]"
77 .br
78 .RB "[ " name
79 .IR NEWNAME " ]"
80 .br
81 .RB "[ " address
82 .IR LLADDR " ]"
83 .br
84 .RB "[ " broadcast
85 .IR LLADDR " ]"
86 .br
87 .RB "[ " mtu
88 .IR MTU " ]"
89 .br
90 .RB "[ " netns " {"
91 .IR PID " | " NETNSNAME " } ]"
92 .br
93 .RB "[ " link-netnsid
94 .IR ID " ]"
95 .br
96 .RB "[ " alias
97 .IR NAME " ]"
98 .br
99 .RB "[ " vf
100 .IR NUM " ["
101 .B mac
102 .IR LLADDR " ]"
103 .br
104 .in +9
105 .RI "[ " VFVLAN-LIST " ]"
106 .br
107 .RB "[ " rate
108 .IR TXRATE " ]"
109 .br
110 .RB "[ " max_tx_rate
111 .IR TXRATE " ]"
112 .br
113 .RB "[ " min_tx_rate
114 .IR TXRATE " ]"
115 .br
116 .RB "[ " spoofchk " { " on " | " off " } ]"
117 .br
118 .RB "[ " query_rss " { " on " | " off " } ]"
119 .br
120 .RB "[ " state " { " auto " | " enable " | " disable " } ]"
121 .br
122 .RB "[ " trust " { " on " | " off " } ]"
123 .br
124 .RB "[ " node_guid " eui64 ]"
125 .br
126 .RB "[ " port_guid " eui64 ] ]"
127 .br
128 .in -9
129 .RB "[ { " xdp " | " xdpgeneric " | " xdpdrv " | " xdpoffload " } { " off " | "
130 .br
131 .in +8
132 .BR object
133 .IR FILE
134 .RB "[ " section
135 .IR NAME " ]"
136 .RB "[ " verbose " ] |"
137 .br
138 .BR pinned
139 .IR FILE " } ]"
140 .br
141 .in -8
142 .RB "[ " master
143 .IR DEVICE " ]"
144 .br
145 .RB "[ " nomaster " ]"
146 .br
147 .RB "[ " vrf
148 .IR NAME " ]"
149 .br
150 .RB "[ " addrgenmode " { " eui64 " | " none " | " stable_secret " | " random " } ]"
151 .br
152 .RB "[ " macaddr " { " flush " | { " add " | " del " } "
153 .IR MACADDR " | set [ "
154 .IR MACADDR " [ "
155 .IR MACADDR " [ ... ] ] ] } ]"
156 .br
157
158 .ti -8
159 .B ip link show
160 .RI "[ " DEVICE " | "
161 .B group
162 .IR GROUP " ] ["
163 .BR up " ] ["
164 .B master
165 .IR DEVICE " ] ["
166 .B type
167 .IR ETYPE " ] ["
168 .B vrf
169 .IR NAME " ]"
170
171 .ti -8
172 .B ip link xstats
173 .BI type " TYPE"
174 .RI "[ " ARGS " ]"
175
176 .ti -8
177 .B ip link afstats
178 .RB "[ " dev
179 .IR DEVICE " ]"
180
181 .ti -8
182 .B ip link help
183 .RI "[ " TYPE " ]"
184
185 .ti -8
186 .IR TYPE " := [ "
187 .BR bridge " | "
188 .BR bond " | "
189 .BR can " | "
190 .BR dummy " | "
191 .BR hsr " | "
192 .BR ifb " | "
193 .BR ipoib " |"
194 .BR macvlan " | "
195 .BR macvtap " | "
196 .BR vcan " | "
197 .BR veth " | "
198 .BR vlan " | "
199 .BR vxlan " |"
200 .BR ip6tnl " |"
201 .BR ipip " |"
202 .BR sit " |"
203 .BR gre " |"
204 .BR gretap " |"
205 .BR erspan " |"
206 .BR ip6gre " |"
207 .BR ip6gretap " |"
208 .BR vti " |"
209 .BR nlmon " |"
210 .BR ipvlan " |"
211 .BR lowpan " |"
212 .BR geneve " |"
213 .BR vrf " |"
214 .BR macsec " ]"
215
216 .ti -8
217 .IR ETYPE " := [ " TYPE " |"
218 .BR bridge_slave " | " bond_slave " ]"
219
220 .ti -8
221 .IR VFVLAN-LIST " := [ " VFVLAN-LIST " ] " VFVLAN
222
223 .ti -8
224 .IR VFVLAN " := "
225 .RB "[ " vlan
226 .IR VLANID " [ "
227 .B qos
228 .IR VLAN-QOS " ] ["
229 .B proto
230 .IR VLAN-PROTO " ] ]"
231
232 .SH "DESCRIPTION"
233 .SS ip link add - add virtual link
234
235 .TP
236 .BI link " DEVICE "
237 specifies the physical device to act operate on.
238
239 .I NAME
240 specifies the name of the new virtual device.
241
242 .I TYPE
243 specifies the type of the new device.
244 .sp
245 Link types:
246
247 .in +8
248 .B bridge
249 - Ethernet Bridge device
250 .sp
251 .B bond
252 - Bonding device
253 .B can
254 - Controller Area Network interface
255 .sp
256 .B dummy
257 - Dummy network interface
258 .sp
259 .B hsr
260 - High-availability Seamless Redundancy device
261 .sp
262 .B ifb
263 - Intermediate Functional Block device
264 .sp
265 .B ipoib
266 - IP over Infiniband device
267 .sp
268 .B macvlan
269 - Virtual interface base on link layer address (MAC)
270 .sp
271 .B macvtap
272 - Virtual interface based on link layer address (MAC) and TAP.
273 .sp
274 .B vcan
275 - Virtual Controller Area Network interface
276 .sp
277 .B veth
278 - Virtual ethernet interface
279 .sp
280 .BR vlan
281 - 802.1q tagged virtual LAN interface
282 .sp
283 .BR vxlan
284 - Virtual eXtended LAN
285 .sp
286 .BR ip6tnl
287 - Virtual tunnel interface IPv4|IPv6 over IPv6
288 .sp
289 .BR ipip
290 - Virtual tunnel interface IPv4 over IPv4
291 .sp
292 .BR sit
293 - Virtual tunnel interface IPv6 over IPv4
294 .sp
295 .BR gre
296 - Virtual tunnel interface GRE over IPv4
297 .sp
298 .BR gretap
299 - Virtual L2 tunnel interface GRE over IPv4
300 .sp
301 .BR erspan
302 - Encapsulated Remote SPAN over GRE and IPv4
303 .sp
304 .BR ip6gre
305 - Virtual tunnel interface GRE over IPv6
306 .sp
307 .BR ip6gretap
308 - Virtual L2 tunnel interface GRE over IPv6
309 .sp
310 .BR vti
311 - Virtual tunnel interface
312 .sp
313 .BR nlmon
314 - Netlink monitoring device
315 .sp
316 .BR ipvlan
317 - Interface for L3 (IPv6/IPv4) based VLANs
318 .sp
319 .BR lowpan
320 - Interface for 6LoWPAN (IPv6) over IEEE 802.15.4 / Bluetooth
321 .sp
322 .BR geneve
323 - GEneric NEtwork Virtualization Encapsulation
324 .sp
325 .BR macsec
326 - Interface for IEEE 802.1AE MAC Security (MACsec)
327 .sp
328 .BR vrf
329 - Interface for L3 VRF domains
330 .in -8
331
332 .TP
333 .BI numtxqueues " QUEUE_COUNT "
334 specifies the number of transmit queues for new device.
335
336 .TP
337 .BI numrxqueues " QUEUE_COUNT "
338 specifies the number of receive queues for new device.
339
340 .TP
341 .BI index " IDX "
342 specifies the desired index of the new virtual device. The link creation fails, if the index is busy.
343
344 .TP
345 VLAN Type Support
346 For a link of type
347 .I VLAN
348 the following additional arguments are supported:
349
350 .BI "ip link add
351 .BI link " DEVICE "
352 .BI name " NAME "
353 .B "type vlan"
354 [
355 .BI protocol " VLAN_PROTO "
356 ]
357 .BI id " VLANID "
358 [
359 .BR reorder_hdr " { " on " | " off " } "
360 ]
361 [
362 .BR gvrp " { " on " | " off " } "
363 ]
364 [
365 .BR mvrp " { " on " | " off " } "
366 ]
367 [
368 .BR loose_binding " { " on " | " off " } "
369 ]
370 [
371 .BI ingress-qos-map " QOS-MAP "
372 ]
373 [
374 .BI egress-qos-map " QOS-MAP "
375 ]
376
377 .in +8
378 .sp
379 .BI protocol " VLAN_PROTO "
380 - either 802.1Q or 802.1ad.
381
382 .BI id " VLANID "
383 - specifies the VLAN Identifer to use. Note that numbers with a leading " 0 " or " 0x " are interpreted as octal or hexadeimal, respectively.
384
385 .BR reorder_hdr " { " on " | " off " } "
386 - specifies whether ethernet headers are reordered or not (default is
387 .BR on ")."
388
389 .in +4
390 If
391 .BR reorder_hdr " is " on
392 then VLAN header will be not inserted immediately but only before passing to the
393 physical device (if this device does not support VLAN offloading), the similar
394 on the RX direction - by default the packet will be untagged before being
395 received by VLAN device. Reordering allows to accelerate tagging on egress and
396 to hide VLAN header on ingress so the packet looks like regular Ethernet packet,
397 at the same time it might be confusing for packet capture as the VLAN header
398 does not exist within the packet.
399
400 VLAN offloading can be checked by
401 .BR ethtool "(8):"
402 .in +4
403 .sp
404 .B ethtool -k
405 <phy_dev> |
406 .RB grep " tx-vlan-offload"
407 .sp
408 .in -4
409 where <phy_dev> is the physical device to which VLAN device is bound.
410 .in -4
411
412 .BR gvrp " { " on " | " off " } "
413 - specifies whether this VLAN should be registered using GARP VLAN Registration Protocol.
414
415 .BR mvrp " { " on " | " off " } "
416 - specifies whether this VLAN should be registered using Multiple VLAN Registration Protocol.
417
418 .BR loose_binding " { " on " | " off " } "
419 - specifies whether the VLAN device state is bound to the physical device state.
420
421 .BI ingress-qos-map " QOS-MAP "
422 - defines a mapping of VLAN header prio field to the Linux internal packet
423 priority on incoming frames. The format is FROM:TO with multiple mappings
424 separated by spaces.
425
426 .BI egress-qos-map " QOS-MAP "
427 - defines a mapping of Linux internal packet priority to VLAN header prio field
428 but for outgoing frames. The format is the same as for ingress-qos-map.
429 .in +4
430
431 Linux packet priority can be set by
432 .BR iptables "(8)":
433 .in +4
434 .sp
435 .B iptables
436 -t mangle -A POSTROUTING [...] -j CLASSIFY --set-class 0:4
437 .sp
438 .in -4
439 and this "4" priority can be used in the egress qos mapping to set VLAN prio "5":
440 .sp
441 .in +4
442 .B ip
443 link set veth0.10 type vlan egress 4:5
444 .in -4
445 .in -4
446 .in -8
447
448 .TP
449 VXLAN Type Support
450 For a link of type
451 .I VXLAN
452 the following additional arguments are supported:
453
454 .BI "ip link add " DEVICE
455 .BI type " vxlan " id " VNI"
456 [
457 .BI dev " PHYS_DEV "
458 .RB " ] [ { " group " | " remote " } "
459 .I IPADDR
460 ] [
461 .B local
462 .RI "{ "IPADDR " | "any " } "
463 ] [
464 .BI ttl " TTL "
465 ] [
466 .BI tos " TOS "
467 ] [
468 .BI flowlabel " FLOWLABEL "
469 ] [
470 .BI dstport " PORT "
471 ] [
472 .BI srcport " MIN MAX "
473 ] [
474 .RB [ no ] learning
475 ] [
476 .RB [ no ] proxy
477 ] [
478 .RB [ no ] rsc
479 ] [
480 .RB [ no ] l2miss
481 ] [
482 .RB [ no ] l3miss
483 ] [
484 .RB [ no ] udpcsum
485 ] [
486 .RB [ no ] udp6zerocsumtx
487 ] [
488 .RB [ no ] udp6zerocsumrx
489 ] [
490 .BI ageing " SECONDS "
491 ] [
492 .BI maxaddress " NUMBER "
493 ] [
494 .RB [ no ] external
495 ] [
496 .B gbp
497 ] [
498 .B gpe
499 ]
500
501 .in +8
502 .sp
503 .BI id " VNI "
504 - specifies the VXLAN Network Identifer (or VXLAN Segment
505 Identifier) to use.
506
507 .BI dev " PHYS_DEV"
508 - specifies the physical device to use for tunnel endpoint communication.
509
510 .sp
511 .BI group " IPADDR"
512 - specifies the multicast IP address to join.
513 This parameter cannot be specified with the
514 .B remote
515 parameter.
516
517 .sp
518 .BI remote " IPADDR"
519 - specifies the unicast destination IP address to use in outgoing packets
520 when the destination link layer address is not known in the VXLAN device
521 forwarding database. This parameter cannot be specified with the
522 .B group
523 parameter.
524
525 .sp
526 .BI local " IPADDR"
527 - specifies the source IP address to use in outgoing packets.
528
529 .sp
530 .BI ttl " TTL"
531 - specifies the TTL value to use in outgoing packets.
532
533 .sp
534 .BI tos " TOS"
535 - specifies the TOS value to use in outgoing packets.
536
537 .sp
538 .BI flowlabel " FLOWLABEL"
539 - specifies the flow label to use in outgoing packets.
540
541 .sp
542 .BI dstport " PORT"
543 - specifies the UDP destination port to communicate to the remote VXLAN tunnel endpoint.
544
545 .sp
546 .BI srcport " MIN MAX"
547 - specifies the range of port numbers to use as UDP
548 source ports to communicate to the remote VXLAN tunnel endpoint.
549
550 .sp
551 .RB [ no ] learning
552 - specifies if unknown source link layer addresses and IP addresses
553 are entered into the VXLAN device forwarding database.
554
555 .sp
556 .RB [ no ] rsc
557 - specifies if route short circuit is turned on.
558
559 .sp
560 .RB [ no ] proxy
561 - specifies ARP proxy is turned on.
562
563 .sp
564 .RB [ no ] l2miss
565 - specifies if netlink LLADDR miss notifications are generated.
566
567 .sp
568 .RB [ no ] l3miss
569 - specifies if netlink IP ADDR miss notifications are generated.
570
571 .sp
572 .RB [ no ] udpcsum
573 - specifies if UDP checksum is calculated for transmitted packets over IPv4.
574
575 .sp
576 .RB [ no ] udp6zerocsumtx
577 - skip UDP checksum calculation for transmitted packets over IPv6.
578
579 .sp
580 .RB [ no ] udp6zerocsumrx
581 - allow incoming UDP packets over IPv6 with zero checksum field.
582
583 .sp
584 .BI ageing " SECONDS"
585 - specifies the lifetime in seconds of FDB entries learnt by the kernel.
586
587 .sp
588 .BI maxaddress " NUMBER"
589 - specifies the maximum number of FDB entries.
590
591 .sp
592 .RB [ no ] external
593 - specifies whether an external control plane
594 .RB "(e.g. " "ip route encap" )
595 or the internal FDB should be used.
596
597 .sp
598 .B gbp
599 - enables the Group Policy extension (VXLAN-GBP).
600
601 .in +4
602 Allows to transport group policy context across VXLAN network peers.
603 If enabled, includes the mark of a packet in the VXLAN header for outgoing
604 packets and fills the packet mark based on the information found in the
605 VXLAN header for incomming packets.
606
607 Format of upper 16 bits of packet mark (flags);
608
609 .in +2
610 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
611 .br
612 |-|-|-|-|-|-|-|-|-|D|-|-|A|-|-|-|
613 .br
614 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
615
616 .B D :=
617 Don't Learn bit. When set, this bit indicates that the egress
618 VTEP MUST NOT learn the source address of the encapsulated frame.
619
620 .B A :=
621 Indicates that the group policy has already been applied to
622 this packet. Policies MUST NOT be applied by devices when the A bit is set.
623 .in -2
624
625 Format of lower 16 bits of packet mark (policy ID):
626
627 .in +2
628 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
629 .br
630 | Group Policy ID |
631 .br
632 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
633 .in -2
634
635 Example:
636 iptables -A OUTPUT [...] -j MARK --set-mark 0x800FF
637
638 .in -4
639
640 .sp
641 .B gpe
642 - enables the Generic Protocol extension (VXLAN-GPE). Currently, this is
643 only supported together with the
644 .B external
645 keyword.
646
647 .in -8
648
649 .TP
650 GRE, IPIP, SIT, ERSPAN Type Support
651 For a link of types
652 .I GRE/IPIP/SIT/ERSPAN
653 the following additional arguments are supported:
654
655 .BI "ip link add " DEVICE
656 .BR type " { " gre " | " ipip " | " sit " | " erspan " }"
657 .BI " remote " ADDR " local " ADDR
658 [
659 .BR encap " { " fou " | " gue " | " none " }"
660 ] [
661 .BR encap-sport " { " \fIPORT " | " auto " }"
662 ] [
663 .BI "encap-dport " PORT
664 ] [
665 .RB [ no ] encap-csum
666 ] [
667 .I " [no]encap-remcsum "
668 ] [
669 .I " mode " { ip6ip | ipip | mplsip | any } "
670 ] [
671 .BR erspan " \fIIDX "
672 ]
673
674 .in +8
675 .sp
676 .BI remote " ADDR "
677 - specifies the remote address of the tunnel.
678
679 .sp
680 .BI local " ADDR "
681 - specifies the fixed local address for tunneled packets.
682 It must be an address on another interface on this host.
683
684 .sp
685 .BR encap " { " fou " | " gue " | " none " }"
686 - specifies type of secondary UDP encapsulation. "fou" indicates
687 Foo-Over-UDP, "gue" indicates Generic UDP Encapsulation.
688
689 .sp
690 .BR encap-sport " { " \fIPORT " | " auto " }"
691 - specifies the source port in UDP encapsulation.
692 .IR PORT
693 indicates the port by number, "auto"
694 indicates that the port number should be chosen automatically
695 (the kernel picks a flow based on the flow hash of the
696 encapsulated packet).
697
698 .sp
699 .RB [ no ] encap-csum
700 - specifies if UDP checksums are enabled in the secondary
701 encapsulation.
702
703 .sp
704 .RB [ no ] encap-remcsum
705 - specifies if Remote Checksum Offload is enabled. This is only
706 applicable for Generic UDP Encapsulation.
707
708 .sp
709 .BI mode " { ip6ip | ipip | mplsip | any } "
710 - specifies mode in which device should run. "ip6ip" indicates
711 IPv6-Over-IPv4, "ipip" indicates "IPv4-Over-IPv4", "mplsip" indicates
712 MPLS-Over-IPv4, "any" indicates IPv6, IPv4 or MPLS Over IPv4. Supported for
713 SIT where the default is "ip6ip" and IPIP where the default is "ipip".
714 IPv6-Over-IPv4 is not supported for IPIP.
715
716 .sp
717 .BR erspan " \fIIDX "
718 - specifies the ERSPAN index field.
719 .IR IDX
720 indicates a 20 bit index/port number associated with the ERSPAN
721 traffic's source port and direction.
722
723 .in -8
724
725 .TP
726 IP6GRE/IP6GRETAP Type Support
727 For a link of type
728 .I IP6GRE/IP6GRETAP
729 the following additional arguments are supported:
730
731 .BI "ip link add " DEVICE
732 .BR type " { " ip6gre " | " ip6gretap " }"
733 .BI remote " ADDR " local " ADDR"
734 [
735 .RB [ i | o ] seq
736 ] [
737 .RB [ i | o ] key
738 .I KEY
739 ] [
740 .RB [ i | o ] csum
741 ] [
742 .BI hoplimit " TTL "
743 ] [
744 .BI encaplimit " ELIM "
745 ] [
746 .BI tclass " TCLASS "
747 ] [
748 .BI flowlabel " FLOWLABEL "
749 ] [
750 .BI "dscp inherit"
751 ] [
752 .BI dev " PHYS_DEV "
753 ]
754
755 .in +8
756 .sp
757 .BI remote " ADDR "
758 - specifies the remote IPv6 address of the tunnel.
759
760 .sp
761 .BI local " ADDR "
762 - specifies the fixed local IPv6 address for tunneled packets.
763 It must be an address on another interface on this host.
764
765 .sp
766 .RB [ i | o ] seq
767 - serialize packets.
768 The
769 .B oseq
770 flag enables sequencing of outgoing packets.
771 The
772 .B iseq
773 flag requires that all input packets are serialized.
774
775 .sp
776 .RB [ i | o ] key " \fIKEY"
777 - use keyed GRE with key
778 .IR KEY ". "KEY
779 is either a number or an IPv4 address-like dotted quad.
780 The
781 .B key
782 parameter specifies the same key to use in both directions.
783 The
784 .BR ikey " and " okey
785 parameters specify different keys for input and output.
786
787 .sp
788 .RB [ i | o ] csum
789 - generate/require checksums for tunneled packets.
790 The
791 .B ocsum
792 flag calculates checksums for outgoing packets.
793 The
794 .B icsum
795 flag requires that all input packets have the correct
796 checksum. The
797 .B csum
798 flag is equivalent to the combination
799 .BR "icsum ocsum" .
800
801 .sp
802 .BI hoplimit " TTL"
803 - specifies Hop Limit value to use in outgoing packets.
804
805 .sp
806 .BI encaplimit " ELIM"
807 - specifies a fixed encapsulation limit. Default is 4.
808
809 .sp
810 .BI flowlabel " FLOWLABEL"
811 - specifies a fixed flowlabel.
812
813 .sp
814 .BI tclass " TCLASS"
815 - specifies the traffic class field on
816 tunneled packets, which can be specified as either a two-digit
817 hex value (e.g. c0) or a predefined string (e.g. internet).
818 The value
819 .B inherit
820 causes the field to be copied from the original IP header. The
821 values
822 .BI "inherit/" STRING
823 or
824 .BI "inherit/" 00 ".." ff
825 will set the field to
826 .I STRING
827 or
828 .IR 00 ".." ff
829 when tunneling non-IP packets. The default value is 00.
830
831 .in -8
832
833 .TP
834 IPoIB Type Support
835 For a link of type
836 .I IPoIB
837 the following additional arguments are supported:
838
839 .BI "ip link add " DEVICE " name " NAME
840 .BR "type ipoib " [ " pkey \fIPKEY" " ] [ " mode " \fIMODE \fR]"
841
842 .in +8
843 .sp
844 .BI pkey " PKEY "
845 - specifies the IB P-Key to use.
846
847 .BI mode " MODE "
848 - specifies the mode (datagram or connected) to use.
849
850 .TP
851 GENEVE Type Support
852 For a link of type
853 .I GENEVE
854 the following additional arguments are supported:
855
856 .BI "ip link add " DEVICE
857 .BI type " geneve " id " VNI " remote " IPADDR"
858 [
859 .BI ttl " TTL "
860 ] [
861 .BI tos " TOS "
862 ] [
863 .BI flowlabel " FLOWLABEL "
864 ] [
865 .BI dstport " PORT"
866 ] [
867 .RB [ no ] external
868 ] [
869 .RB [ no ] udpcsum
870 ] [
871 .RB [ no ] udp6zerocsumtx
872 ] [
873 .RB [ no ] udp6zerocsumrx
874 ]
875
876 .in +8
877 .sp
878 .BI id " VNI "
879 - specifies the Virtual Network Identifer to use.
880
881 .sp
882 .BI remote " IPADDR"
883 - specifies the unicast destination IP address to use in outgoing packets.
884
885 .sp
886 .BI ttl " TTL"
887 - specifies the TTL value to use in outgoing packets.
888
889 .sp
890 .BI tos " TOS"
891 - specifies the TOS value to use in outgoing packets.
892
893 .sp
894 .BI flowlabel " FLOWLABEL"
895 - specifies the flow label to use in outgoing packets.
896
897 .sp
898 .BI dstport " PORT"
899 - select a destination port other than the default of 6081.
900
901 .sp
902 .RB [ no ] external
903 - make this tunnel externally controlled (or not, which is the default). This
904 flag is mutually exclusive with the
905 .BR id ,
906 .BR remote ,
907 .BR ttl ,
908 .BR tos " and " flowlabel
909 options.
910
911 .sp
912 .RB [ no ] udpcsum
913 - specifies if UDP checksum is calculated for transmitted packets over IPv4.
914
915 .sp
916 .RB [ no ] udp6zerocsumtx
917 - skip UDP checksum calculation for transmitted packets over IPv6.
918
919 .sp
920 .RB [ no ] udp6zerocsumrx
921 - allow incoming UDP packets over IPv6 with zero checksum field.
922
923 .in -8
924
925 .TP
926 MACVLAN and MACVTAP Type Support
927 For a link of type
928 .I MACVLAN
929 or
930 .I MACVTAP
931 the following additional arguments are supported:
932
933 .BI "ip link add link " DEVICE " name " NAME
934 .BR type " { " macvlan " | " macvtap " } "
935 .BR mode " { " private " | " vepa " | " bridge " | " passthru
936 .RB " [ " nopromisc " ] | " source " } "
937
938 .in +8
939 .sp
940 .BR type " { " macvlan " | " macvtap " } "
941 - specifies the link type to use.
942 .BR macvlan " creates just a virtual interface, while "
943 .BR macvtap " in addition creates a character device "
944 .BR /dev/tapX " to be used just like a " tuntap " device."
945
946 .B mode private
947 - Do not allow communication between
948 .B macvlan
949 instances on the same physical interface, even if the external switch supports
950 hairpin mode.
951
952 .B mode vepa
953 - Virtual Ethernet Port Aggregator mode. Data from one
954 .B macvlan
955 instance to the other on the same physical interface is transmitted over the
956 physical interface. Either the attached switch needs to support hairpin mode,
957 or there must be a TCP/IP router forwarding the packets in order to allow
958 communication. This is the default mode.
959
960 .B mode bridge
961 - In bridge mode, all endpoints are directly connected to each other,
962 communication is not redirected through the physical interface's peer.
963
964 .BR mode " " passthru " [ " nopromisc " ] "
965 - This mode gives more power to a single endpoint, usually in
966 .BR macvtap " mode. It is not allowed for more than one endpoint on the same "
967 physical interface. All traffic will be forwarded to this endpoint, allowing
968 virtio guests to change MAC address or set promiscuous mode in order to bridge
969 the interface or create vlan interfaces on top of it. By default, this mode
970 forces the underlying interface into promiscuous mode. Passing the
971 .BR nopromisc " flag prevents this, so the promisc flag may be controlled "
972 using standard tools.
973
974 .B mode source
975 - allows one to set a list of allowed mac address, which is used to match
976 against source mac address from received frames on underlying interface. This
977 allows creating mac based VLAN associations, instead of standard port or tag
978 based. The feature is useful to deploy 802.1x mac based behavior,
979 where drivers of underlying interfaces doesn't allows that.
980 .in -8
981
982 .TP
983 High-availability Seamless Redundancy (HSR) Support
984 For a link of type
985 .I HSR
986 the following additional arguments are supported:
987
988 .BI "ip link add link " DEVICE " name " NAME " type hsr"
989 .BI slave1 " SLAVE1-IF " slave2 " SLAVE2-IF "
990 .RB [ " supervision"
991 .IR ADDR-BYTE " ] ["
992 .BR version " { " 0 " | " 1 " } ]"
993
994 .in +8
995 .sp
996 .BR type " hsr "
997 - specifies the link type to use, here HSR.
998
999 .BI slave1 " SLAVE1-IF "
1000 - Specifies the physical device used for the first of the two ring ports.
1001
1002 .BI slave2 " SLAVE2-IF "
1003 - Specifies the physical device used for the second of the two ring ports.
1004
1005 .BI supervision " ADDR-BYTE"
1006 - The last byte of the multicast address used for HSR supervision frames.
1007 Default option is "0", possible values 0-255.
1008
1009 .BR version " { " 0 " | " 1 " }"
1010 - Selects the protocol version of the interface. Default option is "0", which
1011 corresponds to the 2010 version of the HSR standard. Option "1" activates the
1012 2012 version.
1013 .in -8
1014
1015 .TP
1016 BRIDGE Type Support
1017 For a link of type
1018 .I BRIDGE
1019 the following additional arguments are supported:
1020
1021 .BI "ip link add " DEVICE " type bridge "
1022 [
1023 .BI ageing_time " AGEING_TIME "
1024 ] [
1025 .BI group_fwd_mask " MASK "
1026 ] [
1027 .BI group_address " ADDRESS "
1028 ] [
1029 .BI forward_delay " FORWARD_DELAY "
1030 ] [
1031 .BI hello_time " HELLO_TIME "
1032 ] [
1033 .BI max_age " MAX_AGE "
1034 ] [
1035 .BI stp_state " STP_STATE "
1036 ] [
1037 .BI priority " PRIORITY "
1038 ] [
1039 .BI vlan_filtering " VLAN_FILTERING "
1040 ] [
1041 .BI vlan_protocol " VLAN_PROTOCOL "
1042 ] [
1043 .BI vlan_default_pvid " VLAN_DEFAULT_PVID "
1044 ] [
1045 .BI vlan_stats_enabled " VLAN_STATS_ENABLED "
1046 ] [
1047 .BI mcast_snooping " MULTICAST_SNOOPING "
1048 ] [
1049 .BI mcast_router " MULTICAST_ROUTER "
1050 ] [
1051 .BI mcast_query_use_ifaddr " MCAST_QUERY_USE_IFADDR "
1052 ] [
1053 .BI mcast_querier " MULTICAST_QUERIER "
1054 ] [
1055 .BI mcast_hash_elasticity " HASH_ELASTICITY "
1056 ] [
1057 .BI mcast_hash_max " HASH_MAX "
1058 ] [
1059 .BI mcast_last_member_count " LAST_MEMBER_COUNT "
1060 ] [
1061 .BI mcast_startup_query_count " STARTUP_QUERY_COUNT "
1062 ] [
1063 .BI mcast_last_member_interval " LAST_MEMBER_INTERVAL "
1064 ] [
1065 .BI mcast_membership_interval " MEMBERSHIP_INTERVAL "
1066 ] [
1067 .BI mcast_querier_interval " QUERIER_INTERVAL "
1068 ] [
1069 .BI mcast_query_interval " QUERY_INTERVAL "
1070 ] [
1071 .BI mcast_query_response_interval " QUERY_RESPONSE_INTERVAL "
1072 ] [
1073 .BI mcast_startup_query_interval " STARTUP_QUERY_INTERVAL "
1074 ] [
1075 .BI mcast_stats_enabled " MCAST_STATS_ENABLED "
1076 ] [
1077 .BI mcast_igmp_version " IGMP_VERSION "
1078 ] [
1079 .BI mcast_mld_version " MLD_VERSION "
1080 ] [
1081 .BI nf_call_iptables " NF_CALL_IPTABLES "
1082 ] [
1083 .BI nf_call_ip6tables " NF_CALL_IP6TABLES "
1084 ] [
1085 .BI nf_call_arptables " NF_CALL_ARPTABLES "
1086 ]
1087
1088 .in +8
1089 .sp
1090 .BI ageing_time " AGEING_TIME "
1091 - configure the bridge's FDB entries ageing time, ie the number of seconds a MAC address will be kept in the FDB after a packet has been received from that address. after this time has passed, entries are cleaned up.
1092
1093 .BI group_fwd_mask " MASK "
1094 - set the group forward mask. This is the bitmask that is applied to decide whether to forward incoming frames destined to link-local addresses, ie addresses of the form 01:80:C2:00:00:0X (defaults to 0, ie the bridge does not forward any link-local frames).
1095
1096 .BI group_address " ADDRESS "
1097 - set the MAC address of the multicast group this bridge uses for STP. The address must be a link-local address in standard Ethernet MAC address format, ie an address of the form 01:80:C2:00:00:0X, with X in [0, 4..f].
1098
1099 .BI forward_delay " FORWARD_DELAY "
1100 - set the forwarding delay in seconds, ie the time spent in LISTENING state (before moving to LEARNING) and in LEARNING state (before moving to FORWARDING). Only relevant if STP is enabled. Valid values are between 2 and 30.
1101
1102 .BI hello_time " HELLO_TIME "
1103 - set the time in seconds between hello packets sent by the bridge, when it is a root bridge or a designated bridges. Only relevant if STP is enabled. Valid values are between 1 and 10.
1104
1105 .BI max_age " MAX_AGE "
1106 - set the hello packet timeout, ie the time in seconds until another bridge in the spanning tree is assumed to be dead, after reception of its last hello message. Only relevant if STP is enabled. Valid values are between 6 and 40.
1107
1108 .BI stp_state " STP_STATE "
1109 - turn spanning tree protocol on
1110 .RI ( STP_STATE " > 0) "
1111 or off
1112 .RI ( STP_STATE " == 0). "
1113 for this bridge.
1114
1115 .BI priority " PRIORITY "
1116 - set this bridge's spanning tree priority, used during STP root bridge election.
1117 .I PRIORITY
1118 is a 16bit unsigned integer.
1119
1120 .BI vlan_filtering " VLAN_FILTERING "
1121 - turn VLAN filtering on
1122 .RI ( VLAN_FILTERING " > 0) "
1123 or off
1124 .RI ( VLAN_FILTERING " == 0). "
1125 When disabled, the bridge will not consider the VLAN tag when handling packets.
1126
1127 .BR vlan_protocol " { " 802.1Q " | " 802.1ad " } "
1128 - set the protocol used for VLAN filtering.
1129
1130 .BI vlan_default_pvid " VLAN_DEFAULT_PVID "
1131 - set the default PVID (native/untagged VLAN ID) for this bridge.
1132
1133 .BI vlan_stats_enabled " VLAN_STATS_ENABLED "
1134 - enable
1135 .RI ( VLAN_STATS_ENABLED " == 1) "
1136 or disable
1137 .RI ( VLAN_STATS_ENABLED " == 0) "
1138 per-VLAN stats accounting.
1139
1140 .BI mcast_snooping " MULTICAST_SNOOPING "
1141 - turn multicast snooping on
1142 .RI ( MULTICAST_SNOOPING " > 0) "
1143 or off
1144 .RI ( MULTICAST_SNOOPING " == 0). "
1145
1146 .BI mcast_router " MULTICAST_ROUTER "
1147 - set bridge's multicast router if IGMP snooping is enabled.
1148 .I MULTICAST_ROUTER
1149 is an integer value having the following meaning:
1150 .in +8
1151 .sp
1152 .B 0
1153 - disabled.
1154
1155 .B 1
1156 - automatic (queried).
1157
1158 .B 2
1159 - permanently enabled.
1160 .in -8
1161
1162 .BI mcast_query_use_ifaddr " MCAST_QUERY_USE_IFADDR "
1163 - whether to use the bridge's own IP address as source address for IGMP queries
1164 .RI ( MCAST_QUERY_USE_IFADDR " > 0) "
1165 or the default of 0.0.0.0
1166 .RI ( MCAST_QUERY_USE_IFADDR " == 0). "
1167
1168 .BI mcast_querier " MULTICAST_QUERIER "
1169 - enable
1170 .RI ( MULTICAST_QUERIER " > 0) "
1171 or disable
1172 .RI ( MULTICAST_QUERIER " == 0) "
1173 IGMP querier, ie sending of multicast queries by the bridge (default: disabled).
1174
1175 .BI mcast_querier_interval " QUERIER_INTERVAL "
1176 - interval between queries sent by other routers. if no queries are seen after this delay has passed, the bridge will start to send its own queries (as if
1177 .BI mcast_querier
1178 was enabled).
1179
1180 .BI mcast_hash_elasticity " HASH_ELASTICITY "
1181 - set multicast database hash elasticity, ie the maximum chain length in the multicast hash table (defaults to 4).
1182
1183 .BI mcast_hash_max " HASH_MAX "
1184 - set maximum size of multicast hash table (defaults to 512, value must be a power of 2).
1185
1186 .BI mcast_last_member_count " LAST_MEMBER_COUNT "
1187 - set multicast last member count, ie the number of queries the bridge will send before stopping forwarding a multicast group after a "leave" message has been received (defaults to 2).
1188
1189 .BI mcast_last_member_interval " LAST_MEMBER_INTERVAL "
1190 - interval between queries to find remaining members of a group, after a "leave" message is received.
1191
1192 .BI mcast_startup_query_count " STARTUP_QUERY_COUNT "
1193 - set the number of IGMP queries to send during startup phase (defaults to 2).
1194
1195 .BI mcast_startup_query_interval " STARTUP_QUERY_INTERVAL "
1196 - interval between queries in the startup phase.
1197
1198 .BI mcast_query_interval " QUERY_INTERVAL "
1199 - interval between queries sent by the bridge after the end of the startup phase.
1200
1201 .BI mcast_query_response_interval " QUERY_RESPONSE_INTERVAL "
1202 - set the Max Response Time/Maximum Response Delay for IGMP/MLD queries sent by the bridge.
1203
1204 .BI mcast_membership_interval " MEMBERSHIP_INTERVAL "
1205 - delay after which the bridge will leave a group, if no membership reports for this group are received.
1206
1207 .BI mcast_stats_enabled " MCAST_STATS_ENABLED "
1208 - enable
1209 .RI ( MCAST_STATS_ENABLED " > 0) "
1210 or disable
1211 .RI ( MCAST_STATS_ENABLED " == 0) "
1212 multicast (IGMP/MLD) stats accounting.
1213
1214 .BI mcast_igmp_version " IGMP_VERSION "
1215 - set the IGMP version.
1216
1217 .BI mcast_mld_version " MLD_VERSION "
1218 - set the MLD version.
1219
1220 .BI nf_call_iptables " NF_CALL_IPTABLES "
1221 - enable
1222 .RI ( NF_CALL_IPTABLES " > 0) "
1223 or disable
1224 .RI ( NF_CALL_IPTABLES " == 0) "
1225 iptables hooks on the bridge.
1226
1227 .BI nf_call_ip6tables " NF_CALL_IP6TABLES "
1228 - enable
1229 .RI ( NF_CALL_IP6TABLES " > 0) "
1230 or disable
1231 .RI ( NF_CALL_IP6TABLES " == 0) "
1232 ip6tables hooks on the bridge.
1233
1234 .BI nf_call_arptables " NF_CALL_ARPTABLES "
1235 - enable
1236 .RI ( NF_CALL_ARPTABLES " > 0) "
1237 or disable
1238 .RI ( NF_CALL_ARPTABLES " == 0) "
1239 arptables hooks on the bridge.
1240
1241
1242 .in-8
1243
1244 .TP
1245 MACsec Type Support
1246 For a link of type
1247 .I MACsec
1248 the following additional arguments are supported:
1249
1250 .BI "ip link add link " DEVICE " name " NAME " type macsec"
1251 [ [
1252 .BI address " <lladdr>"
1253 ]
1254 .BI port " PORT"
1255 |
1256 .BI sci " SCI"
1257 ] [
1258 .BI cipher " CIPHER_SUITE"
1259 ] [
1260 .BR icvlen " { "
1261 .IR 8..16 " } ] ["
1262 .BR encrypt " {"
1263 .BR on " | " off " } ] [ "
1264 .BR send_sci " { " on " | " off " } ] ["
1265 .BR end_station " { " on " | " off " } ] ["
1266 .BR scb " { " on " | " off " } ] ["
1267 .BR protect " { " on " | " off " } ] ["
1268 .BR replay " { " on " | " off " }"
1269 .BR window " { "
1270 .IR 0..2^32-1 " } ] ["
1271 .BR validate " { " strict " | " check " | " disabled " } ] ["
1272 .BR encodingsa " { "
1273 .IR 0..3 " } ]"
1274
1275 .in +8
1276 .sp
1277 .BI address " <lladdr> "
1278 - sets the system identifier component of secure channel for this MACsec device.
1279
1280 .sp
1281 .BI port " PORT "
1282 - sets the port number component of secure channel for this MACsec device, in a
1283 range from 1 to 65535 inclusive. Numbers with a leading " 0 " or " 0x " are
1284 interpreted as octal and hexadecimal, respectively.
1285
1286 .sp
1287 .BI sci " SCI "
1288 - sets the secure channel identifier for this MACsec device.
1289 .I SCI
1290 is a 64bit wide number in hexadecimal format.
1291
1292 .sp
1293 .BI cipher " CIPHER_SUITE "
1294 - defines the cipher suite to use.
1295
1296 .sp
1297 .BI icvlen " LENGTH "
1298 - sets the length of the Integrity Check Value (ICV).
1299
1300 .sp
1301 .BR "encrypt on " or " encrypt off"
1302 - switches between authenticated encryption, or authenticity mode only.
1303
1304 .sp
1305 .BR "send_sci on " or " send_sci off"
1306 - specifies whether the SCI is included in every packet, or only when it is necessary.
1307
1308 .sp
1309 .BR "end_station on " or " end_station off"
1310 - sets the End Station bit.
1311
1312 .sp
1313 .BR "scb on " or " scb off"
1314 - sets the Single Copy Broadcast bit.
1315
1316 .sp
1317 .BR "protect on " or " protect off"
1318 - enables MACsec protection on the device.
1319
1320 .sp
1321 .BR "replay on " or " replay off"
1322 - enables replay protection on the device.
1323
1324 .in +8
1325
1326 .sp
1327 .BI window " SIZE "
1328 - sets the size of the replay window.
1329
1330 .in -8
1331
1332 .sp
1333 .BR "validate strict " or " validate check " or " validate disabled"
1334 - sets the validation mode on the device.
1335
1336 .sp
1337 .BI encodingsa " AN "
1338 - sets the active secure association for transmission.
1339
1340 .in -8
1341
1342 .TP
1343 VRF Type Support
1344 For a link of type
1345 .I VRF
1346 the following additional arguments are supported:
1347
1348 .BI "ip link add " DEVICE " type vrf table " TABLE
1349
1350 .in +8
1351 .sp
1352 .BR table " table id associated with VRF device"
1353
1354 .in -8
1355
1356 .SS ip link delete - delete virtual link
1357
1358 .TP
1359 .BI dev " DEVICE "
1360 specifies the virtual device to act operate on.
1361
1362 .TP
1363 .BI group " GROUP "
1364 specifies the group of virtual links to delete. Group 0 is not allowed to be
1365 deleted since it is the default group.
1366
1367 .TP
1368 .BI type " TYPE "
1369 specifies the type of the device.
1370
1371 .SS ip link set - change device attributes
1372
1373 .PP
1374 .B Warning:
1375 If multiple parameter changes are requested,
1376 .B ip
1377 aborts immediately after any of the changes have failed.
1378 This is the only case when
1379 .B ip
1380 can move the system to an unpredictable state. The solution
1381 is to avoid changing several parameters with one
1382 .B ip link set
1383 call.
1384
1385 .TP
1386 .BI dev " DEVICE "
1387 .I DEVICE
1388 specifies network device to operate on. When configuring SR-IOV Virtual Function
1389 (VF) devices, this keyword should specify the associated Physical Function (PF)
1390 device.
1391
1392 .TP
1393 .BI group " GROUP "
1394 .I GROUP
1395 has a dual role: If both group and dev are present, then move the device to the
1396 specified group. If only a group is specified, then the command operates on
1397 all devices in that group.
1398
1399 .TP
1400 .BR up " and " down
1401 change the state of the device to
1402 .B UP
1403 or
1404 .BR "DOWN" .
1405
1406 .TP
1407 .BR "arp on " or " arp off"
1408 change the
1409 .B NOARP
1410 flag on the device.
1411
1412 .TP
1413 .BR "multicast on " or " multicast off"
1414 change the
1415 .B MULTICAST
1416 flag on the device.
1417
1418 .TP
1419 .BR "protodown on " or " protodown off"
1420 change the
1421 .B PROTODOWN
1422 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.
1423
1424 .TP
1425 .BR "dynamic on " or " dynamic off"
1426 change the
1427 .B DYNAMIC
1428 flag on the device. Indicates that address can change when interface goes down (currently
1429 .B NOT
1430 used by the Linux).
1431
1432 .TP
1433 .BI name " NAME"
1434 change the name of the device. This operation is not
1435 recommended if the device is running or has some addresses
1436 already configured.
1437
1438 .TP
1439 .BI txqueuelen " NUMBER"
1440 .TP
1441 .BI txqlen " NUMBER"
1442 change the transmit queue length of the device.
1443
1444 .TP
1445 .BI mtu " NUMBER"
1446 change the
1447 .I MTU
1448 of the device.
1449
1450 .TP
1451 .BI address " LLADDRESS"
1452 change the station address of the interface.
1453
1454 .TP
1455 .BI broadcast " LLADDRESS"
1456 .TP
1457 .BI brd " LLADDRESS"
1458 .TP
1459 .BI peer " LLADDRESS"
1460 change the link layer broadcast address or the peer address when
1461 the interface is
1462 .IR "POINTOPOINT" .
1463
1464 .TP
1465 .BI netns " NETNSNAME " \fR| " PID"
1466 move the device to the network namespace associated with name
1467 .IR "NETNSNAME " or
1468 .RI process " PID".
1469
1470 Some devices are not allowed to change network namespace: loopback, bridge,
1471 ppp, wireless. These are network namespace local devices. In such case
1472 .B ip
1473 tool will return "Invalid argument" error. It is possible to find out if device is local
1474 to a single network namespace by checking
1475 .B netns-local
1476 flag in the output of the
1477 .BR ethtool ":"
1478
1479 .in +8
1480 .B ethtool -k
1481 .I DEVICE
1482 .in -8
1483
1484 To change network namespace for wireless devices the
1485 .B iw
1486 tool can be used. But it allows to change network namespace only for physical devices and by process
1487 .IR PID .
1488
1489 .TP
1490 .BI alias " NAME"
1491 give the device a symbolic name for easy reference.
1492
1493 .TP
1494 .BI group " GROUP"
1495 specify the group the device belongs to.
1496 The available groups are listed in file
1497 .BR "@SYSCONFDIR@/group" .
1498
1499 .TP
1500 .BI vf " NUM"
1501 specify a Virtual Function device to be configured. The associated PF device
1502 must be specified using the
1503 .B dev
1504 parameter.
1505
1506 .in +8
1507 .BI mac " LLADDRESS"
1508 - change the station address for the specified VF. The
1509 .B vf
1510 parameter must be specified.
1511
1512 .sp
1513 .BI vlan " VLANID"
1514 - change the assigned VLAN for the specified VF. When specified, all traffic
1515 sent from the VF will be tagged with the specified VLAN ID. Incoming traffic
1516 will be filtered for the specified VLAN ID, and will have all VLAN tags
1517 stripped before being passed to the VF. Setting this parameter to 0 disables
1518 VLAN tagging and filtering. The
1519 .B vf
1520 parameter must be specified.
1521
1522 .sp
1523 .BI qos " VLAN-QOS"
1524 - assign VLAN QOS (priority) bits for the VLAN tag. When specified, all VLAN
1525 tags transmitted by the VF will include the specified priority bits in the
1526 VLAN tag. If not specified, the value is assumed to be 0. Both the
1527 .B vf
1528 and
1529 .B vlan
1530 parameters must be specified. Setting both
1531 .B vlan
1532 and
1533 .B qos
1534 as 0 disables VLAN tagging and filtering for the VF.
1535
1536 .sp
1537 .BI proto " VLAN-PROTO"
1538 - assign VLAN PROTOCOL for the VLAN tag, either 802.1Q or 802.1ad.
1539 Setting to 802.1ad, all traffic sent from the VF will be tagged with VLAN S-Tag.
1540 Incoming traffic will have VLAN S-Tags stripped before being passed to the VF.
1541 Setting to 802.1ad also enables an option to concatenate another VLAN tag, so both
1542 S-TAG and C-TAG will be inserted/stripped for outgoing/incoming traffic, respectively.
1543 If not specified, the value is assumed to be 802.1Q. Both the
1544 .B vf
1545 and
1546 .B vlan
1547 parameters must be specified.
1548
1549 .sp
1550 .BI rate " TXRATE"
1551 -- change the allowed transmit bandwidth, in Mbps, for the specified VF.
1552 Setting this parameter to 0 disables rate limiting.
1553 .B vf
1554 parameter must be specified.
1555 Please use new API
1556 .B "max_tx_rate"
1557 option instead.
1558
1559 .sp
1560 .BI max_tx_rate " TXRATE"
1561 - change the allowed maximum transmit bandwidth, in Mbps, for the specified VF.
1562 .B vf
1563 parameter must be specified.
1564
1565 .sp
1566 .BI min_tx_rate " TXRATE"
1567 - change the allowed minimum transmit bandwidth, in Mbps, for the specified VF.
1568 Minimum TXRATE should be always <= Maximum TXRATE.
1569 .B vf
1570 parameter must be specified.
1571
1572 .sp
1573 .BI spoofchk " on|off"
1574 - turn packet spoof checking on or off for the specified VF.
1575 .sp
1576 .BI query_rss " on|off"
1577 - toggle the ability of querying the RSS configuration of a specific VF. VF RSS information like RSS hash key may be considered sensitive on some devices where this information is shared between VF and PF and thus its querying may be prohibited by default.
1578 .sp
1579 .BI state " auto|enable|disable"
1580 - set the virtual link state as seen by the specified VF. Setting to auto means a
1581 reflection of the PF link state, enable lets the VF to communicate with other VFs on
1582 this host even if the PF link state is down, disable causes the HW to drop any packets
1583 sent by the VF.
1584 .sp
1585 .BI trust " on|off"
1586 - trust the specified VF user. This enables that VF user can set a specific feature
1587 which may impact security and/or performance. (e.g. VF multicast promiscuous mode)
1588 .sp
1589 .BI node_guid " eui64"
1590 - configure node GUID for Infiniband VFs.
1591 .sp
1592 .BI port_guid " eui64"
1593 - configure port GUID for Infiniband VFs.
1594 .in -8
1595
1596 .TP
1597 .B xdp object "|" pinned "|" off
1598 set (or unset) a XDP ("eXpress Data Path") BPF program to run on every
1599 packet at driver level.
1600 .B ip link
1601 output will indicate a
1602 .B xdp
1603 flag for the networking device. If the driver does not have native XDP
1604 support, the kernel will fall back to a slower, driver-independent "generic"
1605 XDP variant. The
1606 .B ip link
1607 output will in that case indicate
1608 .B xdpgeneric
1609 instead of
1610 .B xdp
1611 only. If the driver does have native XDP support, but the program is
1612 loaded under
1613 .B xdpgeneric object "|" pinned
1614 then the kernel will use the generic XDP variant instead of the native one.
1615 .B xdpdrv
1616 has the opposite effect of requestsing that the automatic fallback to the
1617 generic XDP variant be disabled and in case driver is not XDP-capable error
1618 should be returned.
1619 .B xdpdrv
1620 also disables hardware offloads.
1621 .B xdpoffload
1622 in ip link output indicates that the program has been offloaded to hardware
1623 and can also be used to request the "offload" mode, much like
1624 .B xdpgeneric
1625 it forces program to be installed specifically in HW/FW of the apater.
1626
1627 .B off
1628 (or
1629 .B none
1630 )
1631 - Detaches any currently attached XDP/BPF program from the given device.
1632
1633 .BI object " FILE "
1634 - Attaches a XDP/BPF program to the given device. The
1635 .I FILE
1636 points to a BPF ELF file (f.e. generated by LLVM) that contains the BPF
1637 program code, map specifications, etc. If a XDP/BPF program is already
1638 attached to the given device, an error will be thrown. If no XDP/BPF
1639 program is currently attached, the device supports XDP and the program
1640 from the BPF ELF file passes the kernel verifier, then it will be attached
1641 to the device. If the option
1642 .I -force
1643 is passed to
1644 .B ip
1645 then any prior attached XDP/BPF program will be atomically overridden and
1646 no error will be thrown in this case. If no
1647 .B section
1648 option is passed, then the default section name ("prog") will be assumed,
1649 otherwise the provided section name will be used. If no
1650 .B verbose
1651 option is passed, then a verifier log will only be dumped on load error.
1652 See also
1653 .B EXAMPLES
1654 section for usage examples.
1655
1656 .BI section " NAME "
1657 - Specifies a section name that contains the BPF program code. If no section
1658 name is specified, the default one ("prog") will be used. This option is
1659 to be passed with the
1660 .B object
1661 option.
1662
1663 .BI verbose
1664 - Act in verbose mode. For example, even in case of success, this will
1665 print the verifier log in case a program was loaded from a BPF ELF file.
1666
1667 .BI pinned " FILE "
1668 - Attaches a XDP/BPF program to the given device. The
1669 .I FILE
1670 points to an already pinned BPF program in the BPF file system. The option
1671 .B section
1672 doesn't apply here, but otherwise semantics are the same as with the option
1673 .B object
1674 described already.
1675
1676 .TP
1677 .BI master " DEVICE"
1678 set master device of the device (enslave device).
1679
1680 .TP
1681 .BI nomaster
1682 unset master device of the device (release device).
1683
1684 .TP
1685 .BI addrgenmode " eui64|none|stable_secret|random"
1686 set the IPv6 address generation mode
1687
1688 .I eui64
1689 - use a Modified EUI-64 format interface identifier
1690
1691 .I none
1692 - disable automatic address generation
1693
1694 .I stable_secret
1695 - generate the interface identifier based on a preset /proc/sys/net/ipv6/conf/{default,DEVICE}/stable_secret
1696
1697 .I random
1698 - like stable_secret, but auto-generate a new random secret if none is set
1699
1700 .TP
1701 .BR "link-netnsid "
1702 set peer netnsid for a cross-netns interface
1703
1704 .TP
1705 .BI type " ETYPE TYPE_ARGS"
1706 Change type-specific settings. For a list of supported types and arguments refer
1707 to the description of
1708 .B "ip link add"
1709 above. In addition to that, it is possible to manipulate settings to slave
1710 devices:
1711
1712 .TP
1713 Bridge Slave Support
1714 For a link with master
1715 .B bridge
1716 the following additional arguments are supported:
1717
1718 .B "ip link set type bridge_slave"
1719 [
1720 .B fdb_flush
1721 ] [
1722 .BI state " STATE"
1723 ] [
1724 .BI priority " PRIO"
1725 ] [
1726 .BI cost " COST"
1727 ] [
1728 .BR guard " { " on " | " off " }"
1729 ] [
1730 .BR hairpin " { " on " | " off " }"
1731 ] [
1732 .BR fastleave " { " on " | " off " }"
1733 ] [
1734 .BR root_block " { " on " | " off " }"
1735 ] [
1736 .BR learning " { " on " | " off " }"
1737 ] [
1738 .BR flood " { " on " | " off " }"
1739 ] [
1740 .BR proxy_arp " { " on " | " off " }"
1741 ] [
1742 .BR proxy_arp_wifi " { " on " | " off " }"
1743 ] [
1744 .BI mcast_router " MULTICAST_ROUTER"
1745 ] [
1746 .BR mcast_fast_leave " { " on " | " off "}"
1747 ] [
1748 .BR mcast_flood " { " on " | " off " }"
1749 ] [
1750 .BR group_fwd_mask " MASK ]"
1751
1752 .in +8
1753 .sp
1754 .B fdb_flush
1755 - flush bridge slave's fdb dynamic entries.
1756
1757 .BI state " STATE"
1758 - Set port state.
1759 .I STATE
1760 is a number representing the following states:
1761 .BR 0 " (disabled),"
1762 .BR 1 " (listening),"
1763 .BR 2 " (learning),"
1764 .BR 3 " (forwarding),"
1765 .BR 4 " (blocking)."
1766
1767 .BI priority " PRIO"
1768 - set port priority (allowed values are between 0 and 63, inclusively).
1769
1770 .BI cost " COST"
1771 - set port cost (allowed values are between 1 and 65535, inclusively).
1772
1773 .BR guard " { " on " | " off " }"
1774 - block incoming BPDU packets on this port.
1775
1776 .BR hairpin " { " on " | " off " }"
1777 - enable hairpin mode on this port. This will allow incoming packets on this
1778 port to be reflected back.
1779
1780 .BR fastleave " { " on " | " off " }"
1781 - enable multicast fast leave on this port.
1782
1783 .BR root_block " { " on " | " off " }"
1784 - block this port from becoming the bridge's root port.
1785
1786 .BR learning " { " on " | " off " }"
1787 - allow MAC address learning on this port.
1788
1789 .BR flood " { " on " | " off " }"
1790 - open the flood gates on this port, i.e. forward all unicast frames to this
1791 port also. Requires
1792 .BR proxy_arp " and " proxy_arp_wifi
1793 to be turned off.
1794
1795 .BR proxy_arp " { " on " | " off " }"
1796 - enable proxy ARP on this port.
1797
1798 .BR proxy_arp_wifi " { " on " | " off " }"
1799 - enable proxy ARP on this port which meets extended requirements by IEEE
1800 802.11 and Hotspot 2.0 specifications.
1801
1802 .BI mcast_router " MULTICAST_ROUTER"
1803 - configure this port for having multicast routers attached. A port with a
1804 multicast router will receive all multicast traffic.
1805 .I MULTICAST_ROUTER
1806 may be either
1807 .B 0
1808 to disable multicast routers on this port,
1809 .B 1
1810 to let the system detect the presence of of routers (this is the default),
1811 .B 2
1812 to permanently enable multicast traffic forwarding on this port or
1813 .B 3
1814 to enable multicast routers temporarily on this port, not depending on incoming
1815 queries.
1816
1817 .BR mcast_fast_leave " { " on " | " off " }"
1818 - this is a synonym to the
1819 .B fastleave
1820 option above.
1821
1822 .BR mcast_flood " { " on " | " off " }"
1823 - controls whether a given port will be flooded with multicast traffic for which there is no MDB entry.
1824
1825 .BI group_fwd_mask " MASK "
1826 - set the group forward mask. This is the bitmask that is applied to decide whether to forward incoming frames destined to link-local addresses, ie addresses of the form 01:80:C2:00:00:0X (defaults to 0, ie the bridge does not forward any link-local frames coming on this port).
1827
1828 .in -8
1829
1830 .TP
1831 Bonding Slave Support
1832 For a link with master
1833 .B bond
1834 the following additional arguments are supported:
1835
1836 .B "ip link set type bond_slave"
1837 [
1838 .BI queue_id " ID"
1839 ]
1840
1841 .in +8
1842 .sp
1843 .BI queue_id " ID"
1844 - set the slave's queue ID (a 16bit unsigned value).
1845
1846 .in -8
1847
1848 .TP
1849 MACVLAN and MACVTAP Support
1850 Modify list of allowed macaddr for link in source mode.
1851
1852 .B "ip link set type { macvlan | macvap } "
1853 [
1854 .BI macaddr " " "" COMMAND " " MACADDR " ..."
1855 ]
1856
1857 Commands:
1858 .in +8
1859 .B add
1860 - add MACADDR to allowed list
1861 .sp
1862 .B set
1863 - replace allowed list
1864 .sp
1865 .B del
1866 - remove MACADDR from allowed list
1867 .sp
1868 .B flush
1869 - flush whole allowed list
1870 .sp
1871 .in -8
1872
1873
1874 .SS ip link show - display device attributes
1875
1876 .TP
1877 .BI dev " NAME " (default)
1878 .I NAME
1879 specifies the network device to show.
1880 If this argument is omitted all devices in the default group are listed.
1881
1882 .TP
1883 .BI group " GROUP "
1884 .I GROUP
1885 specifies what group of devices to show.
1886
1887 .TP
1888 .B up
1889 only display running interfaces.
1890
1891 .TP
1892 .BI master " DEVICE "
1893 .I DEVICE
1894 specifies the master device which enslaves devices to show.
1895
1896 .TP
1897 .BI vrf " NAME "
1898 .I NAME
1899 speficies the VRF which enslaves devices to show.
1900
1901 .TP
1902 .BI type " TYPE "
1903 .I TYPE
1904 specifies the type of devices to show.
1905
1906 Note that the type name is not checked against the list of supported types -
1907 instead it is sent as-is to the kernel. Later it is used to filter the returned
1908 interface list by comparing it with the relevant attribute in case the kernel
1909 didn't filter already. Therefore any string is accepted, but may lead to empty
1910 output.
1911
1912 .SS ip link xstats - display extended statistics
1913
1914 .TP
1915 .BI type " TYPE "
1916 .I TYPE
1917 specifies the type of devices to display extended statistics for.
1918
1919 .SS ip link afstats - display address-family specific statistics
1920
1921 .TP
1922 .BI dev " DEVICE "
1923 .I DEVICE
1924 specifies the device to display address-family statistics for.
1925
1926 .SS ip link help - display help
1927
1928 .PP
1929 .I "TYPE"
1930 specifies which help of link type to dislpay.
1931
1932 .SS
1933 .I GROUP
1934 may be a number or a string from the file
1935 .B @SYSCONFDIR@/group
1936 which can be manually filled.
1937
1938 .SH "EXAMPLES"
1939 .PP
1940 ip link show
1941 .RS 4
1942 Shows the state of all network interfaces on the system.
1943 .RE
1944 .PP
1945 ip link show type bridge
1946 .RS 4
1947 Shows the bridge devices.
1948 .RE
1949 .PP
1950 ip link show type vlan
1951 .RS 4
1952 Shows the vlan devices.
1953 .RE
1954 .PP
1955 ip link show master br0
1956 .RS 4
1957 Shows devices enslaved by br0
1958 .RE
1959 .PP
1960 ip link set dev ppp0 mtu 1400
1961 .RS 4
1962 Change the MTU the ppp0 device.
1963 .RE
1964 .PP
1965 ip link add link eth0 name eth0.10 type vlan id 10
1966 .RS 4
1967 Creates a new vlan device eth0.10 on device eth0.
1968 .RE
1969 .PP
1970 ip link delete dev eth0.10
1971 .RS 4
1972 Removes vlan device.
1973 .RE
1974
1975 ip link help gre
1976 .RS 4
1977 Display help for the gre link type.
1978 .RE
1979 .PP
1980 ip link add name tun1 type ipip remote 192.168.1.1
1981 local 192.168.1.2 ttl 225 encap gue encap-sport auto
1982 encap-dport 5555 encap-csum encap-remcsum
1983 .RS 4
1984 Creates an IPIP that is encapsulated with Generic UDP Encapsulation,
1985 and the outer UDP checksum and remote checksum offload are enabled.
1986 .RE
1987 .PP
1988 ip link set dev eth0 xdp obj prog.o
1989 .RS 4
1990 Attaches a XDP/BPF program to device eth0, where the program is
1991 located in prog.o, section "prog" (default section). In case a
1992 XDP/BPF program is already attached, throw an error.
1993 .RE
1994 .PP
1995 ip -force link set dev eth0 xdp obj prog.o sec foo
1996 .RS 4
1997 Attaches a XDP/BPF program to device eth0, where the program is
1998 located in prog.o, section "foo". In case a XDP/BPF program is
1999 already attached, it will be overridden by the new one.
2000 .RE
2001 .PP
2002 ip -force link set dev eth0 xdp pinned /sys/fs/bpf/foo
2003 .RS 4
2004 Attaches a XDP/BPF program to device eth0, where the program was
2005 previously pinned as an object node into BPF file system under
2006 name foo.
2007 .RE
2008 .PP
2009 ip link set dev eth0 xdp off
2010 .RS 4
2011 If a XDP/BPF program is attached on device eth0, detach it and
2012 effectively turn off XDP for device eth0.
2013 .RE
2014 .PP
2015 ip link add link wpan0 lowpan0 type lowpan
2016 .RS 4
2017 Creates a 6LoWPAN interface named lowpan0 on the underlying
2018 IEEE 802.15.4 device wpan0.
2019 .RE
2020
2021 .SH SEE ALSO
2022 .br
2023 .BR ip (8),
2024 .BR ip-netns (8),
2025 .BR ethtool (8),
2026 .BR iptables (8)
2027
2028 .SH AUTHOR
2029 Original Manpage by Michail Litvak <mci@owl.openwall.com>