Linux tracepath Command: Trace a Network Path and Path MTU

tracepath traces the hops to a destination and investigates the path maximum transmission unit (Path MTU). It can be used with regular user privileges, but not all intermediate routers respond.

What is the tracepath command?

A hop is a router step that a packet passes through. pmtu is information about the packet size that can be sent along the current path without fragmentation. Since it relies on ICMP errors or network policies, intermediate steps may be empty or the estimates may change. It has simpler options compared to traceroute.

Basic syntax

tracepath [option] destination

Installed implementations and options may vary depending on the distribution. Check the description for your current system with man tracepath.

Examples

Basic path tracing

Resolve the domain name to view path and MTU related outputs.

tracepath example.com

Numeric address-centered output

Reduces delays or confusion caused by reverse name lookups.

tracepath -n example.com

Hop Limit

Check the route within the first 15 hops.

tracepath -m 15 example.com

Reading Path and Path MTU

tracepath is used to check intermediate hops to the destination and the Path Maximum Transmission Unit (PMTU). Replace the destination with an address you have direct permission to check.

tracepath 192.0.2.1

Example of output structure (document address, not guaranteed to reach in reality):

1:  gateway.example  0.5ms
2:  no reply
Resume: pmtu 1500

no reply means that the hop did not respond to the probe packet, and it does not necessarily mean the connection to the subsequent destination is broken. The PMTU value can also change depending on the path and network policies. If it fails to reach, check routing, firewall, and destination response restrictions together.

Main Options and Format

Options/Format Description
-n Show numeric IP addresses instead of host names.
-4 / -6 Choose an IPv4 or IPv6 route.
-m hop Limit the maximum number of trace hops.
-l size Specify the length of the packet to send first.
-p port Specifies the initial destination port.

Precautions when using

Asterisks or missing responses may indicate that the router did not respond to the diagnostic packet, but it does not necessarily mean communication is disconnected. The route can vary on each run due to load balancing or round-trip path differences. If MTU issues are suspected, also check interface, tunnel, and firewall settings.

Frequently Asked Questions

What is the difference between tracepath and traceroute?

Both trace the path, but tracepath focuses on Path MTU discovery with simple options, while traceroute offers multiple probe methods and detailed settings.

Official Documentation

You can check the exact behavior of the options and the differences in implementation in the official tracepath documentation.

More in This Category
Linux top Command: Monitor Processes in Real Time

Linux top Command: Monitor Processes in Real Time

Learn how to monitor Processes in Real Time with the Linux top command, including practical examples, key options, and important precautions.

Linux unzip Command: List and Extract ZIP Archives

Linux unzip Command: List and Extract ZIP Archives

Learn how to list and Extract ZIP Archives with the Linux unzip command, including practical examples, key options, and important precautions.

Linux ssh-copy-id Command: Install a Public Key on a Remote Account

Linux ssh-copy-id Command: Install a Public Key on a Remote Account

Learn how to install a Public Key on a Remote Account with the Linux ssh-copy-id command, including practical examples, key options, and important precautions.

Linux chgrp Command: Change a File's Group

Linux chgrp Command: Change a File's Group

Learn how to change a File's Group with the Linux chgrp command, including practical examples, key options, and important precautions.

Linux ip Command: Inspect and Configure Network Interfaces and Routes

Linux ip Command: Inspect and Configure Network Interfaces and Routes

Learn how to inspect and Configure Network Interfaces and Routes with the Linux ip command, including practical examples, key options, and important precautions.

Linux Tutorial / Navigate Directories with pwd, ls, cd, and tree

Linux Tutorial / Navigate Directories with pwd, ls, cd, and tree

Use pwd, ls, cd, and tree to find your current location, inspect directories, navigate paths, and check where each command takes you.

Linux whatis Command: Show One-Line Command Descriptions

Linux whatis Command: Show One-Line Command Descriptions

Learn how to use the Linux whatis command to display concise descriptions of commands and manual pages, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux whoami Command: Show the Effective User Name

Linux whoami Command: Show the Effective User Name

Learn how to show the Effective User Name with the Linux whoami command, including practical examples, key options, and important precautions.

Linux apk Command: Manage Packages on Alpine Linux

Linux apk Command: Manage Packages on Alpine Linux

Learn how to manage Packages on Alpine Linux with the Linux apk command, including practical examples, key options, and important precautions.

Linux dig Command: Query DNS Records in Detail

Linux dig Command: Query DNS Records in Detail

Learn how to query DNS Records in Detail with the Linux dig command, including practical examples, key options, and important precautions.