LinuxCommandLibrary

ip-link

Manage network interfaces

TLDR

Show information about all network interfaces

$ ip [[l|link]]
copy

Show information about a specific network interface
$ ip [[l|link]] [[sh|show]] [ethX]
copy

Bring a network interface up or down
$ sudo ip [[l|link]] [[s|set]] [ethX] [up|down]
copy

Give a meaningful name to a network interface
$ sudo ip [[l|link]] [[s|set]] [ethX] [[al|alias]] "[LAN Interface]"
copy

Change the MAC address of a network interface
$ sudo ip [[l|link]] [[s|set]] [ethX] [[a|address]] [ff:ff:ff:ff:ff:ff]
copy

Change the MTU size for a network interface to use jumbo frames
$ sudo ip [[l|link]] [[s|set]] [ethX] mtu [9000]
copy

Set the promisc mode status of a device
$ sudo ip [[l|link]] [[s|set]] [ethX] promisc [on|off]
copy

SYNOPSIS

ip [OPTIONS] link [SELECTOR] { show | set | add | delete | list | help }

PARAMETERS

show [DEVICE] [FILTER]
    Display link information for all or selected devices

set DEVICE
    Change properties of the specified device

add [NAME] type TYPE [ARGLIST]
    Create a new virtual link

delete DEVICE
    Delete the specified link

list [DEVICE] [FILTER]
    List devices (alias for show)

save [FILTER]
    Save link configuration to a reusable format

up
    Activate the device (used with set)

down
    Deactivate the device

arp { on | off }
    Enable/disable ARP protocol

multicast { on | off }
    Enable/disable multicast

promisc { on | off }
    Enable/disable promiscuous mode

address [mac] LLADDR
    Set hardware (MAC) address

mtu BYTES
    Set maximum transmission unit

name STRING
    Set new device name

netns PID|NAME
    Move device to network namespace

master DEVICE
    Set master device (e.g., for bonding/bridge)

type TYPE
    Specify link type (e.g., vlan, bridge, dummy)

xdp { off | obj FILE ... }
    Manage XDP eBPF programs on device

vf NUM ...
    Configure SR-IOV virtual functions

-s, --stats
    Show statistics

-d, --details
    Show detailed information

-r, --resolve
    Resolve MAC addresses to hostnames

-o, --oneline
    Output in one-line format

-j, --json
    Output in JSON format

FILTER
    Filter by up|down, dynamic, type TYPE, etc.

DESCRIPTION

ip link is a versatile command from the iproute2 suite used to display, create, configure, and delete network interfaces (links) on Linux systems. It provides detailed information about physical and virtual devices, including Ethernet, bridges, VLANs, tunnels, and more advanced features like SR-IOV virtual functions (VF) and XDP eBPF programs.

Key capabilities include listing all links with statistics (ip link show), activating/deactivating interfaces (ip link set dev eth0 up), changing MAC addresses or MTU, renaming devices, creating virtual interfaces (e.g., ip link add name dummy0 type dummy), and managing namespaces.

It supersedes legacy tools like ifconfig from net-tools, offering richer output, scripting-friendly formats (with -o), and support for modern networking (GSO, TSO, GRO). Most operations require root privileges. Use ip link help for full syntax. Ideal for network admins, automation scripts, and troubleshooting connectivity issues by inspecting link states, speeds, and duplex modes.

CAVEATS

Most operations require root or CAP_NET_ADMIN; some types need kernel modules; renaming busy devices may fail; XDP/VF require hardware support.

COMMON EXAMPLES

ip link show - list interfaces
ip link set dev eth0 up - bring up eth0
ip link add link eth0 name eth0.10 type vlan id 10 - add VLAN
ip link set dev eth0 address 00:11:22:33:44:55 - set MAC

LINK STATES

States: UP (carrier OK), DORMANT, LOWER_UP; flags: NOARP, UP, BROADCAST, RUNNING, MULTICAST

HISTORY

Part of iproute2 suite, developed by Alexey Kuznetsov starting ~1996; first stable release ~2001; actively maintained, replacing net-tools (ifconfig/route) since kernel 2.2 era.

SEE ALSO

ip(8), ifconfig(8), ss(8), bridge(8), ethtool(8), vconfig(8)

Copied to clipboard