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