Linux Mtr Command Tutorial with Examples To Network Diagnostics

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/linux-mtr-command-tutorial-examples-network-diagnostics/
PINTEREST
PINTEREST
INSTAGRAM

Linux mtr command provides both functionality of traceroute and ping commands. mtr can provide reports and xml, json, csv output. There is also Gtk interface provided for mtr .

Interactive Traceroute

One of the simple use case for mtr is providing the remote hostname or IP address we want to traceroute. This will open a new interactive window which shows each intermediate hop. This will also send continuous ICMP packets to get new time and related metrics and show in the screen.

We can exit from this screen with CTRL+C

Show Gtk Interface

mtr command can be used with GUI interface. We will provide –g in order to start with Gtk interface.

CSV Output

We can create CSV type output. CSV type output will delimit the columns with , . We will provide --csv option with the remote hostname.

CSV Output

CSV Output

Xml Output

Another supported output is xml . We can generate xml format output for the given remote hostname. We will use --xml option for this. Xml format is better suited for automated processing.

Xml Output

Xml Output

Json Output

We can also generate Json output. Json format is mainly used by Javascript applications. We can use --json option to generate JSON output.

Json Output

Json Output

Set Ping Count

mtr command will generate ping packets continuously. We can specify the ping count with –c and the packet count. In this example we will set ping count to 5 .

LEARN MORE  How To Monitor Network Traffic and Statistics with ntop Tool?

Read Hostnames From File

We can provide multiple hostnames to ping. In order to provide multiple remote hosts we should put them in to a file line by line. Then we will read this file with -F option with the file name. In this example we will read remote hosts from file named ping.txt .

Do Not Resolve DNS

Another standard feature of mtr is disabling DNS resolving. This will made operations faster because extra DNS resolving will create more traffic and wait time. We can disable DNS resolving with -n option.

Show AS Number

Autonomous systems are cells in internet network each of them connects each other in a mesh way. During ping and traceroute operations send packets are transmitted trough these Autonomous systems. We can all intermediate hosts autonomous numbers with --aslookup option.

Show AS Number

Show AS Number

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/linux-mtr-command-tutorial-examples-network-diagnostics/
PINTEREST
PINTEREST
INSTAGRAM

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)