Understanding the Error
The system cannot find a route to the destination network.
Quick Diagnosis
# Check routing table
ip route show
route -n
# Check default gateway
ip route | grep default
# Ping gateway
ping -c 4 YOUR_GATEWAY_IP
Fix 1: Check Network Interface Status
ip link show
# Interface should be UP
sudo ip link set eth0 up
# Check IP assignment
ip addr show
Fix 2: Restart Networking
# Ubuntu/Debian
sudo systemctl restart networking
# CentOS/RHEL
sudo systemctl restart network
# Or using nmcli
sudo nmcli networking off
sudo nmcli networking on
Fix 3: Renew DHCP Lease
sudo dhclient -v eth0
# Or
sudo dhcpcd eth0
Fix 4: Add Default Gateway Manually
# Find gateway from provider info
sudo ip route add default via GATEWAY_IP
# Make permanent (Ubuntu netplan example)
network:
ethernets:
eth0:
dhcp4: no
addresses: [YOUR_IP/24]
gateway4: GATEWAY_IP
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
Fix 5: Check Firewall Rules
sudo iptables -L -n
# Look for DROP or REJECT rules on OUTPUT chain
Fix 6: IPv6 vs IPv4
Try forcing IPv4:
ping -4 google.com
curl -4 http://example.com
Disable IPv6 if problematic:
# Add to /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
sudo sysctl -p
For VPS After Reinstall
Sometimes network config resets. Check with Hostxpeed support for correct network configuration or use the "Network Reset" option in control panel.