traceroute
networkingLinux/Unix
The traceroute command is one of the most frequently used commands in Linux/Unix-like operating systems. traceroute Print the route packets take to a network host
Quick Reference
Command Name:
traceroute
Category:
networking
Platform:
Linux/Unix
Basic Usage:
traceroute [options] [arguments]
Common Use Cases
Syntax
traceroute [options] host [packetsize]
Options
Option | Description |
---|---|
-4 |
Use IPv4 only |
-6 |
Use IPv6 only |
-d |
Enable socket level debugging |
-F |
Don't fragment packets (set DF flag) |
-f FIRST_TTL |
Start from the FIRST_TTL hop (instead of 1) |
-g GATEWAY |
Specify a loose source route gateway (can be used multiple times) |
-I |
Use ICMP ECHO instead of UDP datagrams |
-i INTERFACE |
Specify a network interface to use |
-m MAX_TTL |
Set the maximum number of hops (max TTL) |
-N SQUERIES |
Set the number of probes to be tried simultaneously |
-n |
Do not resolve IP addresses to hostnames |
-p PORT |
Set the base UDP port number used in probes (default is 33434) |
-q NQUERIES |
Set the number of probes per TTL (default is 3) |
-r |
Bypass the normal routing tables and send directly to a host |
-s SRC_ADDR |
Use SRC_ADDR as the source IP address |
-T |
Use TCP SYN for probes |
-t TOS |
Set the Type of Service (TOS) in probe packets |
-U |
Use UDP to specific port for probes (instead of increasing port per probe) |
-v |
Verbose output |
-w WAITTIME |
Set the time (in seconds) to wait for a response to a probe (default is 5) |
-z SENDWAIT |
Set the time (in seconds) to pause between probes |
--help |
Display help and exit |
Examples
How to Use These Examples
The examples below show common ways to use the traceroute
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
# Trace the route to a domain
traceroute google.com