هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
$ مستخدم عادي# بصلاحية root (أو مع sudo)
The quick answer
Step by step
- Start simple — is the host up, and what is the normal time?
ping -c 5 shop.example.com- See the hops —
tracepathneeds no root and also shows the path MTU:
tracepath -n shop.example.com
1?: [LOCALHOST] pmtu 1500
1: 10.0.1.1 0.512ms
2: 192.0.2.1 4.201ms
3: no reply
4: 203.0.113.9 21.877ms reached- Measure loss per hop with
mtr(50 rounds, report mode):
mtr -rwzc 50 shop.example.com
HOST Loss% Snt Last Avg Best Wrst StDev
1. AS??? 10.0.1.1 0.0% 50 0.5 0.6 0.4 1.1 0.1
2. AS64500 192.0.2.1 0.0% 50 4.1 4.3 3.9 6.0 0.4
3. AS64500 198.51.100.7 40.0% 50 12.2 12.5 11.9 14.1 0.4
4. AS64501 203.0.113.9 0.0% 50 21.8 22.1 21.5 24.0 0.5- Read it the right way:
- Loss at one middle hop but not at the later hops (hop 3 above) = that router just does not answer pings with priority. Not a problem.
- Loss that starts at a hop and continues to the end = a real problem from there on.
- A big jump in time that stays for all later hops = a slow link (or a long distance, for example Europe → Asia).
* * */no reply= the router does not answer. Normal on many networks.
- Through firewalls that block ICMP/UDP — trace with TCP to the real port:
traceroute -T -p 443 -n shop.example.com
mtr -rwzc 50 --tcp --port 443 shop.example.com- Send a good report to the provider or the network team: the
mtrreport from both directions (from you to the server, and from the server back to you), time of the test, and your public IP.
Check that it worked
You know where the path goes wrong: inside your network (first hops), at your provider, on the internet, or at the server's side (last hops). After the fix, mtr shows 0 % loss at the last hop and normal times.
Common problems
| Problem | Cause | Fix |
|---|---|---|
Only * * * after hop 2 | Firewalls drop the UDP/ICMP probes. | Use TCP: traceroute -T -p 443 or mtr --tcp. |
traceroute: command not found | Not installed. | dnf install traceroute mtr / apt install traceroute mtr-tiny, or use tracepath. |
You do not have enough privileges to use this traceroute method | TCP mode needs root. | Run with sudo. |
| Loss shown at a middle hop only | ICMP rate limiting on that router. | Ignore it — look at the last hop. |
| The way back is different | Internet routing is often not symmetric. | Run mtr from the server to you too. |
pmtu smaller than 1500 | A VPN or tunnel on the way. | Lower the MTU / MSS clamping on the VPN, if big packets fail. |
Go further
- Command pages: tracepath, ping, ip.
- Next how-tos: Test if a remote port is open, Check the DNS records of a domain, Add a network route.
- Learn it: RH124 — Test the connection, TLCL — traceroute, AZ-104 — Network Watcher.
1mtr shows 40 % loss at hop 3 but 0 % at hops 4 and 5. Is there a problem?
No — that router only gives low priority to answering probes; the traffic itself passes.
2How do you trace through a firewall that blocks ICMP?
Trace with TCP to an open port: traceroute -T -p 443 HOST or mtr --tcp --port 443 HOST.