connect: Network is unreachable (ENETUNREACH)
The host has no route to the destination network — no default gateway, interface down, or trying IPv6 without IPv6 connectivity.
Seen on:
Linux
Meaning
The kernel fails immediately because the routing table has no route. Typical: the network interface is down, DHCP didn’t set a default gateway, or an IPv6 address was chosen on an IPv4-only network.
Common causes
- No default route (gateway missing)
- Interface down / cable/Wi-Fi disconnected
- IPv6 destination on an IPv4-only network
- VPN changed routes
⚡ Quick fix
- Check routes: ip route and ip -6 route
- Bring the interface up and renew DHCP
- Prefer IPv4 (-4 flag) if IPv6 isn’t available
Detailed fix by platform
Linux
- bash
ip -br addr ip route sudo dhclient -v eth0 # or: sudo netplan apply curl -4 https://example.com
How to diagnose
- Routes — default via … present?
- Interface — UP with an address?
- Family — IPv6 address being used?
🔧 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
Most viewed in Linux
Other ways to find it
🧠 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026