Networking & Firewall (Ss/Netstat/Iptables/Nftables/Curl)
Quit guessing why your curl request is timing out
đź§© The Challenge
You are staring at a production API that just won’t talk to your app, and curl is giving you zero useful info other than a generic connection timeout. I have spent way too long staring at “Connection timed out” while the actual firewall rule was just silently dropping packets right under my nose.
đź’ˇ The Fix
Stop asking curl for the response body and start asking it to show you the guts of the TCP handshake and the local interface it picked. This saves you from debugging the wrong network hop when the route is actually dead on the source host.
curl -v --trace-time --interface eth0 http://api.internal.service
⚙️ Why It Works
By forcing the interface and bumping the verbosity, you force curl to show you the exact local IP it binds to and where the handshake hangs. It cuts out the guesswork when you have multi-homed servers and split-brain routing tables.
🚀 Pro-Tip: Pipe it into a temporary file if the trace is massive so you can actually read the timestamps.
Linux Tips & Tricks | © ngelinux.com | 9/20/2026
