# connect: Network is unreachable (ENETUNREACH)

**Code:** `Network is unreachable` · **Category:** Linux · **Seen on:** Linux

The host has no route to the destination network — no default gateway, interface down, or trying IPv6 without IPv6 connectivity.

## 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

1. Check routes: ip route and ip -6 route
2. Bring the interface up and renew DHCP
3. Prefer IPv4 (-4 flag) if IPv6 isn’t available

## Detailed fix by platform

### Linux

1. 

```bash
ip -br addr
ip route
sudo dhclient -v eth0   # or: sudo netplan apply
curl -4 https://example.com
```


## How to diagnose

1. **Routes** — default via … present?
2. **Interface** — UP with an address?
3. **Family** — IPv6 address being used?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/linux/network-is-unreachable)
