Categories: TutorialsUbuntu

How to Install the Traceroute on Ubuntu

Network or system administrators are responsible for ensuring that a network or system provides uninterrupted service, and they must ensure that the network is properly maintained. They must execute many network tests to continuously monitor network operation; several diagnostic tools, such as ping, allow network administrators to evaluate network connectivity. For network diagnostics, however, another command called “traceroute” is used in Linux and macOS, whereas the identical program is called “tracert” in Windows. The traceroute command is used to map the data from the source to the destination of a route. It can also be used to track the paths that data packets take from their origin to their destination.

Sponsored

In this comprehensive article, we’ll look at how to use the traceroute command in Ubuntu with various examples.

How to Install Traceroute

If you haven’t installed the traceroute, it will give you an error when you try to use it. As a result, you must first install it before running the command to use it. Run the following mentioned command to install it:

$ sudo apt install traceroute

Uses of Traceroute in Ubuntu

You will be able to use traceroute in Ubuntu once it’s been installed. Before we dive into the specifics, let’s have a look at how to utilize traceroute in its most simple form:

To acquire the full scope of the traceroute’s capabilities, run the following command:

$ traceroute

Furthermore, the command below is used to display the tracerouting for youtube.com.

$ traceroute www.youtube.com

or

$ traceroute youtube.com

Sponsored

There are a few key ideas we can glean from the output; the details of the few values that appear on the first line of the output are described below:

  • 173.194.76.198 represents the destination’s IP address.
  • The number of hops is a numerical value that indicates how long the traceroute will attempt to reach the destination (the default value is 30).
  • You can send a certain number of probes per hop or a certain number of packets each hop (the default value is 3)
  • The final key item to consider is the size of the packets you’re transmitting. (60 bytes is the default value).

How to Set the Number of Probes

By default, 16 probes are passed at once; you can change this number of probes by using the “-N” option: Run the following command to reset the number of probes:

$ traceroute –N 12 youtube.com

How to use Traceroute to Limit the Number of Hops

By default, there are 30 hops; however, by using the “-m” option, you can specify a different value: for example, the command below would scan the website for only 6 hops to reach the target. You can see that the tracerouting is only carried out until 6 hops.

$ traceroute –m 6 youtube.com

How to Limit the Probes

The “-q” parameter in traceroute allows you to specify several probes; by default, three probes are presented at each hop: When you need speedy responses, choose this option:

Run the following mentioned command to reduce the number of probes to “2”:

$ traceroute –q 2 youtube.com

How to Change the Packet Size

The default size of packets sent by each hop is 60 bytes; using the following command, packets will be resized to 30 bytes.

$ traceroute youtube.com 30

How to Use the “-f” Option to Change the Number of Hops

The traceroute command “-f” option prints the result starting at the hop number you indicate; you can specify the number of hops from which the result will be printed; for example, the example below will start publishing the result at the 12th hop.

$ traceroute -f 12 youtube.com 

Conclusion

In Ubuntu, network diagnostics tools such as traceroute, and ping are available. Network administrators are responsible for maintaining the network and traceroute is one of the most important tools for system or network administrators. This article provides a brief description of the traceroute command, which can be used to determine the delays in network path responses and look for routing loops (if any exist) in the network.

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.

Ubuntu Server Admin

Recent Posts

Building RAG with enterprise open source AI infrastructure

One of the most critical gaps in traditional Large Language Models (LLMs) is that they…

9 hours ago

Life at Canonical: Victoria Antipova’s perspective as a new joiner in Product Marketing

Canonical is continuously hiring new talent. Being a remote- first company, Canonical’s new joiners receive…

1 day ago

What is patching automation?

What is patching automation? With increasing numbers of vulnerabilities, there is a growing risk of…

2 days ago

A beginner’s tutorial for your first Machine Learning project using Charmed Kubeflow

Wouldn’t it be wonderful to wake up one day with a desire to explore AI…

3 days ago

Ubuntu brings comprehensive support to Azure Cobalt 100 VMs

Ubuntu and Ubuntu Pro supports Microsoft’s Azure Cobalt 100 Virtual Machines (VMs), powered by their…

3 days ago

Ubuntu Weekly Newsletter Issue 870

Welcome to the Ubuntu Weekly Newsletter, Issue 870 for the week of December 8 –…

4 days ago