ip link: Usage, Options & Common CI Errors
ip link shows and configures the network interfaces themselves (state, MTU, MAC).
ip link operates on the link layer - bringing interfaces up or down and setting MTU. The classic container gotcha is an MTU mismatch (overlay networks use < 1500) that silently stalls large transfers.
What it does
ip link displays and configures network devices at the link layer: administrative state (up/down), MTU, MAC address, and flags. It does not touch IP addresses (that is ip addr) - only the interface itself.
Common usage
ip link show # all interfaces and their state
ip link show eth0
ip link set eth0 up # bring an interface up
ip link set eth0 mtu 1450 # set MTU (overlay networks)
ip -br link # brief one-line-per-iface viewOptions
| Subcommand | What it does |
|---|---|
| show [dev] | List interfaces / one interface |
| set <if> up|down | Bring the interface up or down |
| set <if> mtu <N> | Set the maximum transmission unit |
| set <if> address <mac> | Change the MAC address |
| -br | Brief, columnar output |
Common errors in CI
"RTNETLINK answers: Operation not permitted" on set - the step needs NET_ADMIN (--cap-add=NET_ADMIN or privileged). The subtle one is MTU: Docker/VPN/overlay networks often use an MTU below 1500, so packets larger than the path MTU are dropped and a clone or pull hangs at the same byte every time. Check ip link show <if> for the mtu value and match it. An interface in state DOWN means it was never brought up - ip link set <if> up.