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 " } |"
105 .BR protodown " { " on " | " off " } |"
137 .IR VLAN-QOS " ] ] ["
144 .B spoofchk { on | off } ] [
145 .B state { auto | enable | disable}
153 .B addrgenmode { eui64 | none | stable_secret | random }
161 .RI "[ " DEVICE " | "
175 .SS ip link add - add virtual link
179 specifies the physical device to act operate on.
182 specifies the name of the new virtual device.
185 specifies the type of the new device.
191 - Ethernet Bridge device
196 - Controller Area Network interface
199 - Dummy network interface
202 - High-availability Seamless Redundancy device
205 - Intermediate Functional Block device
208 - IP over Infiniband device
211 - Virtual interface base on link layer address (MAC)
214 - Virtual interface based on link layer address (MAC) and TAP.
217 - Virtual Controller Area Network interface
220 - Virtual ethernet interface
223 - 802.1q tagged virtual LAN interface
226 - Virtual eXtended LAN
229 - Virtual tunnel interface IPv4|IPv6 over IPv6
232 - Virtual tunnel interface IPv4 over IPv4
235 - Virtual tunnel interface IPv6 over IPv4
238 - Virtual tunnel interface GRE over IPv4
241 - Virtual L2 tunnel interface GRE over IPv4
244 - Virtual tunnel interface GRE over IPv6
247 - Virtual L2 tunnel interface GRE over IPv6
250 - Virtual tunnel interface
253 - Netlink monitoring device
256 - Interface for L3 (IPv6/IPv4) based VLANs
259 - Interface for 6LoWPAN (IPv6) over IEEE 802.15.4 / Bluetooth
262 - GEneric NEtwork Virtualization Encapsulation
266 .BI numtxqueues " QUEUE_COUNT "
267 specifies the number of transmit queues for new device.
270 .BI numrxqueues " QUEUE_COUNT "
271 specifies the number of receive queues for new device.
275 specifies the desired index of the new virtual device. The link creation fails, if the index is busy.
281 the following additional arguments are supported:
288 .BI protocol " VLAN_PROTO "
292 .BR reorder_hdr " { " on " | " off " } "
295 .BR gvrp " { " on " | " off " } "
298 .BR mvrp " { " on " | " off " } "
301 .BR loose_binding " { " on " | " off " } "
304 .BI ingress-qos-map " QOS-MAP "
307 .BI egress-qos-map " QOS-MAP "
312 .BI protocol " VLAN_PROTO "
313 - either 802.1Q or 802.1ad.
316 - specifies the VLAN Identifer to use. Note that numbers with a leading " 0 " or " 0x " are interpreted as octal or hexadeimal, respectively.
318 .BR reorder_hdr " { " on " | " off " } "
319 - specifies whether ethernet headers are reordered or not (default is
324 .BR reorder_hdr " is " on
325 then VLAN header will be not inserted immediately but only before passing to the
326 physical device (if this device does not support VLAN offloading), the similar
327 on the RX direction - by default the packet will be untagged before being
328 received by VLAN device. Reordering allows to accelerate tagging on egress and
329 to hide VLAN header on ingress so the packet looks like regular Ethernet packet,
330 at the same time it might be confusing for packet capture as the VLAN header
331 does not exist within the packet.
333 VLAN offloading can be checked by
339 .RB grep " tx-vlan-offload"
342 where <phy_dev> is the physical device to which VLAN device is bound.
345 .BR gvrp " { " on " | " off " } "
346 - specifies whether this VLAN should be registered using GARP VLAN Registration Protocol.
348 .BR mvrp " { " on " | " off " } "
349 - specifies whether this VLAN should be registered using Multiple VLAN Registration Protocol.
351 .BR loose_binding " { " on " | " off " } "
352 - specifies whether the VLAN device state is bound to the physical device state.
354 .BI ingress-qos-map " QOS-MAP "
355 - defines a mapping of VLAN header prio field to the Linux internal packet
356 priority on incoming frames. The format is FROM:TO with multiple mappings
359 .BI egress-qos-map " QOS-MAP "
360 - defines a mapping of Linux internal packet priority to VLAN header prio field
361 but for outgoing frames. The format is the same as for ingress-qos-map.
364 Linux packet priority can be set by
369 -t mangle -A POSTROUTING [...] -j CLASSIFY --set-class 0:4
372 and this "4" priority can be used in the egress qos mapping to set VLAN prio "5":
376 link set veth0.10 type vlan egress 4:5
385 the following additional arguments are supported:
387 .BI "ip link add " DEVICE
388 .BI type " vxlan " id " ID"
391 .RB " ] [ { " group " | " remote " } "
395 .RI "{ "IPADDR " | "any " } "
403 .BI srcport " MIN MAX "
417 .I "[no]udp6zerocsumtx "
419 .I "[no]udp6zerocsumrx "
421 .BI ageing " SECONDS "
423 .BI maxaddress " NUMBER "
431 - specifies the VXLAN Network Identifer (or VXLAN Segment
435 - specifies the physical device to use for tunnel endpoint communication.
439 - specifies the multicast IP address to join.
440 This parameter cannot be specified with the
446 - specifies the unicast destination IP address to use in outgoing packets
447 when the destination link layer address is not known in the VXLAN device
448 forwarding database. This parameter cannot be specified with the
454 - specifies the source IP address to use in outgoing packets.
458 - specifies the TTL value to use in outgoing packets.
462 - specifies the TOS value to use in outgoing packets.
466 - specifies the UDP destination port to communicate to the remote VXLAN tunnel endpoint.
469 .BI srcport " MIN MAX"
470 - specifies the range of port numbers to use as UDP
471 source ports to communicate to the remote VXLAN tunnel endpoint.
475 - specifies if unknown source link layer addresses and IP addresses
476 are entered into the VXLAN device forwarding database.
480 - specifies if route short circuit is turned on.
484 - specifies ARP proxy is turned on.
488 - specifies if netlink LLADDR miss notifications are generated.
492 - specifies if netlink IP ADDR miss notifications are generated.
496 - specifies if UDP checksum is filled in
499 .I [no]udp6zerocsumtx
500 - specifies if UDP checksum is filled in
503 .I [no]udp6zerocsumrx
504 - specifies if UDP checksum is received
507 .BI ageing " SECONDS"
508 - specifies the lifetime in seconds of FDB entries learnt by the kernel.
511 .BI maxaddress " NUMBER"
512 - specifies the maximum number of FDB entries.
516 - enables the Group Policy extension (VXLAN-GBP).
519 Allows to transport group policy context across VXLAN network peers.
520 If enabled, includes the mark of a packet in the VXLAN header for outgoing
521 packets and fills the packet mark based on the information found in the
522 VXLAN header for incomming packets.
524 Format of upper 16 bits of packet mark (flags);
527 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
529 |-|-|-|-|-|-|-|-|-|D|-|-|A|-|-|-|
531 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
534 Don't Learn bit. When set, this bit indicates that the egress
535 VTEP MUST NOT learn the source address of the encapsulated frame.
538 Indicates that the group policy has already been applied to
539 this packet. Policies MUST NOT be applied by devices when the A bit is set.
542 Format of lower 16 bits of packet mark (policy ID):
545 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
549 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
553 iptables -A OUTPUT [...] -j MARK --set-mark 0x800FF
560 GRE, IPIP, SIT Type Support
563 the following additional arguments are supported:
565 .BI "ip link add " DEVICE
566 .BR type " { gre | ipip | sit } "
567 .BI " remote " ADDR " local " ADDR
569 .BR encap " { fou | gue | none } "
571 .BI "encap-sport { " PORT " | auto } "
573 .BI "encap-dport " PORT
575 .I " [no]encap-csum "
577 .I " [no]encap-remcsum "
583 - specifies the remote address of the tunnel.
587 - specifies the fixed local address for tunneled packets.
588 It must be an address on another interface on this host.
591 .BR encap " { fou | gue | none } "
592 - specifies type of secondary UDP encapsulation. "fou" indicates
593 Foo-Over-UDP, "gue" indicates Generic UDP Encapsulation.
596 .BI "encap-sport { " PORT " | auto } "
597 - specifies the source port in UDP encapsulation.
599 indicates the port by number, "auto"
600 indicates that the port number should be chosen automatically
601 (the kernel picks a flow based on the flow hash of the
602 encapsulated packet).
606 - specifies if UDP checksums are enabled in the secondary
611 - specifies if Remote Checksum Offload is enabled. This is only
612 applicable for Generic UDP Encapsulation.
617 IP6GRE/IP6GRETAP Type Support
620 the following additional arguments are supported:
622 .BI "ip link add " DEVICE
623 .BI type " { ip6gre | ip6gretap } " remote " ADDR " local " ADDR
633 .BI encaplimit " ELIM "
635 .BI tclass " TCLASS "
637 .BI flowlabel " FLOWLABEL "
647 - specifies the remote IPv6 address of the tunnel.
651 - specifies the fixed local IPv6 address for tunneled packets.
652 It must be an address on another interface on this host.
659 flag enables sequencing of outgoing packets.
662 flag requires that all input packets are serialized.
666 - use keyed GRE with key
668 is either a number or an IPv4 address-like dotted quad.
671 parameter specifies the same key to use in both directions.
673 .BR ikey " and " okey
674 parameters specify different keys for input and output.
678 - generate/require checksums for tunneled packets.
681 flag calculates checksums for outgoing packets.
684 flag requires that all input packets have the correct
687 flag is equivalent to the combination
692 - specifies Hop Limit value to use in outgoing packets.
695 .BI encaplimit " ELIM"
696 - specifies a fixed encapsulation limit. Default is 4.
699 .BI flowlabel " FLOWLABEL"
700 - specifies a fixed flowlabel.
704 - specifies the traffic class field on
705 tunneled packets, which can be specified as either a two-digit
706 hex value (e.g. c0) or a predefined string (e.g. internet).
709 causes the field to be copied from the original IP header. The
711 .BI "inherit/" STRING
713 .BI "inherit/" 00 ".." ff
714 will set the field to
718 when tunneling non-IP packets. The default value is 00.
726 the following additional arguments are supported:
728 .BI "ip link add " DEVICE " name " NAME
729 .BI type " ipoib [ " pkey " PKEY ] [" mode " MODE " ]
734 - specifies the IB P-Key to use.
737 - specifies the mode (datagram or connected) to use.
743 the following additional arguments are supported:
745 .BI "ip link add " DEVICE
746 .BI type " geneve " id " ID " remote " IPADDR"
756 - specifies the Virtual Network Identifer to use.
760 - specifies the unicast destination IP address to use in outgoing packets.
764 - specifies the TTL value to use in outgoing packets.
768 - specifies the TOS value to use in outgoing packets.
773 MACVLAN and MACVTAP Type Support
778 the following additional arguments are supported:
780 .BI "ip link add link " DEVICE " name " NAME
781 .BR type " { " macvlan " | " macvtap " } "
782 .BR mode " { " private " | " vepa " | " bridge " | " passthru
783 .BR " [ " nopromisc " ] } "
787 .BR type " { " macvlan " | " macvtap " } "
788 - specifies the link type to use.
789 .BR macvlan " creates just a virtual interface, while "
790 .BR macvtap " in addition creates a character device "
791 .BR /dev/tapX " to be used just like a " tuntap " device."
794 - Do not allow communication between
796 instances on the same physical interface, even if the external switch supports
800 - Virtual Ethernet Port Aggregator mode. Data from one
802 instance to the other on the same physical interface is transmitted over the
803 physical interface. Either the attached switch needs to support hairpin mode,
804 or there must be a TCP/IP router forwarding the packets in order to allow
805 communication. This is the default mode.
808 - In bridge mode, all endpoints are directly connected to each other,
809 communication is not redirected through the physical interface's peer.
811 .BR mode " " passthru " [ " nopromisc " ] "
812 - This mode gives more power to a single endpoint, usually in
813 .BR macvtap " mode. It is not allowed for more than one endpoint on the same "
814 physical interface. All traffic will be forwarded to this endpoint, allowing
815 virtio guests to change MAC address or set promiscuous mode in order to bridge
816 the interface or create vlan interfaces on top of it. By default, this mode
817 forces the underlying interface into promiscuous mode. Passing the
818 .BR nopromisc " flag prevents this, so the promisc flag may be controlled "
819 using standard tools.
822 .SS ip link delete - delete virtual link
826 specifies the virtual device to act operate on.
830 specifies the group of virtual links to delete. Group 0 is not allowed to be
831 deleted since it is the default group.
835 specifies the type of the device.
837 .SS ip link set - change device attributes
842 specifies network device to operate on. When configuring SR-IOV Virtual Function
843 (VF) devices, this keyword should specify the associated Physical Function (PF)
849 has a dual role: If both group and dev are present, then move the device to the
850 specified group. If only a group is specified, then the command operates on
851 all devices in that group.
855 change the state of the device to
861 .BR "arp on " or " arp off"
867 .BR "multicast on " or " multicast off"
873 .BR "protodown on " or " protodown off"
876 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.
879 .BR "dynamic on " or " dynamic off"
882 flag on the device. Indicates that address can change when interface goes down (currently
888 change the name of the device. This operation is not
889 recommended if the device is running or has some addresses
893 .BI txqueuelen " NUMBER"
896 change the transmit queue length of the device.
905 .BI address " LLADDRESS"
906 change the station address of the interface.
909 .BI broadcast " LLADDRESS"
913 .BI peer " LLADDRESS"
914 change the link layer broadcast address or the peer address when
919 .BI netns " NETNSNAME " \fR| " PID"
920 move the device to the network namespace associated with name
924 Some devices are not allowed to change network namespace: loopback, bridge,
925 ppp, wireless. These are network namespace local devices. In such case
927 tool will return "Invalid argument" error. It is possible to find out if device is local
928 to a single network namespace by checking
930 flag in the output of the
938 To change network namespace for wireless devices the
940 tool can be used. But it allows to change network namespace only for physical devices and by process
945 give the device a symbolic name for easy reference.
949 specify the group the device belongs to.
950 The available groups are listed in file
951 .BR "@SYSCONFDIR@/group" .
955 specify a Virtual Function device to be configured. The associated PF device
956 must be specified using the
962 - change the station address for the specified VF. The
964 parameter must be specified.
968 - change the assigned VLAN for the specified VF. When specified, all traffic
969 sent from the VF will be tagged with the specified VLAN ID. Incoming traffic
970 will be filtered for the specified VLAN ID, and will have all VLAN tags
971 stripped before being passed to the VF. Setting this parameter to 0 disables
972 VLAN tagging and filtering. The
974 parameter must be specified.
978 - assign VLAN QOS (priority) bits for the VLAN tag. When specified, all VLAN
979 tags transmitted by the VF will include the specified priority bits in the
980 VLAN tag. If not specified, the value is assumed to be 0. Both the
984 parameters must be specified. Setting both
988 as 0 disables VLAN tagging and filtering for the VF.
992 -- change the allowed transmit bandwidth, in Mbps, for the specified VF.
993 Setting this parameter to 0 disables rate limiting.
995 parameter must be specified.
1001 .BI max_tx_rate " TXRATE"
1002 - change the allowed maximum transmit bandwidth, in Mbps, for the specified VF.
1004 parameter must be specified.
1007 .BI min_tx_rate " TXRATE"
1008 - change the allowed minimum transmit bandwidth, in Mbps, for the specified VF.
1009 Minimum TXRATE should be always <= Maximum TXRATE.
1011 parameter must be specified.
1014 .BI spoofchk " on|off"
1015 - turn packet spoof checking on or off for the specified VF.
1017 .BI state " auto|enable|disable"
1018 - set the virtual link state as seen by the specified VF. Setting to auto means a
1019 reflection of the PF link state, enable lets the VF to communicate with other VFs on
1020 this host even if the PF link state is down, disable causes the HW to drop any packets
1025 .BI master " DEVICE"
1026 set master device of the device (enslave device).
1030 unset master device of the device (release device).
1033 .BI addrgenmode " eui64|none|stable_secret|random"
1034 set the IPv6 address generation mode
1037 - use a Modified EUI-64 format interface identifier
1040 - disable automatic address generation
1043 - generate the interface identifier based on a preset /proc/sys/net/ipv6/conf/{default,DEVICE}/stable_secret
1046 - like stable_secret, but auto-generate a new random secret if none is set
1050 set peer netnsid for a cross-netns interface
1054 If multiple parameter changes are requested,
1056 aborts immediately after any of the changes have failed.
1057 This is the only case when
1059 can move the system to an unpredictable state. The solution
1060 is to avoid changing several parameters with one
1064 .SS ip link show - display device attributes
1067 .BI dev " NAME " (default)
1069 specifies the network device to show.
1070 If this argument is omitted all devices in the default group are listed.
1075 specifies what group of devices to show.
1079 only display running interfaces.
1082 .BI master " DEVICE "
1084 specifies the master device which enslaves devices to show.
1089 specifies the type of devices to show.
1092 The show command has additional formatting options:
1096 .BR "\-s" , " \-stats", " \-statistics"
1097 output more statistics about packet usage.
1100 .BR "\-d", " \-details"
1101 output more detailed information.
1104 .BR "\-h", " \-human", " \-human-readable"
1105 output statistics with human readable values number followed by suffix
1109 print human readable rates in IEC units (ie. 1K = 1024).
1112 .SS ip link help - display help
1116 specifies which help of link type to dislpay.
1120 may be a number or a string from the file
1121 .B @SYSCONFDIR@/group
1122 which can be manually filled.
1128 Shows the state of all network interfaces on the system.
1131 ip link show type bridge
1133 Shows the bridge devices.
1136 ip link show type vlan
1138 Shows the vlan devices.
1141 ip link show master br0
1143 Shows devices enslaved by br0
1146 ip link set dev ppp0 mtu 1400
1148 Change the MTU the ppp0 device.
1151 ip link add link eth0 name eth0.10 type vlan id 10
1153 Creates a new vlan device eth0.10 on device eth0.
1156 ip link delete dev eth0.10
1158 Removes vlan device.
1163 Display help for the gre link type.
1166 ip link add name tun1 type ipip remote 192.168.1.1
1167 local 192.168.1.2 ttl 225 encap gue encap-sport auto
1168 encap-dport 5555 encap-csum encap-remcsum
1170 Creates an IPIP that is encapsulated with Generic UDP Encapsulation,
1171 and the outer UDP checksum and remote checksum offload are enabled.
1175 ip link add link wpan0 lowpan0 type lowpan
1177 Creates a 6LoWPAN interface named lowpan0 on the underlying
1178 IEEE 802.15.4 device wpan0.
1189 Original Manpage by Michail Litvak <mci@owl.openwall.com>