Failure map by dump pattern
Five common outages leave completely different traces in tcpdump. Switch scenarios to see where the chain
breaks and which line to look for in the output:
- Client✓ sends SYN
- NIC / AF_PACKET✓ SYN in dump
- netfilter input✕ DROP
- Service— never reached
sudo tcpdump -nn -i eth0 'host 198.51.100.20 and tcp port 443' 20:10:01.102114 IP 198.51.100.20.51422 > 203.0.113.10.443: Flags [S], seq 1042100, length 0 20:10:02.118090 IP 198.51.100.20.51422 > 203.0.113.10.443: Flags [S], seq 1042100, length 0 20:10:04.134211 IP 198.51.100.20.51422 > 203.0.113.10.443: Flags [S], seq 1042100, length 0
Identical SYN packets with the same seq arrive at 1 s, 2 s, 4 s intervals with no reply: the incoming frame reached AF_PACKET, then the firewall dropped it silently (tcpdump sees packets before the firewall).
sudo nft list ruleset — look for a climbing drop counter in input or forward.
- Client✓ sends SYN
- Firewall✓ accept
- Socket :8080✕ nobody listening
- Kernel✕ sends RST
sudo tcpdump -nn -i eth0 'host 198.51.100.20 and tcp port 8080' 20:11:15.441002 IP 198.51.100.20.49034 > 203.0.113.10.8080: Flags [S], seq 3950828314, length 0 20:11:15.441018 IP 203.0.113.10.8080 > 198.51.100.20.49034: Flags [R.], seq 0, ack 3950828315, win 0, length 0
Within a fraction of a millisecond the server replied with Flags [R.]: the port is closed, the service only binds 127.0.0.1 (0.0.0.0 vs 127.0.0.1), or the firewall rule is REJECT (DROP vs REJECT).
sudo ss -tulnp 'sport = :8080' — verify whether the service is running and which IP it binds.
- TCP handshake✓ small packets
- TLS / data 1448 B✕ never arrives
- ICMP Frag Needed✕ blocked in path
- Session— stalls retrying
sudo tcpdump -nn -v -i eth0 'host 198.51.100.20 and (tcp port 443 or icmp)' 20:12:00.100012 IP (flags [DF], length 60) 198.51.100.20.52100 > 203.0.113.10.443: Flags [S], options [mss 1460] 20:12:00.100040 IP (flags [DF], length 60) 203.0.113.10.443 > 198.51.100.20.52100: Flags [S.], options [mss 1460] 20:12:00.145200 IP (flags [DF], length 1500) 203.0.113.10.443 > 198.51.100.20.52100: Flags [.], seq 1:1449, length 1448 20:12:00.351004 IP (flags [DF], length 1500) 203.0.113.10.443 > 198.51.100.20.52100: Flags [.], seq 1:1449, length 1448
The tiny SYN/SYN-ACK gets through, while the first full 1500-byte segment with DF repeats with the same seq 1:1449 and gets no ACK — a tunnel along the path has a lower MTU and ICMP Type 3 Code 4 is blocked (MTU blackhole).
ping -M do -c 1 -s 1472 198.51.100.20 (lower -s until replies return) and MSS clamping on the router.
- App✓ A/AAAA query
- Resolver :53✕ ServFail / silence
- TCP :443— never started
sudo tcpdump -nn -i any 'port 53' 20:13:05.001200 eth0 Out IP 10.0.0.11.44102 > 1.1.1.1.53: 51204+ A? api.example.org. (33) 20:13:05.024810 eth0 In IP 1.1.1.1.53 > 10.0.0.11.44102: 51204 ServFail 0/0/0 (33)
The DNS reply returns ServFail (or NXDomain, or repeated queries get no answer at all) — the client never gets to open an IP connection (DNS and dig).
dig @1.1.1.1 api.example.org compared against system dig api.example.org and resolvectl status.
- TCP :443✓ SYN-ACK + ACK
- ClientHello (SNI)✓ sent
- Proxy / server✕ Alert / RST
sudo tcpdump -nn -i eth0 'host 198.51.100.20 and tcp port 443' 20:14:10.010100 IP 198.51.100.20.53010 > 203.0.113.10.443: Flags [P.], seq 1:518, ack 1, length 517 20:14:10.011420 IP 203.0.113.10.443 > 198.51.100.20.53010: Flags [P.], seq 1:8, ack 518, length 7 20:14:10.011455 IP 203.0.113.10.443 > 198.51.100.20.53010: Flags [F.], seq 8, ack 518, length 0
Right after the 517-byte ClientHello, the server returned 7 bytes (a TLS Alert) and closed with FIN — mismatched SNI, TLS version, or cipher list (HTTP and TLS).
openssl s_client -connect 203.0.113.10:443 -servername example.org </dev/null and proxy logs.
Step by step: taking and reading diagnostic dumps
Check basic reachability: SYN, SYN-ACK, RST
When a service “doesn’t respond”, skip capturing the whole stream — grab only handshakes and resets for the affected client and port. Adding
-ttthighlights the gaps between retries right away:sudo tcpdump -nn -ttt -i eth0 'host 198.51.100.20 and tcp port 443 and (tcp[tcpflags] & (tcp-syn|tcp-rst|tcp-fin) != 0)'- Only
Flags [S]arrives every1,2,4seconds — the local firewall (nftables/ufw) is dropping packets before the application sees them. Flags [R.]goes out immediately — the port is closed or aREJECTrule fired.Flags [S.]goes out, yet the client resendsFlags [S]— the reply never makes it back to the client (check the return route and any upstream firewall).
- Only
Catch MTU issues and mid-connection stalls
When connections open fine and then freeze during data transfer, add
-v(to see IPlengthand theDFflag) and includeicmp(IPv4) oricmp6(IPv6) in the filter:sudo tcpdump -nn -v -i eth0 'host 198.51.100.20 and (tcp port 443 or icmp)'Look for two signs:
- The same
seq 1:1449range repeating with IP length1500andflags [DF]— large segments don’t fit through the link and the sender never received notice to shrink them. ICMP ... unreachable - need to frag (mtu 1420)— a router properly reported the smaller MTU, so if 1500-byte packets still keep leaving afterward, inbound ICMP is being dropped on your server.
- The same
Trace DNS queries and lookup timeouts
tcpdumpdecodes DNS headers out of the box: query ID, record type (A?,AAAA?,PTR?,SRV?), response code (NXDomain,ServFail,Refused), and returned IPs. Capture on-i anyso you see both calls to local127.0.0.53(systemd-resolved) and upstream queries leavingeth0:sudo tcpdump -nn -i any 'port 53' # 20:13:05.000110 lo In IP 127.0.0.1.38410 > 127.0.0.53.53: 18291+ A? example.org. (29) # 20:13:05.000420 eth0 Out IP 10.0.0.11.44102 > 1.1.1.1.53: 51204+ A? example.org. (29) # 20:13:05.019105 eth0 In IP 1.1.1.1.53 > 10.0.0.11.44102: 51204 1/0/0 A 203.0.113.10 (45) # 20:13:05.019240 lo In IP 127.0.0.53.53 > 127.0.0.1.38410: 18291 1/0/0 A 203.0.113.10 (45)If queries hit
127.0.0.53whileeth0stays silent, check thesystemd-resolvedconfig or cache. If queries leaveeth0with no reply, outbound port53is blocked or the upstream resolver is unreachable.Verify which SNI leaves in TLS ClientHello
When you see a certificate error (
TRAEFIK DEFAULT CERTorwrong cert), check whether the client sends the expected domain in the SNI extension. The hostname sits in plaintext insideClientHello:# Capture only ClientHello packets on port 443 and print readable strings: sudo tcpdump -nn -A -i eth0 -c 3 'tcp port 443 and (tcp[((tcp[12:1] & 0xf0) >> 2):1] = 0x16) and (tcp[(((tcp[12:1] & 0xf0) >> 2) + 5):1] = 0x01)'Among the non-printable bytes of
-Aoutput, look for the plaintext hostname (for exampleexample.org). If it is missing or shows an old domain, the fault is on the client side (connecting by raw IP without--resolve, or a stale reverse-proxy config).Capture inside a Docker container without installing tools
Minimal images like
alpine,distroless, andscratchdon’t includetcpdump, and there is no need to install packages inside a running container. Run the host’stcpdumpinside the container’s network namespace (netns) viansenter(Linux network stack):# Find the PID of the container's main process: PID=$(docker inspect -f '{{.State.Pid}}' traefik) # Run host tcpdump inside the container's network namespace: sudo nsenter -t "$PID" -n tcpdump -nn -i any 'tcp port 8080'This shows traffic strictly from the container’s point of view — after host DNAT and before host SNAT, free of noise from other services on the server. To compare before and after NAT, open two terminals: one on the host’s
eth0, the other throughnsenterinside the container.
If it doesn’t work
External packets for a container arrive on eth0, but the br-* bridge stays silent
- Cause
- The packet was dropped in the firewall
forwardchain (after DNAT inprerouting), ornet.ipv4.ip_forward = 1is disabled. - Fix
- Check
sysctl net.ipv4.ip_forwardanddropcounters in theforwardchain (sudo nft list ruleset, Docker ports bypass the input chain).
eth0 shows incoming SYN and outgoing SYN-ACK, yet the client still times out and keeps resending SYN
- Cause
- The returning
SYN-ACKis lost on its way back to the client — usually because of asymmetric routing, a wrong gateway, or a firewall at the provider or client side. - Fix
- Check
ip route get <client_IP>on the server and run a simultaneous capture on the client (or intermediate router): ifSYN-ACKleaveseth0but never reaches the client, the break is on the return path.
tcpdump -nn -i eth0 'tcp port 443' shows only encrypted packets, so you cannot tell which domain the client asked for
- Cause
- Everything after the handshake is TLS-encrypted, but the hostname (SNI) travels in plaintext inside the first
ClientHellopacket. - Fix
- Capture
ClientHellowith-Aor-X, or extract it from a saved.pcapviatshark -r cap.pcap -Y 'tls.handshake.type == 1' -T fields -e tls.handshake.extensions_server_name.
nsenter -t <PID> -n tcpdump … against a container reports No such device for eth0
- Cause
- The container runs with
network_mode: hostornone, or it restarted and got a new PID. - Fix
- Re-read the PID with
docker inspect -f '{{.State.Pid}}' <container>and list interfaces viasudo nsenter -t <PID> -n ip -br link.
How to check
Run a short capture on eth0 or lo against a port you know is closed and confirm you get a Flags [S]
followed immediately by Flags [R.]:
sudo tcpdump -nn -ttt -i lo -c 2 'tcp port 8089' &
sleep 0.5 && nc -zv -w 1 127.0.0.1 8089 2>/dev/null; wait
The -ttt delta between the Flags [S] line and the Flags [R.] line should be a fraction of a
millisecond — the textbook signature of a closed port with no firewall DROP.