Interview Prep/Networking/Connectivity: refused, timed out, no route

`curl: (7) Failed to connect to 10.0.2.15 port 8080: Connection refused`

BeginnerTroubleshootingConnectivity: refused, timed out, no route
Answer

Likely causes → The packet reached the host and the kernel answered with a TCP RST: nothing is listening on that port, the app is bound to 127.0.0.1 only, or a local firewall rule uses REJECT --reject-with tcp-reset.

Diagnose →

# on the server
ss -ltnp | grep 8080
systemctl status myapp
sudo iptables -S | grep -i reject

Fix → Start the service, or change the bind address from 127.0.0.1 to 0.0.0.0 (or the specific interface IP). Remove the reject rule if it is unintended.

Prevent → Add a readiness check that verifies the port is listening, and alert on process restarts.

All Networking questions Roadmap: Networking for DevOps

More on Connectivity: refused, timed out, no route