A Linux VPS is a powerful tool for hosting websites, applications, and various services. However, networking issues can sometimes disrupt connectivity, leading to downtime or performance degradation. In this guide, we'll discuss common Linux VPS network problems and how to troubleshoot and fix them effectively.
1. SSH Connection Issues
Problem: Unable to connect to VPS via SSH
- Error Messages: "Connection timed out," "Connection refused," or "No route to host."
Causes:
- Incorrect SSH configuration
- Firewall blocking port 22
- SSH service not running
- Network connectivity issues
Fixes:
-
Check if SSH service is running:
systemctl status sshd # For systemd-based distributions service ssh status # For older systemsIf not running, restart it:
systemctl restart sshd -
Ensure SSH is listening on the correct port:
netstat -tulnp | grep sshIf SSH is not listening on port 22, check and modify the
/etc/ssh/sshd_configfile. -
Check firewall rules:
sudo ufw status # For Ubuntu/Debian sudo iptables -L | grep 22 # For manual firewall setupsIf blocked, allow SSH access:
sudo ufw allow 22/tcp sudo systemctl restart ufw -
Verify VPS network connectivity:
ping 8.8.8.8 # Google DNS traceroute google.comIf no response, there might be an issue with the VPS provider’s network settings.
2. DNS Resolution Issues
Problem: Unable to resolve domain names
- Error Messages: "Temporary failure in name resolution."
Causes:
- Missing or misconfigured DNS settings
- Firewall blocking DNS queries
- Network misconfiguration
Fixes:
-
Check DNS configuration in
/etc/resolv.conf:cat /etc/resolv.confIf missing, add Google’s public DNS:
echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf -
Restart networking service:
systemctl restart networking -
Check for firewall blocking DNS (port 53):
sudo iptables -L | grep 53If blocked, allow it:
sudo iptables -A INPUT -p udp --dport 53 -j ACCEPT
3. Internet Connectivity Issues
Problem: No internet access inside the VPS
- Error Messages: "Network is unreachable."
Causes:
- Incorrect default gateway
- Network interface down
- Firewall blocking outgoing connections
Fixes:
-
Check the default route:
ip route showIf missing, add a default route:
sudo ip route add default via YOUR_GATEWAY_IP -
Restart network interface:
sudo ifconfig eth0 down sudo ifconfig eth0 upOr using
ipcommand:sudo ip link set eth0 down sudo ip link set eth0 up -
Check for blocked outgoing traffic:
sudo iptables -L -v -nIf outgoing traffic is blocked, reset firewall rules:
sudo iptables --flush
4. High Packet Loss & Slow Network Speed
Problem: Slow network performance, packet loss
Causes:
- Network congestion
- VPS provider bandwidth limitations
- Overloaded network interface
Fixes:
-
Check network statistics:
ifconfig eth0 | grep errorsIf high errors, restart the network interface:
sudo systemctl restart networking -
Test packet loss:
ping -c 10 google.comIf high packet loss occurs, contact the VPS provider.
-
Limit bandwidth usage: If you’re running heavy downloads/uploads, use traffic control:
sudo tc qdisc add dev eth0 root tbf rate 10mbit burst 32kbit latency 400ms
5. Network Interface Not Detected
Problem: No network interface is detected on the VPS.
Causes:
- Corrupt network configuration
- Incorrect network adapter settings
- Kernel module issues
Fixes:
-
Check available interfaces:
ip link showIf no interfaces appear, reload the network service:
sudo systemctl restart networking -
Reconfigure the network interface: Edit
/etc/network/interfaces(Debian/Ubuntu) or/etc/sysconfig/network-scripts/ifcfg-eth0(CentOS/RHEL) and restart the service. -
Check kernel modules for network drivers:
lsmod | grep netIf missing, load the required module:
sudo modprobe e1000
Conclusion
Linux VPS network issues can arise for various reasons, but with systematic troubleshooting, you can quickly identify and fix them. By checking SSH access, DNS settings, firewall rules, and network interfaces, you can maintain a stable and secure VPS connection. If persistent problems occur, contacting your VPS provider may be necessary to rule out infrastructure-related issues.
By following this guide, you’ll be well-equipped to resolve common Linux VPS network problems efficiently.

Comments
Post a Comment