Checking supported MTU (Maximum Transmission Unit) for a system using PING
March 20, 2025 Leave a comment
When troubleshooting network issues, ensuring that packets are not being fragmented is crucial. One way to check the Maximum Transmission Unit (MTU) of a network path is by using the ping command with specific flags that test for fragmentation.
What is MTU?
MTU (Maximum Transmission Unit) is the largest size of a packet that can be sent over a network without fragmentation. If a packet exceeds the MTU, it is either fragmented or dropped (if fragmentation is disabled).
To determine the MTU value that works for your connection, you can use the ping command with the Don’t Fragment (DF) flag, ensuring that packets exceeding the MTU are rejected instead of being fragmented.
Using PING to check MTU
A simple way to test MTU is by sending a ping with a specified packet size and ensuring it does not get fragmented:
# ping 10.7.0.4 -c 2 -M do -s 1400
Where:
10.7.0.4: The destination IP address to which we are sending the ping-c 2: Sends 2 pings before stopping-M do: Enables strict Path MTU Discovery, meaning fragmentation is not allowed-s 1400: Sets the ICMP payload size to1400bytes. The total packet size will be:1400 bytes (payload) + 8 bytes (ICMP header) + 20 bytes (IP header) = 1428 bytes.
In the following example, we are successfully sending a packet with a size of 1400:
[root@rac1 ~]# ping 10.0.1.4 -c 2 -M do -s 1400
PING 10.0.1.4 (10.0.1.4) 1400(1428) bytes of data.
1408 bytes from 10.0.1.4: icmp_seq=1 ttl=63 time=0.726 ms
1408 bytes from 10.0.1.4: icmp_seq=2 ttl=63 time=0.720 ms
--- 10.0.1.4 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1046ms
Sending a packet of the size 1472 is also successful:
[root@rac1 ~]# ping 10.0.1.4 -c 2 -M do -s 1472
PING 10.0.1.4 (10.0.1.4) 1472(1500) bytes of data.
1480 bytes from 10.0.1.4: icmp_seq=1 ttl=63 time=0.780 ms
1480 bytes from 10.0.1.4: icmp_seq=2 ttl=63 time=0.759 ms
--- 10.0.1.4 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1034ms
rtt min/avg/max/mdev = 0.759/0.769/0.780/0.029 ms
But sending a packet with the size 1473 is not successful:
[root@rac1 ~]# ping 10.0.1.4 -c 2 -M do -s 1473
PING 10.0.1.4 (10.0.1.4) 1473(1501) bytes of data.
--- 10.0.1.4 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1023ms
This indicates that the largest packet size you can send without fragmentation is 1472.


