// DevOps
Network troubleshooting for beginners: Part 4 — mtr, nmap and curl
Published on 2026-09-22
Simple utilities from previous parts each answer their own question: ping — is there connectivity, traceroute — which path packets take, nc — is the port open. The three tools in this part give a more complete picture: mtr watches the route continuously, nmap checks many ports at once, and curl shows what the web server actually responds.
mtr: route and losses in real time
mtr combines ping and traceroute: it continuously sends packets to every hop along the path and measures latency and loss. This helps find intermittent problems that are not visible with a single traceroute.
Installation:
sudo apt install mtr-tiny # Debian and Ubuntu, console version
brew install mtr # macOSInteractive mode:
mtr google.comReport for sharing or saving — 100 cycles and a final table:
mtr -rwc 100 google.com-r— report mode;-w— full host names without truncation;-c 100— number of cycles.
Example report:
HOST Loss% Snt Last Avg Best Wrst StDev
1. _gateway 0.0% 100 0.4 0.4 0.3 0.6 0.0
2. 10.0.0.1 0.0% 100 1.2 1.5 1.1 5.2 0.5
3. core-router.example.net 10.0% 100 15.1 14.8 14.5 16.0 0.4
4. 142.250.184.110 0.0% 100 16.0 16.2 15.8 17.1 0.3How to read:
- loss only on a single intermediate hop, while following hops and the destination show 0% — this is not a problem: the router limits responses to probe packets, while transit traffic passes;
- loss that starts at some hop and persists to the end of the route indicates a problematic segment;
- large latency variance (
StDev,Wrst) is a sign of link congestion.
By default mtr sends ICMP. If ICMP is limited along the path, try TCP to the desired port: mtr -T -P 443 example.com.
nmap: which ports are open
nmap checks a host’s ports and shows their state. Scan only your hosts or those you have permission for; for experiments the nmap project provides the host scanme.nmap.org.
nmap scanme.nmap.orgBy default the 1000 most common TCP ports are scanned. Example result:
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
443/tcp filtered https- open — the service accepts connections;
- closed — the host replied that the port is closed;
- filtered — no response, packets are dropped by a firewall.
Useful options:
nmap -p 22,80,443 example.com # only the specified ports
nmap -sV -p 443 example.com # determine the service and its version
nmap -sn 192.168.1.0/24 # find active hosts in your network without scanning portscurl: what the web server responds
curl sends an HTTP request and shows the server’s response without browser processing.
Response headers only:
curl -I https://google.comHTTP/2 301
location: https://www.google.com/Status 301 means a permanent redirect, the location header is the address to which it redirects. To make curl follow redirects, add -L.
Detailed connection progress:
curl -v https://example.comThe output shows which address is being connected to, how the TLS handshake proceeds, and which headers were sent and received. This helps distinguish a certificate error from an application error.
Time of each stage:
curl -o /dev/null -s -w 'DNS: %{time_namelookup}s TCP: %{time_connect}s TLS: %{time_appconnect}s total: %{time_total}s\n' https://example.comChecking the site at a specific address bypassing DNS — for example, a new server before switching the record:
curl -I --resolve example.com:443:203.0.113.10 https://example.comThe main curl flags are covered in the article “curl for beginners”.
Summary
mtr— intermittent route problems and the segment where losses begin;nmap— status of many ports at once: open, closed, filtered;curl— exactly what the web server responds with, how long each stage takes, and whether the certificate works.
If even these tools don’t show the cause, you have to look at the packets themselves — that’s what the last part is about.
Resources
// Reviews
Related reviews
Huge thanks to Mikhail for the work — I'm very pleased with the result. Special thanks for his recommendations during setup: from my rather muddled brief (I know little about servers), Mikhail, through clarifying questions and suggestions, formed a clear understanding of what the final build would accomplish and how best to organize everything. I recommend him!
Many thanks to Mikhail for the work, I am very pleased with the result. I especially thank him for the recommendations during the setup process — from my rather muddled brief (and I know little about servers) Mikhail, …
MikroTik hAP router setup. I'll set up a MikroTik Wi‑Fi router for you.
2025-07-21 · ★ 5/5
An excellent specialist, a savvy expert, and a wonderful person. In an hour he fixed what we'd been racking our brains over for days! I'm sure this won't be the last time we rely on his boundless professionalism.
An excellent specialist, a savvy expert, and a wonderful person. In an hour he fixed for us what we had been scratching our heads over for days! I'm sure this won't be the first time we make use of his boundless …
MikroTik hAP router setup. I'll configure a MikroTik Wi-Fi router for you.
2025-05-28 · ★ 5/5
A professional approach to the job!
Professional approach to the job!
MikroTik hAP router setup. I'll set up a MikroTik Wi-Fi router for you.
2025-03-31 · ★ 5/5
Knows their stuff, gets things done. Everything was prompt and to the point; I was satisfied with the collaboration.
Knows, can, does. Everything was prompt and to the point; I was satisfied with the collaboration.
MikroTik hAP router setup. I'll set up a MikroTik Wi‑Fi router for you.
2025-03-14 · ★ 5/5
Thanks! We set up the router according to my technical specification, with a full explanation of what we're doing.
Thank you! The router was configured according to my technical specification, with a full explanation of what we are doing
MikroTik hAP router setup. I'll configure a MikroTik Wi‑Fi router for you.
2025-03-09 · ★ 5/5
Everything's great! Thanks! I recommend it.
Everything's great! Thank you! I recommend it
// Contact
Need help?
Get in touch with me and I'll help solve the problem
I reply within one business day (03:00-13:00 GMT)
Или оставьте заявку здесь:
// Related