ip-link - Man Page

network device configuration

Examples (TL;DR)

Synopsis

ip link { COMMAND | help }

ip link add [ link DEVICE ] [ name ] NAME
[ txqueuelen PACKETS ]
[ address LLADDR ] [ broadcast LLADDR ]
[ mtu MTU ] [ index IDX ]
[ numtxqueues QUEUE_COUNT ] [ numrxqueues QUEUE_COUNT ]
[ gso_max_size BYTES ] [ gso_ipv4_max_size BYTES ] [ gso_max_segs SEGMENTS ]
[ gro_max_size BYTES ] [ gro_ipv4_max_size BYTES ]
[ netns { PID | NETNSNAME | NETNSFILE } ]
type TYPE [ ARGS ]

ip link delete { DEVICE | group Group } type TYPE [ ARGS ]

ip link set { DEVICE | group Group }
[ { up | down } ]
[ type ETYPE TYPE_ARGS ]
[ arp { on | off } ]
[ dynamic { on | off } ]
[ multicast { on | off } ]
[ allmulticast { on | off } ]
[ promisc { on | off } ]
[ protodown { on | off } ]
[ protodown_reason PREASON { on | off } ]
[ trailers { on | off } ]
[ txqueuelen PACKETS ]
[ gso_max_size BYTES ] [ gso_ipv4_max_size BYTES ] [ gso_max_segs SEGMENTS ]
[ gro_max_size BYTES ] [ gro_ipv4_max_size BYTES ]
[ name NEWNAME ]
[ address LLADDR ]
[ broadcast LLADDR ]
[ mtu MTU ]
[ netns { PID | NETNSNAME | NETNSFILE } ]
[ link-netnsid ID ]
[ alias NAME ]
[ vf NUM [ mac LLADDR ]
[ VFVLAN-LIST ]
[ rate TXRATE ]
[ max_tx_rate TXRATE ]
[ min_tx_rate TXRATE ]
[ spoofchk { on | off } ]
[ query_rss { on | off } ]
[ state { auto | enable | disable } ]
[ trust { on | off } ]
[ node_guid eui64 ]
[ port_guid eui64 ] ]
[ { xdp | xdpgeneric | xdpdrv | xdpoffload } { off |
object FILE [ { section | program } NAME ] [ verbose ] |
pinned FILE } ]
[ master DEVICE ]
[ nomaster ]
[ vrf NAME ]
[ addrgenmode { eui64 | none | stable_secret | random } ]
[ macaddr [ MACADDR ]
[ { flush | add | del } MACADDR ]
[ set MACADDR ] ]

ip link show [ DEVICE | group Group ] [ up ] [ master DEVICE ] [ type ETYPE ] [ vrf NAME ] [ nomaster ]

ip link xstats type TYPE [ ARGS ]

ip link afstats [ dev DEVICE ]

ip link help [ TYPE ]

TYPE := [ amt | bareudp | bond | bridge | can | dsa | dummy | erspan | geneve | gre | gretap | gtp | hsr | ifb | ip6erspan | ip6gre | ip6gretap | ip6tnl | ipip | ipoib | ipvlan | ipvtap | lowpan | macsec | macvlan | macvtap | netdevsim | netkit | nlmon | rmnet | sit | vcan | veth | virt_wifi | vlan | vrf | vti | vxcan | vxlan | xfrm ]

ETYPE := [ TYPE | bridge_slave | bond_slave ]

VFVLAN-LIST := [ VFVLAN-LIST ] VFVLAN

VFVLAN := [ vlan VLANID [ qos VLAN-QOS ] [ proto VLAN-PROTO ] ]

ip link property add dev DEVICE [ altname NAME .. ]

ip link property del dev DEVICE [ altname NAME .. ]

Description

Group

may be a number or a string from /usr/share/iproute2/group or /etc/iproute2/group which can be manually filled and has precedence if exists.

Examples

ip link show

Shows the state of all network interfaces on the system.

ip link show type bridge

Shows the bridge devices.

ip link show type vlan

Shows the vlan devices.

ip link show master br0

Shows devices enslaved by br0

ip link set dev ppp0 mtu 1400

Change the MTU the ppp0 device.

ip link add link eth0 name eth0.10 type vlan id 10

Creates a new vlan device eth0.10 on device eth0.

ip link delete dev eth0.10

Removes vlan device.

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 set dev eth0 xdp obj prog.o

Attaches a XDP/BPF program to device eth0, where the program is located in prog.o, section "prog" (default section). In case a XDP/BPF program is already attached, throw an error.

ip -force link set dev eth0 xdp obj prog.o sec foo

Attaches a XDP/BPF program to device eth0, where the program is located in prog.o, section "foo". In case a XDP/BPF program is already attached, it will be overridden by the new one.

ip -force link set dev eth0 xdp pinned /sys/fs/bpf/foo

Attaches a XDP/BPF program to device eth0, where the program was previously pinned as an object node into BPF file system under name foo.

ip link set dev eth0 xdp off

If a XDP/BPF program is attached on device eth0, detach it and effectively turn off XDP for device eth0.

ip link add link wpan0 lowpan0 type lowpan

Creates a 6LoWPAN interface named lowpan0 on the underlying IEEE 802.15.4 device wpan0.

ip link add dev ip6erspan11 type ip6erspan seq key 102 local fc00:100::2 remote fc00:100::1 erspan_ver 2 erspan_dir ingress erspan_hwid 17

Creates a IP6ERSPAN version 2 interface named ip6erspan00.

ip link set dev swp0 type dsa conduit eth1

Changes the conduit interface of the swp0 user port to eth1.

See Also

ip(8), ip-netns(8), ethtool(8), iptables(8)

Author

Original Manpage by Michail Litvak <mci@owl.openwall.com>

Referenced By

batctl(8), configuration.nix(5), ip(8), ip-macsec(8), ip-stats(8), ip-vrf(8), network_namespaces(7), nft(8), veth(4), wg(8), wg-quick(8).

13 Dec 2012 iproute2 Linux