Link Search Menu Expand Document

MTR & Traceroute

Table of contents


  • MTR - a combination between traceroute and ping.
  • MTR default uses icmp, traceroute default use udp.
  • If seeing waiting for reply, update file ferm.conf > protocol icmp accept.
sudo mtr -r -c 30
sudo mtr

MTR over IPv4 & IPv6

sudo mtr -rw -c 30 -4 
    # 30 times over IPv4
sudo mtr -rwc 10 -T -4
sudo mtr -rwc 10 -T -6

MTR sending 64 hops

sudo mtr --tcp --port 443 -m64 -U20 -rwc1

MTR over tcp

  • Force mtr over tcp
sudo mtr --tcp
  • Force over tcp and port 443
sudo mtr --tcp --port 443
  • User -rw for report
sudo mtr --tcp --port 443 -rw -c 10
  • Use -U for unknown hosts, by default mtr has 5, increase it to 30 unknown hosts
sudo mtr --tcp --port 443 -U 30 -rw -c 10
  • Use -m 64 is to increase the hops, mtr default to 30 hops max
sudo mtr --tcp --port 443 -U 30 -m 64 -rw -c 10

MTR flags usage

-r //--report 
-c //-cycles, Set the number of pings sent
-w //--report-wide
-t //--tcp, set TCP instead of ICMP
-4 //Use IPv4 only
-6 //Use IPv6 only

Install MTR

apt-get install build-essential curl file git
brew install mtr 

Install MTR on Ubuntu

apt-get -y install mtr

A little note for installation error

  • Potential error: Failure to start mtr-packet: Invalid argument
  • Need to add export PATH=$PATH:/usr/local/sbin to ~/.zshrc in order to have mtr to run.


Install apt install traceroute.



  • Ping IP, count 10 times.
ping -c 10
  • Ping hostname over IPv6, count 5 times.
ping6 -c 5


  • Connecting to IP address over port 443
nc -nvz 443 
  • Connecting to IP address over any ports
nc -nvz any-ports