brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: traceroute -T follows the path with TCP packets where a firewall blocks the normal probes

Linux
~/tips/tip-linux-traceroute-t-tcp

traceroute -T -p 443 -n example.com

Trace the route to a web server with packets that a firewall lets through.

A normal traceroute often ends in a row of stars, because firewalls drop the UDP or ICMP probes it sends. Traffic to the port of a web server usually does get through, so trace with that instead.

traceroute -T -p 443 -n example.com

-T uses TCP SYN packets as probes, the same first packet a browser sends. The man page notes that the default port for this method is 80; -p 443 picks the HTTPS port instead. -n skips the reverse DNS lookup for every hop, which makes the output appear a lot faster.

The method is half open: traceroute never completes the connection, so the application on the other end does not see a real connection. If the last hop answers, you know the path to the port is open all the way. If the stars start at a fixed hop, that is where the traffic stops.

When it’s unclear what blocks what, I’d compare it with an ICMP trace:

traceroute -I -n example.com

The TCP method needs raw sockets, so run it with sudo. It belongs to the classic traceroute package; the tracepath tool and some BusyBox builds do not have -T. Routers in between may still drop or rate limit the replies they send back, so a single missing hop in the middle is no reason to worry while the hops after it answer.

Further reading: traceroute(8) manual page

More Linux tips a2query -m rewrite renice -n 10 -p 4242 cat config.yml | xsel -ib xvfb-run -a your-program --some-flag dpkg --get-selections > packages.txt All Linux tips (261) All topics

Link