Low Orbit Flux Logo 2 F

Linux Command - traceroute

Run traceroute:



traceroute google.com

The traceroute command in Linux is used to trace the path that packets take from your system to a destination network host. It’s helpful for diagnosing routing issues or understanding network latency.

Hops:

Steps:

By default, traceroute will send UDP packets to ports starting at 33434 and expect ICMP messages back. Firewalls will often block UDP or TCP ports making this tricky. Sometimes ICMP can also be blocked. To help with this we have a few different options.

Send ICMP Probe instead of UDP:



sudo traceroute -I google.com

Send a TCP syn probe on port 80:



sudo traceroute -T -p 80 google.com

Common options:



-n           # don't resolve hostnames ( faster )
-m 5         # max number of hops ( default 30 )
-p 80        # specify port
-I           # use ICMP ( ping )
-T           # Send a TCP SYN packet instead
-w 20        # set timeout in seconds (default is 5)