Network Connectivity Troubleshooting Guide
Initial Symptoms
Commands like
ping pool.ntp.org
freeze the consoleping -c 4 8.8.8.8
times outcurl -I http://pool.ntp.org
hangsmtr
andtraceroute
show no relevant data
Diagnostic Steps
1. Basic Network Interface Check
ip link show
ip a
Expected:
- Interface should show state UP
- Should have valid IP address
2. Routing Table Verification
ip route
Expected:
Default gateway route present (e.g.,
default via 192.168.1.1 dev eth0
)
3. DNS Resolution Test
nslookup google.com
dig google.com
Fallback DNS Configuration:
echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf
4. Raw TCP Connection Test
nc -zv 8.8.8.8 80
telnet 8.8.8.8 80
5. Firewall Inspection
sudo iptables -L
sudo nft list ruleset
Temporary Firewall Disable:
sudo iptables -F
sudo nft flush ruleset
6. Network Service Restart
sudo systemctl restart NetworkManager
# For headless servers:
sudo systemctl restart networking # Debian/Ubuntu
sudo systemctl restart network # RHEL/CentOS
7. Kernel-Level Network Debugging
sudo netstat -i
sudo ethtool -S eth0
sudo sysctl net.ipv4.icmp_echo_ignore_all
8. Advanced Diagnostics
Packet Capture:
sudo tcpdump -i eth0 icmp
Strace Analysis:
strace -o ping.log ping -c 1 8.8.8.8
grep -E 'connect|sendto|poll' ping.log
Critical Findings
From strace output: .. code-block:: text
connect(4, {sa_family=AF_INET, sin_port=htons(1025), sin_addr=inet_addr(“8.8.8.8”)}, 16) = 0 sendto() = 64 # Packets sent successfully poll() = 0 (Timeout) # No replies received
Root Cause Analysis
Outbound packets are being sent (sendto succeeds)
No inbound replies received (poll timeouts)
Possible causes:
Gateway not forwarding packets
ISP blocking ICMP
Middlebox filtering traffic
Recommended Solutions
Gateway Testing:
Ping from router’s admin interface
Check router’s WAN connection
Network Bypass Test:
sudo ip route del default
sudo ip route add default via <alternate_gateway> dev <interface>
ISP Verification:
Test with VPN connection
Contact ISP if gateway cannot ping 8.8.8.8
System Configuration:
sudo sysctl -w net.ipv4.icmp_echo_ignore_all=0
Additional Notes
Time updates suggest intermittent NTP functionality
Consider checking chrony/NTPD configuration
For persistent issues, test with Live USB to isolate hardware problems