How to Fix Network Is Unreachable on Linux
Diagnose Linux network is unreachable errors by checking interfaces, addresses, routes, gateways, policy routing, namespaces, and network managers.
Network is unreachable means the Linux kernel could not find a usable route for the destination from the current network namespace. The problem usually appears before DNS, firewalls, or the remote service matter: the local host lacks an active interface, source address, route, or reachable gateway for that address family.
Separate name resolution from routing
Record the destination addresses:
getent ahosts example.com
Then test a known IP directly:
ping -c 3 1.1.1.1
ping -c 3 2606:4700:4700::1111
If IPv4 works but IPv6 reports Network is unreachable, the hostname may prefer an AAAA record while the host has no IPv6 route. Test each family explicitly, but fix addressing or DNS policy instead of permanently forcing IPv4 without understanding the environment.
Ask the kernel for the selected route
ip route get DESTINATION_IP
ip -6 route get DESTINATION_IPV6
A successful result shows the chosen interface, gateway, source address, and routing table. A failure confirms that the current namespace has no matching usable route.
Display routes and policy rules:
ip route show table all
ip -6 route show table all
ip rule show
Policy routing can send traffic to a table different from the familiar main table. Compare the destination and source address with every matching rule.
Check interfaces and addresses
ip -brief link
ip -brief address
Confirm the intended interface is UP and has the expected address and prefix. Also inspect carrier state:
ip link show INTERFACE
cat /sys/class/net/INTERFACE/carrier
A configured address does not guarantee a physical or virtual link is usable. For Wi-Fi, bonds, bridges, VLANs, VPNs, and cloud interfaces, inspect the relevant manager or controller as well.
Verify the gateway path
Identify the default or destination-specific gateway:
ip route show default
ip neigh show
The gateway must be reachable through an on-link route. A wrong prefix length can make a valid gateway appear off-link. Neighbor states such as FAILED or INCOMPLETE point to a local Layer 2, VLAN, bridge, or gateway issue rather than the remote destination.
Do not add a default route until you know which interface, metric, gateway, and routing table the network design requires.
Check the current network namespace
Containers and services may run in a different namespace from your shell:
ip netns list
lsns -t net
When policy permits, run ip address, ip route, and ip rule inside the affected container or process namespace. A working host route does not prove the container namespace has an interface or default route.
Inspect the network manager and logs
Depending on the distribution:
systemctl status NetworkManager systemd-networkd --no-pager
sudo journalctl -u NetworkManager -u systemd-networkd --since "30 minutes ago"
Look for DHCP expiration, duplicate addresses, failed routes, interface renames, VPN changes, or configuration rejected during boot. In cloud environments, also verify that the virtual interface is attached and that the expected subnet and route configuration reached the guest.
Distinguish related errors
Network is unreachable: no usable local route.No route to host: can also result from an ICMP unreachable response or firewall rejection.Connection timed out: a route exists, but no response completed the connection.Connection refused: the destination responded without a listener on that port.
Use the exact message and ip route get result to avoid debugging a remote service when the failure is local.
Diagnose it with Rumus

Rumus is an AI-native terminal that can investigate the actual Linux host. Its agent reads relevant files, services, logs, processes, and system state, then proposes a reviewable plan before making changes.
What Rumus can inspect
- Services, processes, sockets, and system resources
- Logs, configuration files, permissions, and ownership
- Read-only evidence before cleanup or restarts
Diagnose this Linux Network is unreachable error. Resolve and test each destination
address family; inspect the kernel route decision, interfaces, addresses, carrier,
all route tables and policy rules, gateway neighbor state, network namespace,
network manager state and recent logs. Start read-only and do not add routes,
restart networking, change interfaces, or disconnect VPNs without approval.
Confirm the fix
Repeat the kernel route lookup and test the original protocol:
ip route get DESTINATION_IP
ping -c 3 GATEWAY_IP
Confirm the selected interface, source, gateway, and table match the intended design. Test from the actual affected service or namespace, and verify the route remains present after the network manager reloads or the host reboots.
Open the server in Rumus and let the AI agent inspect context, propose a plan, and ask before it runs changes.