NAME
ip-link - network device configuration
SYNOPSIS
ip [ OPTIONS ] link { COMMAND | help } OPTIONS := { -V[ersion] | -h[uman-readable] | -s[tatistics] | -r[esolve] | -f[amily] { inet | inet6 | ipx | dnet | link } | -o[neline] | -br[ief] } ip link add [ link DEVICE ] [ name ] NAME [ txqueuelen PACKETS ] [ address LLADDR ] [ broadcast LLADDR ] [ mtu MTU ] [ index IDX ] [ numtxqueues QUEUE_COUNT ] [ numrxqueues QUEUE_COUNT ] type TYPE [ ARGS ] TYPE := [ bridge | bond | can | dummy | hsr | ifb | ipoib | macvlan | macvtap | vcan | veth | vlan | vxlan | ip6tnl | ipip | sit | gre | gretap | ip6gre | ip6gretap | vti | nlmon | ipvlan | lowpan | geneve ] ip link delete { DEVICE | group GROUP } type TYPE [ ARGS ] ip link set { DEVICE | group GROUP } { up | down | arp { on | off } | promisc { on | off } | allmulticast { on | off } | dynamic { on | off } | multicast { on | off } | protodown { ] [ max_tx_rate TXRATE ] [ min_tx_rate TXRATE ] [ spoofchk { on | off } ] [ state { auto | enable | disable} ] | master DEVICE | nomaster | addrgenmode { eui64 | none } link-netnsid ID } ip link show [ DEVICE | group GROUP | up | master DEVICE | type TYPE ] ip link help [ TYPE ]
DESCRIPTION
ip link add - add virtual link link DEVICE specifies the physical device to act operate on. NAME specifies the name of the new virtual device. TYPE specifies the type of the new device. Link types: bridge - Ethernet Bridge device bond - Bonding device can - Controller Area Network interface dummy - Dummy network interface hsr - High-availability Seamless Redundancy device ifb - Intermediate Functional Block device ipoib - IP over Infiniband device macvlan - Virtual interface base on link layer address (MAC) macvtap - Virtual interface based on link layer address (MAC) and TAP. vcan - Virtual Controller Area Network tunnel interface GRE over IPv4 ip6gre - Virtual tunnel interface GRE over IPv6 ip6gretap - Virtual L2 tunnel interface GRE over IPv6 vti - Virtual tunnel interface nlmon - Netlink monitoring device ipvlan - Interface for L3 (IPv6/IPv4) based VLANs lowpan - Interface for 6LoWPAN (IPv6) over IEEE 802.15.4 / Bluetooth geneve - GEneric NEtwork Virtualization Encapsulation numtxqueues QUEUE_COUNT specifies the number of transmit queues for new device. numrxqueues QUEUE_COUNT specifies the number of receive queues for new device. index IDX specifies the desired index of the new virtual device. The link creation fails, if the index is busy. VLAN Type Support For a link of type VLAN the following additional arguments are supported: ip link add link DEVICE name NAME type vlan [ protocol VLAN_PROTO ] id VLANID [ reorder_hdr { on | off } ] [ gvrp { on | off } ] [ mvrp { on | off } ] [ loose_binding { on | off } ] [ ingress-qos-map QOS-MAP ] [ egress-qos-map QOS-MAP ] protocol VLAN_PROTO - either 802.1Q or 802.1ad. id VLANID - specifies the VLAN Identifer to use. Note that numbers with a leading " 0 " or " 0x " are interpreted as octal or hexadeimal, respectively. reorder_hdr { on | off } - specifies whether ethernet headers are reordered or not (default is on). If reorder_hdr is on then VLAN header will be not inserted immediately but only before passing to the physical device (if this device does not support VLAN offloading), the similar on the RX direction - by default the packet will be untagged before being received by VLAN device. Reordering allows to accelerate tagging on egress and to hide VLAN header on ingress so the packet looks like regular Ethernet packet, at the same time it might be confusing for packet capture as the VLAN header does not exist within the packet. VLAN offloading can be checked by ethtool(8): ethtool -k <phy_dev> | grep tx-vlan-offload where <phy_dev> is the physical device to which VLAN device is bound. of VLAN header prio field to the Linux internal packet priority on incoming frames. The format is FROM:TO with multiple mappings separated by spaces. egress-qos-map QOS-MAP - defines a mapping of Linux internal packet priority to VLAN header prio field but for outgoing frames. The format is the same as for ingress-qos-map. Linux packet priority can be set by iptables(8): iptables -t mangle -A POSTROUTING [...] -j CLASSIFY --set-class 0:4 and this "4" priority can be used in the egress qos mapping to set VLAN prio "5": ip link set veth0.10 type vlan egress 4:5 VXLAN Type Support For a link of type VXLAN the following additional arguments are supported: ip link add DEVICE type vxlan id ID [ dev PHYS_DEV ] [ { group | remote } IPADDR ] [ local IPADDR ] [ ]. dstport PORT - specifies the UDP destination port to communicate to the remote VXLAN tunnel endpoint. srcport. [no]udpcsum - specifies if UDP checksum is filled in [no]udp6zerocsumtx - specifies if UDP checksum is filled in [no]udp6zerocsumrx - specifies if UDP checksum is received ageing SECONDS - specifies the lifetime in seconds of FDB entries learnt by the kernel. maxaddress NUMBER - specifies the maximum number of FDB entries. gbp - enables the Group Policy extension (VXLAN-GBP). Allows to transport group policy context across VXLAN network peers. If enabled, includes the mark of a packet in the VXLAN header for outgoing packets and fills the packet mark based on the information found in the VXLAN header for incomming packets. Format of upper 16 bits of packet mark (flags); +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |-|-|-|-|-|-|-|-|-|D|-|-|A|-|-|-| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ arguments are supported: ip link add DEVICE type { gre | ipip | sit } remote ADDR local ADDR [ encap { fou | gue | none } ] [ encap-sport { PORT | auto } ] [ encap-dport PORT ] [ [no]encap-csum ] [ [no]encap- remcsum ] remote ADDR - specifies the remote address of the tunnel. local ADDR - specifies the fixed local address for tunneled packets. It must be an address on another interface on this host. encap { fou | gue | none } - specifies type of secondary UDP encapsulation. "fou" indicates Foo-Over-UDP, "gue" indicates Generic UDP Encapsulation. encap-sport { PORT | auto } - specifies the source port in UDP encapsulation. PORT indicates the port by number, "auto" indicates that the port number should be chosen automatically (the kernel picks a flow based on the flow hash of the encapsulated packet). [no]encap-csum - specifies if UDP checksums are enabled in the secondary encapsulation. [no]encap-remcsum - specifies if Remote Checksum Offload is enabled. This is only applicable for Generic UDP Encapsulation.o: ip link add DEVICE type geneve id ID remote IPADDR [ ttl TTL ] [ tos TOS ] id VNI - specifies the Virtual Network Identifer to use. remote IPADDR - specifies the unicast destination IP address to use in outgoing packets. ttl TTL - specifies the TTL value to use in outgoing packets. tos TOS - specifies the TOS value to use in outgoing packets. from one macvlan instance to the other on the same physical interface is transmitted over the physical interface. Either the attached switch needs to support hairpin mode, or there must be a TCP/IP router forwarding the packets in order to allow communication. This is the default mode. mode bridge - In bridge mode, all endpoints are directly connected to each other, communication is not redirected through the physical interface's peer. mode passthru [ nopromisc ] - This mode gives more power to a single endpoint, usually in macvtap mode. It is not allowed for more than one endpoint on the same physical interface. All traffic will be forwarded to this endpoint,. ip link delete - delete virtual link dev DEVICE specifies the virtual device to act operate on. group GROUP specifies the group of virtual links to delete. Group 0 is not allowed to be deleted since it is the default group. type TYPE specifies the type of the device.. protodown on or protodown off change the PROTODOWN 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. dynamic on or dynamic off change the DYNAMIC flag on the device. Indicates that address can change when interface goes down (currently NOT used by the Linux). NETNSNAME | PID move the device to the network namespace associated with name NETNSNAME or process PID. Some devices are not allowed to change network namespace: loopback,.. vf parameter must be specified. Please use new API max_tx_rate option instead.. master DEVICE DEVICE specifies the master device which enslaves devices to show. type TYPE TYPE specifies the type of devices to show. The show command has additional formatting options: -s, -stats, -statistics output more statistics about packet usage. -d, -details output more detailed information. -h, -human, -human-readable output statistics with human readable values number followed by suffix -iec print human readable rates in IEC units (ie. 1K = 1024).. ip link show master br0 Shows devices enslaved by br0. ip link help gre Display help for the gre link type. ip link add name tun1 type ipip remote 192.168.1.1 local 192.168.1.2 ttl 225 encap gue encap-sport auto encap-dport 5555 encap-csum encap- remcsum Creates an IPIP that is encapsulated with Generic UDP Encapsulation, and the outer UDP checksum and remote checksum offload are enabled. ip link add link wpan0 lowpan0 type lowpan Creates a 6LoWPAN interface named lowpan0 on the underlying IEEE 802.15.4 device wpan0.
SEE ALSO
ip(8), ip-netns(8), ethtool(8), iptables(8)
AUTHOR
Original Manpage by Michail Litvak <mci@owl.openwall.com>