How to Inspect and Change Network Interface MTU in Linux Using ip link

The Maximum Transmission Unit (MTU) specifies the largest packet size (in bytes) that a network interface can transmit over a physical or virtual link without needing to fragment the packet into smaller segments. On standard Ethernet networks, the default MTU is 1,500 bytes. However, when configuring VPN tunnels (such as WireGuard or OpenVPN), VLAN tags, or high-throughput data centre fabrics supporting Jumbo Frames (9,000 bytes), an incorrect MTU causes packet fragmentation, dropped packets, and degraded network throughput.

Modern Linux distributions manage network links via the iproute2 suite. Using the ip link utility, you can inspect active MTU values, test for packet fragmentation, and adjust MTU settings both temporarily and persistently.

Step 1: Inspect Current MTU Values on Active Interfaces

Before modifying any parameters, query your Linux kernel to determine the active interface names and their configured MTU thresholds:

  1. Open your terminal and run the following command:
ip link show
  1. The output enumerates all local network interfaces. Look for the mtu parameter within each interface header:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
3: wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/none
  1. In this example, physical interface eth0 uses the standard 1500 MTU, while virtual VPN tunnel wg0 utilizes 1420 bytes to accommodate WireGuard encapsulation overhead.

Step 2: Test for MTU Fragmentation Using ping

To identify the optimal MTU for an external route without causing packet fragmentation, send ICMP echo packets with the “Don’t Fragment” (DF) bit set:

  1. Execute the ping command with the -M do flag (which enforces the DF bit) and specify a test packet size with -s:
ping -M do -s 1472 -c 4 1.1.1.1
  1. Calculating packet size: Standard IP headers require 20 bytes and ICMP headers require 8 bytes (totaling 28 bytes). Thus, an MTU of 1,500 corresponds to a ping payload of 1,472 bytes (1500 – 28 = 1472).
  2. If the ping succeeds with zero packet loss, your connection supports the 1,500 MTU without fragmentation.
  3. If the terminal returns ping: local error: message too long, mtu=1420, your packets are exceeding downstream router capabilities, confirming that you must lower your interface MTU.

Step 3: Temporarily Change Interface MTU with ip link

To immediately adjust the MTU of an interface (for example, changing eth0 to 1400 bytes to troubleshoot a misbehaving DSL or cellular connection):

  1. Execute the ip link set command with elevated privileges:
sudo ip link set dev eth0 mtu 1400
  1. Verify the change immediately by running:
ip link show dev eth0
  1. The output confirms that the kernel updated the parameter: eth0: ... mtu 1400. Network traffic immediately adapts to the new maximum packet ceiling without requiring an interface restart.

Step 4: Making MTU Changes Persistent Across Reboots

Changes made directly with ip link revert to defaults upon reboot. To make adjustments permanent, configure your distribution’s network manager:

On Ubuntu and Debian Using Netplan

  1. Open your active Netplan configuration file in a text editor:
sudo nano /etc/netplan/01-netcfg.yaml
  1. Add the mtu directive beneath your interface definition:
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: true
      mtu: 1400
  1. Save the file and apply the new configuration:
sudo netplan apply

On Red Hat, Fedora, and Rocky Linux Using NetworkManager

  1. Use nmcli to configure the connection profile:
sudo nmcli connection modify "System eth0" 802-3-ethernet.mtu 1400
sudo nmcli connection up "System eth0"

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.