10 Linux commands for testing connectivity and transfer rates

The traceroute command uses a clever technique to time each hop. It uses a time to live (TTL) setting that is decremented with each hop to ensure that each router along the route will at some point send back an error message. This allows traceroute to report on the duration of time between each hop.

Here’s an example of using traceroute to reach a local system (a single hop and a quick response):

$ traceroute 192.168.0.11
traceroute to 192.168.0.11 (192.168.0.11), 30 hops max, 60 byte packets
1 192.168.0.11 (192.168.0.11) 9.228 ms 12.797 ms 12.782 ms

This next traceroute command tries to reach a remote system, but is unable to report on each hop (those showing asterisks) because the routers at some hops don’t respond to the type of packet used. This is not unusual.

The default maximum number of hops for traceroute is 30. Notice that this setting is displayed in the first line of output. It can be changed, however,  using the -m argument (e.g., traceroute -m 50 distant.org).

$ traceroute www.amazon.com
traceroute to www.amazon.com (99.84.218.165), 30 hops max, 60 byte packets
1 router (192.168.0.1) 1.586 ms 3.842 ms 4.074 ms
2 10.226.32.1 (10.226.32.1) 27.342 ms 28.485 ms 29.529 ms
3 10.17.1.25 (10.17.1.25) 30.769 ms 31.584 ms 32.379 ms
4 10.17.0.221 (10.17.0.221) 33.126 ms 34.390 ms 35.284 ms
5 10.17.0.226 (10.17.0.226) 37.000 ms 38.837 ms 40.808 ms
6 204.111.0.145 (204.111.0.145) 44.083 ms 42.671 ms 42.582 ms
7 99.82.178.164 (99.82.178.164) 44.254 ms 30.422 ms 31.666 ms
8 * * *
9 * * *
10 * * *
11 52.93.40.225 (52.93.40.225) 41.548 ms 52.93.40.223 (52.93.40.223) 41.808 ms 52.93.40.225 (52.93.40.225) 43.326 ms
12 * * *
13 * * *
14 * * *
15 * * *
16 * * *
17 server-99-84-218-165.iad79.r.cloudfront.net (99.84.218.165) 44.862 ms 44.746 ms 44.713 ms

mtr

The mtr (my traceroute) command combines the functionality of the ping and traceroute commands. In the example below, the mtr command is evaluating the connectivity between the local system and the default router. Notice that it reports on the percentage of packets lost and the number sent.

fedora (192.168.0.19) -> 192.168.0.1 (192.168.0.1)                                                       2025-02-21T14:16:27-0500
Keys: Help Display mode Restart statistics Order of fields quit
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev
1. _gateway 0.0% 13 3.3 3.5 3.0 7.1 1.1

The fields reported by the mtr command include:



Source link

Leave a Comment