Changing the MTU with ip link set is useful when a tunnel, VPN, VLAN, or restrictive WAN path cannot carry the default Ethernet frame size cleanly. Setting the correct MTU helps prevent oversized packets from fragmenting or disappearing when the path overhead is larger than expected.
The MTU is a per-interface link property shown in ip link show output. Running ip link set dev DEVICE mtu MTU updates the live kernel setting immediately, so new traffic on that interface starts using the new frame size as soon as the command succeeds.
An incorrect MTU can create intermittent stalls, retransmissions, or black-holed traffic that is harder to diagnose than a complete outage. Confirm the interface name first, use a value that matches the network design or path-MTU findings, and update the host's persistent network configuration separately if the change must survive a reboot or interface restart.
Steps to change MTU with ip link:
- Check the target interface name and its current MTU before making the change.
$ ip link show dev eth0 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:ab:cd:ef brd ff:ff:ff:ff:ff:ffReplace eth0 with the interface carrying the affected traffic.
- Set the new MTU value on the interface.
$ sudo ip link set dev eth0 mtu 1400
Replace 1400 with the MTU required by the path, tunnel, or overlay. No output usually means the change was accepted.
- Verify that the running interface now reports the new MTU.
$ ip link show dev eth0 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1400 qdisc fq_codel state UP mode DEFAULT group default qlen 1000 link/ether 52:54:00:ab:cd:ef brd ff:ff:ff:ff:ff:ff - Test the affected path with a no-fragment ping sized to the new MTU.
$ ping -c 3 -M do -s 1372 target.example.net PING target.example.net (203.0.113.80) 1372(1400) bytes of data. 1380 bytes from target.example.net (203.0.113.80): icmp_seq=1 ttl=64 time=0.091 ms 1380 bytes from target.example.net (203.0.113.80): icmp_seq=2 ttl=64 time=0.052 ms 1380 bytes from target.example.net (203.0.113.80): icmp_seq=3 ttl=64 time=0.076 ms --- target.example.net ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2086ms rtt min/avg/max/mdev = 0.052/0.073/0.091/0.016 ms
target.example.net stands for the far end of the tunnel or VPN, or the host that was stalling. 1372 is the 1400-byte MTU minus 28 bytes of IPv4 and ICMP headers. Success is not only the new value in ip link show. The traffic that required the change should also stop fragmenting or stalling.
- Save the same MTU to a Netplan file on Ubuntu.
$ sudo netplan set --origin-hint 99-mtu ethernets.eth0.mtu=1400
ip link set mtu changes runtime state only, so the value usually reverts when the interface is recreated by the host's normal network configuration tool or after a reboot.
The command writes /etc/netplan/99-mtu.yaml, which Netplan merges with the interface's existing configuration.
On NetworkManager hosts such as Fedora or RHEL, use sudo nmcli connection modify "Wired connection 1" 802-3-ethernet.mtu 1400 followed by sudo nmcli connection up "Wired connection 1" with the connection name from nmcli connection show.
On Debian hosts with a static address in /etc/network/interfaces, add mtu 1400 to the interface's iface stanza. - Apply the Netplan change.
$ sudo netplan apply