Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In a case I can use only UDP and ICMP protocols, how can I discover, in bytes, the path MTU for packet transfer from my computer to a destination IP?

share|improve this question
Do you want to solve this programmatically or with ping? Ping and either shell programming or combined with traceroute are options for example. Also do you want ipv4 or ipv6? – Max Dec 30 '12 at 17:46
@Max: shell programming it sounds good , have an idea for that ? – URL87 Dec 30 '12 at 17:58
I thought about using ping -s $SIZE -c 1 -M dont and lowering that SIZE value till it works, or just having a look at the ICMP returns via tcpdump if we are talking ipv6 but traceroute has this built in I just realized. – Max Dec 30 '12 at 18:06
up vote 4 down vote accepted

I believe what you are looking for, is easiest gotten via traceroute --mtu <target>; maybe with a -6 switch thrown in for good measure depending on your interests. Linux traceroute uses UDP as a default, if you believe your luck is better with ICMP try also -I.

share|improve this answer

A quick search with apropos mtu on CentOS5 turned out:

tracepath traces path to a network host discovering MTU along this path

This command even works unprivileged in user space.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.