field notes

Notes on small systems and the tools around them.

Checking that a port is really open

The fastest honest test is a plain TCP connect, not a ping. ICMP is filtered on many networks, which makes it lie in both directions.

timeout 5 bash -c "echo > /dev/tcp/host/port" && echo open

If that fails from one network but works from another, the host is fine and the path between them is the problem. Only then is it worth reaching for mtr.