Lesson 9 of 9 · 28m
Debugging Connectivity with Evidence, Not Folklore
Use ping, traceroute, ss, tcpdump, curl, nft counters, and route lookups in a disciplined order that isolates the failure domain.
The senior network engineer's advantage is not a secret command. It is sequencing. They ask where the packet was last seen, what decision should happen next, and which observation would disprove the current theory. Beginners change five things at once; operators narrow the failure domain until only one explanation survives.
Define the flow precisely
Before touching tools, write the tuple:
source IP/interface -> destination IP:port/protocol -> expected return path
example: 10.8.0.2/wg0 -> 203.0.113.20:443/tcp -> reply via wg0 after SNAT'The app cannot connect' is not a tuple. Neither is 'the network is slow.' Once you have the tuple, every command becomes a measurement rather than a ritual.
Follow a ladder of increasing specificity
Start local, then move outward:
ip -brief addr
ip route get 203.0.113.20
ip neigh show
ss -tulpen | grep -E '(:443|:53)'
ping -c 3 192.0.2.1
ping -c 3 203.0.113.20ss answers whether a local service exists and which namespace or process owns it. Route lookup answers where the kernel thinks packets should go. Gateway reachability tests the local link. Remote reachability tests the broader path. Skipping steps creates false confidence.
Use tcpdump as a microscope
Capture where the packet should exist:
sudo tcpdump -ni any host 203.0.113.20 and port 443Then compare interfaces:
sudo tcpdump -ni wg0 host 203.0.113.20
sudo tcpdump -ni eth0 host 203.0.113.20The key question is not 'did tcpdump show anything?' It is 'where did the flow disappear or change shape?' any is convenient but strips directionality detail; interface-specific captures make NAT and forwarding transitions clearer. Remember that tcpdump often observes packets before local firewall drops, so presence does not prove acceptance.
Test the actual protocol
ICMP success does not prove TCP 443 works. UDP is even less cooperative because silence can mean success, filtering, or application indifference. Use application-shaped tests:
curl -vk --connect-timeout 5 https://203.0.113.20/ 2>&1 | head -40
nc -vz -w3 203.0.113.20 443
dig @192.0.2.53 example.internalcurl -v separates DNS, TCP connect, TLS handshake, and HTTP response timing. Those are different failure domains. nc confirms basic TCP reachability when you do not need protocol correctness. dig isolates resolver behavior better than a browser ever will.
Know what traceroute can and cannot say
traceroute -n 203.0.113.20
mtr -n 203.0.113.20Traceroute infers hops from TTL expiry. Some routers do not answer; some deprioritize ICMP; some paths differ per flow. Stars are ambiguity, not proof of a firewall. mtr is better for loss patterns because repeated measurement beats one heroic probe.
Change one variable and keep a log
Write down commands, timestamps, observations, and rollback state. Network incidents are frequently intermittent, so your own notes become the only trustworthy dataset. If a change 'fixes' the problem but you do not know which of five edits did it, you have not fixed it; you have merely disturbed the crime scene.
Field notes
- Test from the exact source context: same namespace, interface, user, and source address whenever possible.
- DNS failure can masquerade as network failure; test IP reachability before name resolution.
- A listening socket on
127.0.0.1will never answer remote clients, no matter how open the firewall is. localhostcan resolve differently across IPv4 and IPv6;ssreveals which family actually listens.- In production, prefer counters and short captures over huge packet dumps; evidence quality beats packet quantity.
Was this lesson helpful?