Systematic Approach
When diagnosing network issues, work from the bottom up: physical → IP → routing → DNS → application.
Step 1: Check Interface Status
# Is the interface up?
ip link show
# Check IP addresses
ip addr show
# Check for errors
ip -s link show eth0Step 2: Test Local Connectivity
# Ping the gateway
ip route show default
ping -c 3 198.48.63.1
# Check ARP table
ip neigh showStep 3: Test External Connectivity
# Ping a public IP (bypasses DNS)
ping -c 3 1.1.1.1
# Trace the route
traceroute 1.1.1.1
# or with MTR for continuous monitoring
mtr 1.1.1.1Step 4: Test DNS Resolution
# Test DNS
dig example.com
nslookup example.com
# Check DNS configuration
cat /etc/resolv.conf
# Test specific DNS server
dig @1.1.1.1 example.comStep 5: Test Application Layer
# Test HTTP
curl -v http://example.com
# Test specific port
nc -zv example.com 443
ss -tlnp | grep :80Common Issues and Fixes
| Symptom | Likely Cause | Fix |
|---|---|---|
| No IP address | DHCP failure | dhclient eth0 |
| Can ping IP, not hostname | DNS issue | Check /etc/resolv.conf |
| Connection refused | Service not running | Check with ss -tlnp |
| Connection timed out | Firewall blocking | Check iptables -L or nft list ruleset |
| Packet loss | Network congestion | Use mtr to find the hop |
Useful Diagnostic Tools
# Show all listening ports
ss -tlnp
# Monitor bandwidth
iftop -i eth0
# Capture packets
tcpdump -i eth0 port 80 -c 100
# Check firewall rules
iptables -L -n -v
nft list ruleset