Linux command: traceroute

Quick starttracerouteCommand, used to list all nodes that traverse to the host

When you try to access a host on the Internet, you will pass through the home router and then reach the ISP network, which in turn will pass through its own upstream network router, and so on, until you finally reach the host.

Have you ever wondered what steps your data package needs to perform?

ThistracerouteFor this order.

You call

traceroute <host>

It will collect all the information (slowly) as the packet is transmitted.

In this example, I tried to passtraceroute flaviocopes.com:

Not every router that passes by will return information to us. under these circumstances,tracerouteprint* * *. Otherwise, we can see the hostname, IP address and some performance indicators.

For each router, we can see 3 samples, which means that traceroute will try 3 times by default to give you a better idea of the time to reach it. This is why it takes so long to executetracerouteThan simply do onepingTo that host.

you can use it-qOptions:

traceroute -q 1 flaviocopes.com

ThistracerouteThis command can be used in Linux, macOS, WSL and wherever you have a UNIX environment

Download mine for freeLinux Command Manual


More cli tutorials: