Interview Prep/Linux/Networking, DNS and firewalls

The same request instead hangs and ends with `curl: (28) Failed to connect to 10.0.1.20 port 8080 after 130000 ms: Connection timed out`. How is this different from "refused"?

BeginnerTroubleshootingNetworking, DNS and firewalls
Answer

Likely causes → Packets are silently dropped: a firewall/security group with DROP, wrong routing, host down, or the SYN-ACK can't get back (asymmetric routing).

Diagnose →

ping -c3 10.0.1.20
traceroute -T -p 8080 10.0.1.20
# on the server: are SYNs arriving?
sudo tcpdump -ni any 'tcp port 8080 and tcp[tcpflags] & tcp-syn != 0'

Fix → If no SYNs arrive, fix the security group, NACL or network firewall upstream. If SYNs arrive but no reply leaves, check the host firewall and return routes.

Prevent → Remember the rule: refused means you reached the host; timeout means something dropped the packets.

All Linux questions Roadmap: Linux

More on Networking, DNS and firewalls