`connect: Cannot assign requested address` when the app opens outbound connections.
IntermediateTroubleshootingConnectivity: refused, timed out, no route
Answer
Likely causes → Ephemeral port exhaustion toward one destination IP:port (EADDRNOTAVAIL), or the app tries to bind to a source IP not on the host.
Diagnose →
sysctl net.ipv4.ip_local_port_range
ss -tan state time-wait | wc -l
ss -tan dst 10.0.5.9:443 | wc -l
Fix → Reuse connections (HTTP keep-alive, pooling), widen ip_local_port_range (e.g. 1024 65000), enable net.ipv4.tcp_tw_reuse=1 for outbound, or spread traffic across more destination IPs.
Prevent → Track outbound connection rate and TIME_WAIT counts; insist on pooling in client libraries.
More on Connectivity: refused, timed out, no route
`curl: (7) Failed to connect to 10.0.2.15 port 8080: Connection refused`Beginner`curl: (28) Failed to connect to api.internal port 443 after 130001 ms: Connection timed out`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