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 }
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 " } "
402 .BI srcport " MIN MAX "
416 .I "[no]udp6zerocsumtx "
418 .I "[no]udp6zerocsumrx "
420 .BI ageing " SECONDS "
422 .BI maxaddress " NUMBER "
430 - specifies the VXLAN Network Identifer (or VXLAN Segment
434 - specifies the physical device to use for tunnel endpoint communication.
438 - specifies the multicast IP address to join.
439 This parameter cannot be specified with the
445 - specifies the unicast destination IP address to use in outgoing packets
446 when the destination link layer address is not known in the VXLAN device
447 forwarding database. This parameter cannot be specified with the
453 - specifies the source IP address to use in outgoing packets.
457 - specifies the TTL value to use in outgoing packets.
461 - specifies the TOS value to use in outgoing packets.
465 - specifies the UDP destination port to communicate to the remote VXLAN tunnel endpoint.
468 .BI srcport " MIN MAX"
469 - specifies the range of port numbers to use as UDP
470 source ports to communicate to the remote VXLAN tunnel endpoint.
474 - specifies if unknown source link layer addresses and IP addresses
475 are entered into the VXLAN device forwarding database.
479 - specifies if route short circuit is turned on.
483 - specifies ARP proxy is turned on.
487 - specifies if netlink LLADDR miss notifications are generated.
491 - specifies if netlink IP ADDR miss notifications are generated.
495 - specifies if UDP checksum is filled in
498 .I [no]udp6zerocsumtx
499 - specifies if UDP checksum is filled in
502 .I [no]udp6zerocsumrx
503 - specifies if UDP checksum is received
506 .BI ageing " SECONDS"
507 - specifies the lifetime in seconds of FDB entries learnt by the kernel.
510 .BI maxaddress " NUMBER"
511 - specifies the maximum number of FDB entries.
515 - enables the Group Policy extension (VXLAN-GBP).
518 Allows to transport group policy context across VXLAN network peers.
519 If enabled, includes the mark of a packet in the VXLAN header for outgoing
520 packets and fills the packet mark based on the information found in the
521 VXLAN header for incomming packets.
523 Format of upper 16 bits of packet mark (flags);
526 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
528 |-|-|-|-|-|-|-|-|-|D|-|-|A|-|-|-|
530 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
533 Don't Learn bit. When set, this bit indicates that the egress
534 VTEP MUST NOT learn the source address of the encapsulated frame.
537 Indicates that the group policy has already been applied to
538 this packet. Policies MUST NOT be applied by devices when the A bit is set.
541 Format of lower 16 bits of packet mark (policy ID):
544 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
548 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
552 iptables -A OUTPUT [...] -j MARK --set-mark 0x800FF
559 GRE, IPIP, SIT Type Support
562 the following additional arguments are supported:
564 .BI "ip link add " DEVICE
565 .BR type " { gre | ipip | sit } "
566 .BI " remote " ADDR " local " ADDR
568 .BR encap " { fou | gue | none } "
570 .BI "encap-sport { " PORT " | auto } "
572 .BI "encap-dport " PORT
574 .I " [no]encap-csum "
576 .I " [no]encap-remcsum "
582 - specifies the remote address of the tunnel.
586 - specifies the fixed local address for tunneled packets.
587 It must be an address on another interface on this host.
590 .BR encap " { fou | gue | none } "
591 - specifies type of secondary UDP encapsulation. "fou" indicates
592 Foo-Over-UDP, "gue" indicates Generic UDP Encapsulation.
595 .BI "encap-sport { " PORT " | auto } "
596 - specifies the source port in UDP encapsulation.
598 indicates the port by number, "auto"
599 indicates that the port number should be chosen automatically
600 (the kernel picks a flow based on the flow hash of the
601 encapsulated packet).
605 - specifies if UDP checksums are enabled in the secondary
610 - specifies if Remote Checksum Offload is enabled. This is only
611 applicable for Generic UDP Encapsulation.
616 IP6GRE/IP6GRETAP Type Support
619 the following additional arguments are supported:
621 .BI "ip link add " DEVICE
622 .BI type " { ip6gre | ip6gretap } " remote " ADDR " local " ADDR
632 .BI encaplimit " ELIM "
634 .BI tclass " TCLASS "
636 .BI flowlabel " FLOWLABEL "
646 - specifies the remote IPv6 address of the tunnel.
650 - specifies the fixed local IPv6 address for tunneled packets.
651 It must be an address on another interface on this host.
658 flag enables sequencing of outgoing packets.
661 flag requires that all input packets are serialized.
665 - use keyed GRE with key
667 is either a number or an IPv4 address-like dotted quad.
670 parameter specifies the same key to use in both directions.
672 .BR ikey " and " okey
673 parameters specify different keys for input and output.
677 - generate/require checksums for tunneled packets.
680 flag calculates checksums for outgoing packets.
683 flag requires that all input packets have the correct
686 flag is equivalent to the combination
691 - specifies Hop Limit value to use in outgoing packets.
694 .BI encaplimit " ELIM"
695 - specifies a fixed encapsulation limit. Default is 4.
698 .BI flowlabel " FLOWLABEL"
699 - specifies a fixed flowlabel.
703 - specifies the traffic class field on
704 tunneled packets, which can be specified as either a two-digit
705 hex value (e.g. c0) or a predefined string (e.g. internet).
708 causes the field to be copied from the original IP header. The
710 .BI "inherit/" STRING
712 .BI "inherit/" 00 ".." ff
713 will set the field to
717 when tunneling non-IP packets. The default value is 00.
725 the following additional arguments are supported:
727 .BI "ip link add " DEVICE " name " NAME
728 .BI type " ipoib [ " pkey " PKEY ] [" mode " MODE " ]
733 - specifies the IB P-Key to use.
736 - specifies the mode (datagram or connected) to use.
742 the following additional arguments are supported:
744 .BI "ip link add " DEVICE
745 .BI type " geneve " id " ID " remote " IPADDR"
755 - specifies the Virtual Network Identifer to use.
759 - specifies the unicast destination IP address to use in outgoing packets.
763 - specifies the TTL value to use in outgoing packets.
767 - specifies the TOS value to use in outgoing packets.
772 MACVLAN and MACVTAP Type Support
777 the following additional arguments are supported:
779 .BI "ip link add link " DEVICE " name " NAME
780 .BR type " { " macvlan " | " macvtap " } "
781 .BR mode " { " private " | " vepa " | " bridge " | " passthru
782 .BR " [ " nopromisc " ] } "
786 .BR type " { " macvlan " | " macvtap " } "
787 - specifies the link type to use.
788 .BR macvlan " creates just a virtual interface, while "
789 .BR macvtap " in addition creates a character device "
790 .BR /dev/tapX " to be used just like a " tuntap " device."
793 - Do not allow communication between
795 instances on the same physical interface, even if the external switch supports
799 - Virtual Ethernet Port Aggregator mode. Data from one
801 instance to the other on the same physical interface is transmitted over the
802 physical interface. Either the attached switch needs to support hairpin mode,
803 or there must be a TCP/IP router forwarding the packets in order to allow
804 communication. This is the default mode.
807 - In bridge mode, all endpoints are directly connected to each other,
808 communication is not redirected through the physical interface's peer.
810 .BR mode " " passthru " [ " nopromisc " ] "
811 - This mode gives more power to a single endpoint, usually in
812 .BR macvtap " mode. It is not allowed for more than one endpoint on the same "
813 physical interface. All traffic will be forwarded to this endpoint, allowing
814 virtio guests to change MAC address or set promiscuous mode in order to bridge
815 the interface or create vlan interfaces on top of it. By default, this mode
816 forces the underlying interface into promiscuous mode. Passing the
817 .BR nopromisc " flag prevents this, so the promisc flag may be controlled "
818 using standard tools.
821 .SS ip link delete - delete virtual link
825 specifies the virtual device to act operate on.
829 specifies the group of virtual links to delete. Group 0 is not allowed to be
830 deleted since it is the default group.
834 specifies the type of the device.
836 .SS ip link set - change device attributes
841 specifies network device to operate on. When configuring SR-IOV Virtual Function
842 (VF) devices, this keyword should specify the associated Physical Function (PF)
848 has a dual role: If both group and dev are present, then move the device to the
849 specified group. If only a group is specified, then the command operates on
850 all devices in that group.
854 change the state of the device to
860 .BR "arp on " or " arp off"
866 .BR "multicast on " or " multicast off"
872 .BR "protodown on " or " protodown off"
875 state on the device. Indicates that a protocol error has been detected on the port. Switch drivers can react to this error by doing a phys down on the switch port.
878 .BR "dynamic on " or " dynamic off"
881 flag on the device. Indicates that address can change when interface goes down (currently
887 change the name of the device. This operation is not
888 recommended if the device is running or has some addresses
892 .BI txqueuelen " NUMBER"
895 change the transmit queue length of the device.
904 .BI address " LLADDRESS"
905 change the station address of the interface.
908 .BI broadcast " LLADDRESS"
912 .BI peer " LLADDRESS"
913 change the link layer broadcast address or the peer address when
918 .BI netns " NETNSNAME " \fR| " PID"
919 move the device to the network namespace associated with name
923 Some devices are not allowed to change network namespace: loopback, bridge,
924 ppp, wireless. These are network namespace local devices. In such case
926 tool will return "Invalid argument" error. It is possible to find out if device is local
927 to a single network namespace by checking
929 flag in the output of the
937 To change network namespace for wireless devices the
939 tool can be used. But it allows to change network namespace only for physical devices and by process
944 give the device a symbolic name for easy reference.
948 specify the group the device belongs to.
949 The available groups are listed in file
950 .BR "@SYSCONFDIR@/group" .
954 specify a Virtual Function device to be configured. The associated PF device
955 must be specified using the
961 - change the station address for the specified VF. The
963 parameter must be specified.
967 - change the assigned VLAN for the specified VF. When specified, all traffic
968 sent from the VF will be tagged with the specified VLAN ID. Incoming traffic
969 will be filtered for the specified VLAN ID, and will have all VLAN tags
970 stripped before being passed to the VF. Setting this parameter to 0 disables
971 VLAN tagging and filtering. The
973 parameter must be specified.
977 - assign VLAN QOS (priority) bits for the VLAN tag. When specified, all VLAN
978 tags transmitted by the VF will include the specified priority bits in the
979 VLAN tag. If not specified, the value is assumed to be 0. Both the
983 parameters must be specified. Setting both
987 as 0 disables VLAN tagging and filtering for the VF.
991 -- change the allowed transmit bandwidth, in Mbps, for the specified VF.
992 Setting this parameter to 0 disables rate limiting.
994 parameter must be specified.
1000 .BI max_tx_rate " TXRATE"
1001 - change the allowed maximum transmit bandwidth, in Mbps, for the specified VF.
1003 parameter must be specified.
1006 .BI min_tx_rate " TXRATE"
1007 - change the allowed minimum transmit bandwidth, in Mbps, for the specified VF.
1008 Minimum TXRATE should be always <= Maximum TXRATE.
1010 parameter must be specified.
1013 .BI spoofchk " on|off"
1014 - turn packet spoof checking on or off for the specified VF.
1016 .BI state " auto|enable|disable"
1017 - set the virtual link state as seen by the specified VF. Setting to auto means a
1018 reflection of the PF link state, enable lets the VF to communicate with other VFs on
1019 this host even if the PF link state is down, disable causes the HW to drop any packets
1024 .BI master " DEVICE"
1025 set master device of the device (enslave device).
1029 unset master device of the device (release device).
1032 .BR "addrgenmode eui64 " or " addrgenmode none"
1033 set IPv6 address generation mode
1037 set peer netnsid for a cross-netns interface
1041 If multiple parameter changes are requested,
1043 aborts immediately after any of the changes have failed.
1044 This is the only case when
1046 can move the system to an unpredictable state. The solution
1047 is to avoid changing several parameters with one
1051 .SS ip link show - display device attributes
1054 .BI dev " NAME " (default)
1056 specifies the network device to show.
1057 If this argument is omitted all devices in the default group are listed.
1062 specifies what group of devices to show.
1066 only display running interfaces.
1069 .BI master " DEVICE "
1071 specifies the master device which enslaves devices to show.
1076 specifies the type of devices to show.
1079 The show command has additional formatting options:
1083 .BR "\-s" , " \-stats", " \-statistics"
1084 output more statistics about packet usage.
1087 .BR "\-d", " \-details"
1088 output more detailed information.
1091 .BR "\-h", " \-human", " \-human-readable"
1092 output statistics with human readable values number followed by suffix
1096 print human readable rates in IEC units (ie. 1K = 1024).
1099 .SS ip link help - display help
1103 specifies which help of link type to dislpay.
1107 may be a number or a string from the file
1108 .B @SYSCONFDIR@/group
1109 which can be manually filled.
1115 Shows the state of all network interfaces on the system.
1118 ip link show type bridge
1120 Shows the bridge devices.
1123 ip link show type vlan
1125 Shows the vlan devices.
1128 ip link show master br0
1130 Shows devices enslaved by br0
1133 ip link set dev ppp0 mtu 1400
1135 Change the MTU the ppp0 device.
1138 ip link add link eth0 name eth0.10 type vlan id 10
1140 Creates a new vlan device eth0.10 on device eth0.
1143 ip link delete dev eth0.10
1145 Removes vlan device.
1150 Display help for the gre link type.
1153 ip link add name tun1 type ipip remote 192.168.1.1
1154 local 192.168.1.2 ttl 225 encap gue encap-sport auto
1155 encap-dport 5555 encap-csum encap-remcsum
1157 Creates an IPIP that is encapsulated with Generic UDP Encapsulation,
1158 and the outer UDP checksum and remote checksum offload are enabled.
1162 ip link add link wpan0 lowpan0 type lowpan
1164 Creates a 6LoWPAN interface named lowpan0 on the underlying
1165 IEEE 802.15.4 device wpan0.
1176 Original Manpage by Michail Litvak <mci@owl.openwall.com>