Practical steps to probe ports and debug services using nc. 16.11.2025 | reading time: 2 min A service fails to respond and the log is silent; is the port open, filtered, or the service dead? Use `nc` to check connectivity and move from guessing to proof. Live Demo: Local Probe Start a simple TCP listener on port 12345: ```bash nc -l 12345``` In another terminal connect and send a line: ```bash nc -v 127.0.0.1 12345``` Example server output might show: ```Connection from 127.0.0.1 56789``` and the client will display whatever the server echoes back. Quick Scan: Does it exist? Probe a remote host port without sending data using a zero-I/O scan: ```bash nc -zv 203.0.113.10 22``` Typical output is either "succeeded" or "refused" which tells whether TCP connect succeeded or the port is closed, and a timeout suggests filtering. UDP and Timeouts Test UDP services with the `-u` flag and set a short timeout to avoid long waits: ```bash nc -u -w 2 10.0.0.5 53``` Note that UDP is connectionless, so lack of reply can mean no service or a filtered path; pair UDP tests with packet captures for certainty. Power Features Useful knobs include `-z` for scanning without data, `-v` for verbose status, `-w` to set timeouts, `-u` for UDP, and `-6` for IPv6; combine port ranges like `1-1024` to batch-check ports, but respect rate and permission boundaries. When nc is not enough For richer discovery, use a scanner that understands service signatures and timing; to inspect local sockets use kernel-level tools; and for raw forwarding or proxying try a more feature-rich utility. Final Thought Mastering `nc` turns network mysteries into verifiable facts; keep practicing with live examples and expand into tools that add protocol awareness for deeper troubleshooting, and consider formal Linux study like CompTIA Linux+ or LPIC-1 with intensive exam preparation at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. network utilities security troubleshooting