1 .TH IP\-LINK 8 "13 Dec 2012" "iproute2" "Linux"
3 ip-link \- network device configuration
12 .RI " { " COMMAND " | "
18 \fB\-V\fR[\fIersion\fR] |
19 \fB\-h\fR[\fIuman-readable\fR] |
20 \fB\-s\fR[\fItatistics\fR] |
21 \fB\-r\fR[\fIesolve\fR] |
22 \fB\-f\fR[\fIamily\fR] {
23 .BR inet " | " inet6 " | " ipx " | " dnet " | " link " } | "
24 \fB\-o\fR[\fIneline\fR] |
25 \fB\-br\fR[\fIief\fR] }
84 .BR "ip link delete " {
95 .RB "} { " up " | " down " | " arp " { " on " | " off " } |"
97 .BR promisc " { " on " | " off " } |"
99 .BR allmulticast " { " on " | " off " } |"
101 .BR dynamic " { " on " | " off " } |"
103 .BR multicast " { " on " | " off " } |"
135 .IR VLAN-QOS " ] ] ["
142 .B spoofchk { on | off } ] [
143 .B state { auto | enable | disable}
151 .B addrgenmode { eui64 | none }
159 .RI "[ " DEVICE " | "
173 .SS ip link add - add virtual link
177 specifies the physical device to act operate on.
180 specifies the name of the new virtual device.
183 specifies the type of the new device.
189 - Ethernet Bridge device
194 - Controller Area Network interface
197 - Dummy network interface
200 - High-availability Seamless Redundancy device
203 - Intermediate Functional Block device
206 - IP over Infiniband device
209 - Virtual interface base on link layer address (MAC)
212 - Virtual interface based on link layer address (MAC) and TAP.
215 - Virtual Controller Area Network interface
218 - Virtual ethernet interface
221 - 802.1q tagged virtual LAN interface
224 - Virtual eXtended LAN
227 - Virtual tunnel interface IPv4|IPv6 over IPv6
230 - Virtual tunnel interface IPv4 over IPv4
233 - Virtual tunnel interface IPv6 over IPv4
236 - Virtual tunnel interface GRE over IPv4
239 - Virtual L2 tunnel interface GRE over IPv4
242 - Virtual tunnel interface GRE over IPv6
245 - Virtual L2 tunnel interface GRE over IPv6
248 - Virtual tunnel interface
251 - Netlink monitoring device
254 - Interface for L3 (IPv6/IPv4) based VLANs
257 - Interface for 6LoWPAN (IPv6) over IEEE 802.15.4 / Bluetooth
260 - GEneric NEtwork Virtualization Encapsulation
264 .BI numtxqueues " QUEUE_COUNT "
265 specifies the number of transmit queues for new device.
268 .BI numrxqueues " QUEUE_COUNT "
269 specifies the number of receive queues for new device.
273 specifies the desired index of the new virtual device. The link creation fails, if the index is busy.
279 the following additional arguments are supported:
286 .BI protocol " VLAN_PROTO "
290 .BR reorder_hdr " { " on " | " off " } "
293 .BR gvrp " { " on " | " off " } "
296 .BR mvrp " { " on " | " off " } "
299 .BR loose_binding " { " on " | " off " } "
302 .BI ingress-qos-map " QOS-MAP "
305 .BI egress-qos-map " QOS-MAP "
310 .BI protocol " VLAN_PROTO "
311 - either 802.1Q or 802.1ad.
314 - specifies the VLAN Identifer to use. Note that numbers with a leading " 0 " or " 0x " are interpreted as octal or hexadeimal, respectively.
316 .BR reorder_hdr " { " on " | " off " } "
317 - specifies whether ethernet headers are reordered or not (default is
322 .BR reorder_hdr " is " on
323 then VLAN header will be not inserted immediately but only before passing to the
324 physical device (if this device does not support VLAN offloading), the similar
325 on the RX direction - by default the packet will be untagged before being
326 received by VLAN device. Reordering allows to accelerate tagging on egress and
327 to hide VLAN header on ingress so the packet looks like regular Ethernet packet,
328 at the same time it might be confusing while the packet sniffing as the VLAN header
329 does not exist within the packet.
331 VLAN offloading can be checked by
337 .RB grep " tx-vlan-offload"
340 where <phy_dev> is the physical device to which VLAN device is bound.
343 .BR gvrp " { " on " | " off " } "
344 - specifies whether this VLAN should be registered using GARP VLAN Registration Protocol.
346 .BR mvrp " { " on " | " off " } "
347 - specifies whether this VLAN should be registered using Multiple VLAN Registration Protocol.
349 .BR loose_binding " { " on " | " off " } "
350 - specifies whether the VLAN device state is bound to the physical device state.
352 .BI ingress-qos-map " QOS-MAP "
353 - defines a mapping of VLAN header prio field to the Linux internal packet
354 priority on incoming frames. The format is FROM:TO with multiple mappings
357 .BI egress-qos-map " QOS-MAP "
358 - defines a mapping of Linux internal packet priority to VLAN header prio field
359 but for outgoing frames. The format is the same as for ingress-qos-map.
362 Linux packet priority can be set by
367 -t mangle -A POSTROUTING [...] -j CLASSIFY --set-class 0:4
370 and this "4" priority can be used in the egress qos mapping to set VLAN prio "5":
374 link set veth0.10 type vlan egress 4:5
383 the following additional arguments are supported:
385 .BI "ip link add " DEVICE
386 .BI type " vxlan " id " ID"
389 .RB " ] [ { " group " | " remote " } "
400 .BI srcport " MIN MAX "
414 .I "[no]udp6zerocsumtx "
416 .I "[no]udp6zerocsumrx "
418 .BI ageing " SECONDS "
420 .BI maxaddress " NUMBER "
428 - specifies the VXLAN Network Identifer (or VXLAN Segment
432 - specifies the physical device to use for tunnel endpoint communication.
436 - specifies the multicast IP address to join.
437 This parameter cannot be specified with the
443 - specifies the unicast destination IP address to use in outgoing packets
444 when the destination link layer address is not known in the VXLAN device
445 forwarding database. This parameter cannot be specified with the
451 - specifies the source IP address to use in outgoing packets.
455 - specifies the TTL value to use in outgoing packets.
459 - specifies the TOS value to use in outgoing packets.
463 - specifies the UDP destination port to communicate to the remote VXLAN tunnel endpoint.
466 .BI srcport " MIN MAX"
467 - specifies the range of port numbers to use as UDP
468 source ports to communicate to the remote VXLAN tunnel endpoint.
472 - specifies if unknown source link layer addresses and IP addresses
473 are entered into the VXLAN device forwarding database.
477 - specifies if route short circuit is turned on.
481 - specifies ARP proxy is turned on.
485 - specifies if netlink LLADDR miss notifications are generated.
489 - specifies if netlink IP ADDR miss notifications are generated.
493 - specifies if UDP checksum is filled in
496 .I [no]udp6zerocsumtx
497 - specifies if UDP checksum is filled in
500 .I [no]udp6zerocsumrx
501 - specifies if UDP checksum is received
504 .BI ageing " SECONDS"
505 - specifies the lifetime in seconds of FDB entries learnt by the kernel.
508 .BI maxaddress " NUMBER"
509 - specifies the maximum number of FDB entries.
513 - enables the Group Policy extension (VXLAN-GBP).
516 Allows to transport group policy context across VXLAN network peers.
517 If enabled, includes the mark of a packet in the VXLAN header for outgoing
518 packets and fills the packet mark based on the information found in the
519 VXLAN header for incomming packets.
521 Format of upper 16 bits of packet mark (flags);
524 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
526 |-|-|-|-|-|-|-|-|-|D|-|-|A|-|-|-|
528 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
531 Don't Learn bit. When set, this bit indicates that the egress
532 VTEP MUST NOT learn the source address of the encapsulated frame.
535 Indicates that the group policy has already been applied to
536 this packet. Policies MUST NOT be applied by devices when the A bit is set.
539 Format of lower 16 bits of packet mark (policy ID):
542 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
546 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
550 iptables -A OUTPUT [...] -j MARK --set-mark 0x800FF
557 GRE, IPIP, SIT Type Support
560 the following additional arguments are supported:
562 .BI "ip link add " DEVICE
563 .BR type " { gre | ipip | sit } "
564 .BI " remote " ADDR " local " ADDR
566 .BR encap " { fou | gue | none } "
568 .BI "encap-sport { " PORT " | auto } "
570 .BI "encap-dport " PORT
572 .I " [no]encap-csum "
574 .I " [no]encap-remcsum "
580 - specifies the remote address of the tunnel.
584 - specifies the fixed local address for tunneled packets.
585 It must be an address on another interface on this host.
588 .BR encap " { fou | gue | none } "
589 - specifies type of secondary UDP encapsulation. "fou" indicates
590 Foo-Over-UDP, "gue" indicates Generic UDP Encapsulation.
593 .BI "encap-sport { " PORT " | auto } "
594 - specifies the source port in UDP encapsulation.
596 indicates the port by number, "auto"
597 indicates that the port number should be chosen automatically
598 (the kernel picks a flow based on the flow hash of the
599 encapsulated packet).
603 - specifies if UDP checksums are enabled in the secondary
608 - specifies if Remote Checksum Offload is enabled. This is only
609 applicable for Generic UDP Encapsulation.
614 IP6GRE/IP6GRETAP Type Support
617 the following additional arguments are supported:
619 .BI "ip link add " DEVICE
620 .BI type " { ip6gre | ip6gretap } " remote " ADDR " local " ADDR
630 .BI encaplimit " ELIM "
632 .BI tclass " TCLASS "
634 .BI flowlabel " FLOWLABEL "
644 - specifies the remote IPv6 address of the tunnel.
648 - specifies the fixed local IPv6 address for tunneled packets.
649 It must be an address on another interface on this host.
656 flag enables sequencing of outgoing packets.
659 flag requires that all input packets are serialized.
663 - use keyed GRE with key
665 is either a number or an IPv4 address-like dotted quad.
668 parameter specifies the same key to use in both directions.
670 .BR ikey " and " okey
671 parameters specify different keys for input and output.
675 - generate/require checksums for tunneled packets.
678 flag calculates checksums for outgoing packets.
681 flag requires that all input packets have the correct
684 flag is equivalent to the combination
689 - specifies Hop Limit value to use in outgoing packets.
692 .BI encaplimit " ELIM"
693 - specifies a fixed encapsulation limit. Default is 4.
696 .BI flowlabel " FLOWLABEL"
697 - specifies a fixed flowlabel.
701 - specifies the traffic class field on
702 tunneled packets, which can be specified as either a two-digit
703 hex value (e.g. c0) or a predefined string (e.g. internet).
706 causes the field to be copied from the original IP header. The
708 .BI "inherit/" STRING
710 .BI "inherit/" 00 ".." ff
711 will set the field to
715 when tunneling non-IP packets. The default value is 00.
723 the following additional arguments are supported:
725 .BI "ip link add " DEVICE " name " NAME
726 .BI type " ipoib [ " pkey " PKEY ] [" mode " MODE " ]
731 - specifies the IB P-Key to use.
734 - specifies the mode (datagram or connected) to use.
740 the following additional arguments are supported:
742 .BI "ip link add " DEVICE
743 .BI type " geneve " id " ID " remote " IPADDR"
753 - specifies the Virtual Network Identifer to use.
757 - specifies the unicast destination IP address to use in outgoing packets.
761 - specifies the TTL value to use in outgoing packets.
765 - specifies the TOS value to use in outgoing packets.
769 .SS ip link delete - delete virtual link
773 specifies the virtual device to act operate on.
777 specifies the group of virtual links to delete. Group 0 is not allowed to be
778 deleted since it is the default group.
782 specifies the type of the device.
784 .SS ip link set - change device attributes
789 specifies network device to operate on. When configuring SR-IOV Virtual Function
790 (VF) devices, this keyword should specify the associated Physical Function (PF)
796 has a dual role: If both group and dev are present, then move the device to the
797 specified group. If only a group is specified, then the command operates on
798 all devices in that group.
802 change the state of the device to
808 .BR "arp on " or " arp off"
814 .BR "multicast on " or " multicast off"
820 .BR "dynamic on " or " dynamic off"
823 flag on the device. Indicates that address can change when interface goes down (currently
829 change the name of the device. This operation is not
830 recommended if the device is running or has some addresses
834 .BI txqueuelen " NUMBER"
837 change the transmit queue length of the device.
846 .BI address " LLADDRESS"
847 change the station address of the interface.
850 .BI broadcast " LLADDRESS"
854 .BI peer " LLADDRESS"
855 change the link layer broadcast address or the peer address when
860 .BI netns " NETNSNAME " \fR| " PID"
861 move the device to the network namespace associated with name
865 Some devices are not allowed to change network namespace: loopback, bridge,
866 ppp, wireless. These are network namespace local devices. In such case
868 tool will return "Invalid argument" error. It is possible to find out if device is local
869 to a single network namespace by checking
871 flag in the output of the
879 To change network namespace for wireless devices the
881 tool can be used. But it allows to change network namespace only for physical devices and by process
886 give the device a symbolic name for easy reference.
890 specify the group the device belongs to.
891 The available groups are listed in file
892 .BR "@SYSCONFDIR@/group" .
896 specify a Virtual Function device to be configured. The associated PF device
897 must be specified using the
903 - change the station address for the specified VF. The
905 parameter must be specified.
909 - change the assigned VLAN for the specified VF. When specified, all traffic
910 sent from the VF will be tagged with the specified VLAN ID. Incoming traffic
911 will be filtered for the specified VLAN ID, and will have all VLAN tags
912 stripped before being passed to the VF. Setting this parameter to 0 disables
913 VLAN tagging and filtering. The
915 parameter must be specified.
919 - assign VLAN QOS (priority) bits for the VLAN tag. When specified, all VLAN
920 tags transmitted by the VF will include the specified priority bits in the
921 VLAN tag. If not specified, the value is assumed to be 0. Both the
925 parameters must be specified. Setting both
929 as 0 disables VLAN tagging and filtering for the VF.
933 -- change the allowed transmit bandwidth, in Mbps, for the specified VF.
934 Setting this parameter to 0 disables rate limiting.
936 parameter must be specified.
942 .BI max_tx_rate " TXRATE"
943 - change the allowed maximum transmit bandwidth, in Mbps, for the specified VF.
945 parameter must be specified.
948 .BI min_tx_rate " TXRATE"
949 - change the allowed minimum transmit bandwidth, in Mbps, for the specified VF.
950 Minimum TXRATE should be always <= Maximum TXRATE.
952 parameter must be specified.
955 .BI spoofchk " on|off"
956 - turn packet spoof checking on or off for the specified VF.
958 .BI state " auto|enable|disable"
959 - set the virtual link state as seen by the specified VF. Setting to auto means a
960 reflection of the PF link state, enable lets the VF to communicate with other VFs on
961 this host even if the PF link state is down, disable causes the HW to drop any packets
967 set master device of the device (enslave device).
971 unset master device of the device (release device).
974 .BR "addrgenmode eui64 " or " addrgenmode none"
975 set IPv6 address generation mode
979 set peer netnsid for a cross-netns interface
983 If multiple parameter changes are requested,
985 aborts immediately after any of the changes have failed.
986 This is the only case when
988 can move the system to an unpredictable state. The solution
989 is to avoid changing several parameters with one
993 .SS ip link show - display device attributes
996 .BI dev " NAME " (default)
998 specifies the network device to show.
999 If this argument is omitted all devices in the default group are listed.
1004 specifies what group of devices to show.
1008 only display running interfaces.
1011 .BI master " DEVICE "
1013 specifies the master device which enslaves devices to show.
1018 specifies the type of devices to show.
1021 The show command has additional formatting options:
1025 .BR "\-s" , " \-stats", " \-statistics"
1026 output more statistics about packet usage.
1029 .BR "\-d", " \-details"
1030 output more detailed information.
1033 .BR "\-h", " \-human", " \-human-readable"
1034 output statistics with human readable values number followed by suffix
1038 print human readable rates in IEC units (ie. 1K = 1024).
1041 .SS ip link help - display help
1045 specifies which help of link type to dislpay.
1049 may be a number or a string from the file
1050 .B @SYSCONFDIR@/group
1051 which can be manually filled.
1057 Shows the state of all network interfaces on the system.
1060 ip link show type bridge
1062 Shows the bridge devices.
1065 ip link show type vlan
1067 Shows the vlan devices.
1070 ip link show master br0
1072 Shows devices enslaved by br0
1075 ip link set dev ppp0 mtu 1400
1077 Change the MTU the ppp0 device.
1080 ip link add link eth0 name eth0.10 type vlan id 10
1082 Creates a new vlan device eth0.10 on device eth0.
1085 ip link delete dev eth0.10
1087 Removes vlan device.
1092 Display help for the gre link type.
1095 ip link add name tun1 type ipip remote 192.168.1.1
1096 local 192.168.1.2 ttl 225 encap gue encap-sport auto
1097 encap-dport 5555 encap-csum encap-remcsum
1099 Creates an IPIP that is encapsulated with Generic UDP Encapsulation,
1100 and the outer UDP checksum and remote checksum offload are enabled.
1104 ip link add link wpan0 lowpan0 type lowpan
1106 Creates a 6LoWPAN interface named lowpan0 on the underlying
1107 IEEE 802.15.4 device wpan0.
1118 Original Manpage by Michail Litvak <mci@owl.openwall.com>