Networking: nc -vz hangs then times out — firewall silently DROPs packets (REJECT would answer "Connection refused")
A connection attempt gets no answer at all, which points to a firewall dropping the packets rather than a closed port.
nc: connect to port (timed out)Connection timed out firewall droptelnet hangs on TryingOperation timed out firewall DROP vs REJECTport filtered Meaning
"Connection refused" comes back instantly when a host or firewall REJECTs; a long hang then timeout means DROP or an unreachable path. Compare from another network, check security groups/NACLs/iptables/ufw, and use tcpdump on both ends to see whether SYN packets arrive.
Common causes
- Firewall or security-group DROP rule
- Cloud network ACL or NSG without an allow
- Port closed with iptables DROP
- Wrong IP or routing blackhole
- Provider blocking the port
⚡ Quick fix
nc -vz -w5 host portand note instant refuse vs hang- Allow the port in the security group/firewall
- Capture:
sudo tcpdump -ni any "tcp port 443 and host 1.2.3.4"
Detailed fix by platform
Linux
- bash
nc -vz -w5 203.0.113.10 443 sudo iptables -L INPUT -n -v --line-numbers | head -30
How to diagnose
- Failure — Instant refuse or hang?
- SYN — Seen on server?
- Rule — DROP or REJECT?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- 1020 Cloudflare Error 1020: Access Denied
- 40615 Azure SQL: Cannot open server 'x' requested by the login. Client with IP address 'y' is not allowed to access the server (Error 40615)
- Cannot assign requested address (EADDRNOTAVAIL) Networking: connect: Cannot assign requested address — ephemeral port range exhausted by TIME_WAIT connections
Most viewed in Networking
- Native VLAN mismatch / wrong VLAN, no connectivity Networking: %CDP-4-NATIVE_VLAN_MISMATCH / device on the wrong VLAN can't reach the gateway
- Port err-disabled (psecure-violation) Networking: %PM-4-ERR_DISABLE: psecure-violation error detected on Gi0/5, putting Gi0/5 in err-disable state
- Rogue DHCP server hands out wrong gateway/DNS Networking: Clients receive the wrong default gateway or DNS server — a rogue DHCP server (often a home router) answers first
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026