Skip to content

Network Troubleshooting

When something breaks you need to find out where
Network troubleshooting is a systematic process of elimination following the OSI model from bottom to top checking each layer until you find where communication fails

Physical Layer Check

# Link status
ip link show eth0                # Check if interface is UP
ethtool eth0                     # Link detected? Speed? Duplex?

# Wireless
iwconfig                         # WiFi connection status
nmcli device status              # NetworkManager status

Layer 3 (IP) Check

# Interface configuration
ip addr show                     # Check assigned IP
ip route show                    # Default gateway present?
ping -c 4 8.8.8.8               # Raw IP connectivity
ping -c 4 google.com            # DNS resolution + connectivity

DNS Resolution

# Is DNS working?
host google.com
dig google.com
nslookup google.com

# Compare DNS servers
dig @8.8.8.8 google.com          # Test against Google DNS
dig @1.1.1.1 google.com          # Test against Cloudflare DNS

Traceroute

# Path discovery
traceroute google.com            # Find where packets drop
mtr google.com                   # Continuous monitoring (best tool)

Port Connectivity

# TCP port check
nc -zv 192.168.1.1 22           # Quick port check
nc -zvw 5 10.0.0.1 443          # With timeout

# Port scanning
nmap -sT -p 22,80,443 target    # TCP connect scan
nmap -sS -p 1-1000 target       # SYN stealth scan

# Service check
curl -I http://target:8080       # Is web server responding?
telnet target 3306               # Raw connection to MySQL port

Packet Capture Analysis

# Live capture
tcpdump -i eth0 -n              # Show packets (no DNS resolution)
tcpdump -i eth0 port 443        # Filter to HTTPS port
tcpdump host 192.168.1.100     # Filter to specific host
tcpdump -w capture.pcap        # Save for analysis
tcpdump -r capture.pcap        # Read saved capture

# Advanced tcpdump filters
tcpdump -i eth0 tcp[13] == 2   # SYN packets only
tcpdump -i eth0 icmp           # ICMP only

Bandwidth and Latency

# Speed test
iperf -c server                 # Measure bandwidth
iperf -c server -u             # UDP bandwidth

# Latency measurement
ping -c 100 target              # Packet loss and RTT stats
mtr target                      # Per-hop latency

Common Issues Quick Reference

Symptom Likely Cause
Can ping IP but not hostname DNS resolution failure
Can't ping anything but interface is up No gateway route
Partial traceroute then stops Firewall blocking ICMP or specific hop
Port shows filtered in nmap Firewall dropping (no response)
Intermittent connectivity Duplex mismatch or high utilization
Slow DNS Upstream resolver overloaded
SSL/TLS errors Time sync issue or expired certificate