Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

tracepath

Show the routers (hops) on the way to a host and the MTU of the path. Needs no root.

Niveau
Dagelijks Linux
Groep
Netwerk
Root nodig
Nee
Pakket
iputils

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

Wat het doet

tracepath sends UDP packets with a growing TTL. Each router that drops a packet answers, so you see the path hop by hop with times. It also finds the path MTU (pmtu).

It works like traceroute but needs no special rights and is installed on RHEL by default (iputils). For a live view use mtr.

Zo schrijf je het

tracepath [-4] [-6] [-n] [-b] [-l PKTLEN] [-m MAX_HOPS] [-p PORT] DESTINATION

Opties 8

Meest gebruikt

-n
No name lookups: only IP addresses.
-b
Show names and IP addresses.
-4
Use IPv4 only.
-6
Use IPv6 only.
-m MAX_HOPS
Stop after this many hops (default 30).
-l PKTLEN
Start packet length (default 65535 for IPv4, 128000 for IPv6).
-p PORT
Start UDP port.
-V
Show the version.

Voorbeelden 10

$ als gewone gebruiker# als root (of met sudo)

  1. 1Path to a host

    tracepath -n www.redhat.com
     1?: [LOCALHOST]                      pmtu 1500
     1:  192.168.122.1                                         0.512ms
     2:  10.0.0.1                                              2.104ms
     3:  no reply
    ...

    "no reply" = a router that does not answer (common).

  2. 2Names and addresses

    tracepath -b server2.example.com

    Shows both for each hop.

  3. 3Find the path MTU

    tracepath -n 10.20.0.5 | grep pmtu

    A pmtu under 1500 explains hanging SSH or HTTPS over VPN.

  4. 4IPv6 path

    tracepath -6 -n 2001:db8:10::1

    Check IPv6 routes separately from IPv4.

  5. 5Limit the hops

    tracepath -n -m 5 8.8.8.8

    Only the first part of the path (your own network).

  6. 6Compare with the routing table

    ip route get 8.8.8.8
    8.8.8.8 via 192.168.122.1 dev enp1s0 src 192.168.122.10 uid 1000

    The first hop must be this gateway.

  7. 7Check if traffic goes through the VPN

    tracepath -n 10.50.1.10

    The first hop should be the VPN address, not the home router.

  8. 8Save the path for a ticket

    tracepath -n www.example.com > /tmp/path-$(date +%F).txt

    Give it to the network or hosting team.

  9. 9Use a fixed port

    tracepath -p 33434 -n server2

    Some firewalls only allow certain UDP ports.

  10. 10When tracepath stops early

    tracepath -n 192.168.200.5

    Endless "no reply" after hop 1: no route or a firewall after your gateway.

Exitcodes

0 :: The destination was reached. 1 :: Not reached or error.

Volledige handleiding

Deze pagina legt het commando uit in eenvoudige woorden. De originele handleiding heeft elk detail.

In je terminal: man 8 tracepath