`curl: (28) Failed to connect to api.internal port 443 after 130001 ms: Connection timed out`
BeginnerTroubleshootingConnectivity: refused, timed out, no route
Answer
Likely causes → SYN packets got no reply at all. Something silently dropped them: security group, NACL, host firewall with DROP, a missing route back, or the host is down.
Diagnose →
nc -vz -w 3 api.internal 443
traceroute -T -p 443 api.internal
# on the target, are SYNs arriving?
sudo tcpdump -ni any 'tcp port 443 and tcp[tcpflags] & tcp-syn != 0'
Fix → If SYNs never arrive, fix the path (SG, NACL, route). If they arrive but no SYN-ACK leaves, fix the host firewall or listening service. If SYN-ACK leaves but the client never sees it, look for asymmetric return routing.
Prevent → Use short connect timeouts (curl --connect-timeout 5) so failures surface fast, and keep firewall rules in code.
More on Connectivity: refused, timed out, no route
`curl: (7) Failed to connect to 10.0.2.15 port 8080: Connection refused`Beginner`ssh: connect to host 10.1.4.20 port 22: No route to host`BeginnerService works with `curl localhost:3000` on the box but times out from other hosts.Beginner`ping` works but `curl` to port 80 on the same host times out.Beginner`curl` to a public site works, but `ping 8.8.8.8` shows 100% packet loss.Beginner`nc: connect to db.internal port 5432 (tcp) failed: Connection refused`, yet PostgreSQL is running.Beginner