Traceroute command and its options

Traceroute

Many network administrators use the traceroute command daily. It is a convenient tool that you can use under different operation systems – Windows (Tracert), MacOS, Linux (traceroute) and even on mobile (Android and iOS).

You can use traceroute, and see the full route that the packets take to their destination (domain or IP address). Apart from that, you will see the hostnames and IPs of the routers on the way and the latency, the time it takes for each device to receive and resend the data.

You can see which gateway is discarding your data and later you can fix it.

Traceroute

TTL

Each packet that you send contains a TTL (time to live). It is not a time but a limit of hops it can do before getting the result.

Usual limit is 30, but it can be more like 64 for example. This limit stops your data after a certain amount of hops so it won’t go forever. The IP packet will follow until it gets “time exceeded” or “port unreachable” when it gets to the host.

Starting at 30, on the next hop, it will drop to 29 and so on. If it can’t find the domain or IP that you wanted it will display a message where did it fail, so you will know where the problem is.

Example of Traceroute (Tracert on Windows)

The name of Traceroute on Windows is tracert. It works very similar to the version on the other operating systems.
Traceroute

Options for Windows

tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] [-R] [-S srcaddr] [-4] [-6] target_name

option Description
-d Do not resolve addresses to hostnames
-h aximum_hops Maximum number of hops to search for target

 

-j host-list Loose source route along host-list (IPv4-only)

 

-w timeout Wait timeout milliseconds for each reply

 

-R

 

Trace round-trip path (IPv6-only)
-S srcaddr Source address to use (IPv6-only)
-4 Force using IPv4
-6 Force using IPv6

Options for OS X (Mac)

We will show you the most commonly used option for mac users. If you want to see the whole list you can click HERE -i It specifies the network interface, through which the traceroute probe will go. By default is selected according to the routing table.
-I Use ICMP ECHO instead of UDP datagrams. (A synonym for “-P imcp”).
-s It chooses an alternative source address (It must be an IP, not a hostname). By default, the address of the outgoing interface is used.
-t Type of service. The value must be a decimal integer in the range from 0 to 255. You can use it to check if different types-of-service result in different paths.

Options for Linux (traceroute)

Again, the common options are the same as under OS X.
-i It specifies the interface through which the traceroute will go. By default is selected according to the routing table.
-I Use ICMP ECHO instead of UDP datagrams. (A synonym for “-P imcp”).
-s It chooses an alternative source address. By default, the address of the outgoing interface is used.
-t Type of service. The value must be a decimal integer in the range from 0 to 255. You can use it to check if different types-of-service result in different paths.

Conclusion

By using the newly collected data, you can see if there is any problem on the route (not responsive server or very slow one) and later focus your attention to fix it. If you want to see few more tools you can check one of our previous article Тools – DNS trace, Ping, Traceroute, Nslookup, Reverse lookup.

 

Enjoy this article? Don't forget to share.

Leave a Reply

Your email address will not be published. Required fields are marked *

*