Press "Enter" to skip to content

Posts tagged as “Ping command”

5 Incredible Ping command Examples

Today we will explore the Ping command. First, we will explain its definition and how you can use it. Finally, we will discover the five most popular Ping commands. Let’s start.

Definition of the Ping command

One of the built-in network diagnostic commands in your operating system is the Ping command (Windows, Linux, macOS, FreeBSD, etc.). Ping is used to test connectivity between your device and the target, which can be an IP address like 188.114.97.7 or a hostname like google.com.

By default, Ping uses the ICMP protocol to send the target four messages, each containing 32 bytes (Internet control message protocol).

Brief History of Ping command

How can you use it?

You can use the command on Windows devices in one of two ways: through the Command Prompt or using Windows PowerShell.

And if you are using Linux or macOS Operating systems, you may use it through the Terminal application.

5 examples of Ping command

  • The basic Ping command allows you to check your connectivity and the capability of the computer you are testing. As a result, on Linux or macOS, you will constantly hear a ping. Use the Ctrl-C combo to stop it. If there are no problems, you will get four replies and statistics for Windows.

ping example.com

  • On Windows, you should add the extra option “-t” for continuous ping. Fill in the following:

ping -t example.com

  • For a specific quantity of inquiries. You are allowed to make a custom number of queries on macOS and Linux and more than four requests on Windows.

For Linux and Mac

ping –c 8 example.com

in Windows

ping –n 8 example.com

  • The space in between pings. You can calculate the time in seconds between requests.

Linux/macOS

ping -i 20 1.2.3.4

  • Waiting period. It can be set to stop the ping command on macOS/Linux in seconds.

ping –w 50 example.com

Conclusion

So, the Ping command is a fundamental tool for network device testing. It is available on almost every OS and functions nearly identically on each one. ICMP packets should be sent, and the duration of the echo-response should be timed. Simple and ideal.

What is the MTR command, and how to use it?

What is the MTR command?

MTR command is a type of traceroute command developed by Matt Kimball in 1997 that allows both traceroute and ping in the same software. Originally the name MTR was an abbreviation of Matt’s traceroute, but in 1998, his colleague Roger Wolff worked on it too and changed the name to My traceroute.

Why is the MTR command better than the traditional Traceroute or Tracert?

The MTR command is better because it combines the Ping and the Traceroute command and gives additional information (statistics about time, packet loss, and round-trip time, too) about each hop on the way from the computer to the host.

MTR will send ICMP ECHOs (pings) and wait for them to return.

How can you get the MTR command?

To get it, you will need a few commands to download it and install it. You can do it on Ubuntu, other Linux distros, macOS, or BSD and its derivates. Sorry, but the command is not available on Windows.

Ubuntu

  1. Log in to your server, or start the Terminal application
  2. Write the command:

sudo apt update

this will update the list of all packages available

  1. Install with the following command:

sudo apt -y install mtr

macOS

  1. Open the Terminal app
  2. Install first the Homebrew with the following command:

/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)”

  1. Now, you can install the MTR command with:

brew install mtr

BSD

  1. Log into your server, or start the Terminal application
  2. Use the following command

pkg install mtr

You can install the MTR command on most Linux distros like Arch Linux, CentOS, Fedora, RedHat, Debian, and more.

Suggested article: What is Traceroute command and how to use it?

How to use the MTR command?

You can use it through the Terminal application. You have two basic ways to use the MTR command:

mtr + hostname – This one will show you the route to a particular hostname / domain name.

mtr +IP address – This will trace the route to a particular IP address. It could be IPv4 or IPv6 address.

The MTR syntax

mtr [-hvrctglspni46] [–help] [–version] [–report] [–report-cycles COUNT] [–curses] [–split] [–raw] [–no-dns] [–gtk] [–address IP.ADD.RE.SS [–interval SECONDS] [–psize BYTES | -s BYTES] HOSTNAME [PACKETSIZE]

But to see it more clearly, imagine it like this:

mtr OPTION OPTION’S VALUE hostname / IP address

  • mtr – my traceroute command.
  • OPTION – additional option for more precise probes. You can see the table below.
  • OPTION’S VALUE – sets the time or repetition. It depends on the option you have chosen. 
  • Hostname / IP address – You can put one of the two to trace the route to it.

We recommend you to read also about NSlookup command and DIg command

MTR command’s options

-h-helpHelp
-v-versionMTR’s version
-r-reportReport mode needs -c to specific the cycles before showing statistics at the end.
-w-report-wideExtended report mode.  
-c COUNT–report-cycles COUNTThe number of pings that must be sent.
-s BYTES–psize BYTES PACKETSIZEChoose the size of packets. If you chose a negative value, they would have a random size. 
-t–cursesCurses-based terminal interface
-n–no-dnsShow IP address, don’t resolve the hostname.
-g–gtkGTK+ interface.
-p–splitSplit-user interface.
-l–rawRaw output format. 
-a IP.ADD.RE.SS–address IP.ADD.RE.SSLink packets’ sockets to a specific interface
-i SECONDS–interval SECONDSSeconds between pings.
-u Use UDP.
-4IPv4 address only.
-6IPv6 address only.

The MTR command is a nifty tool for network diagnostic. Try it out!