Linux Networking: Troubleshooting and Diagnostics

Reachability, latency, DNS, proxy, logs, and real-time diagnostics for Linux network incidents.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Reachability and Latency
Ping a host
ping -c 4 example.com

# Send ICMP echo requests to test basic reachability.

Ping with custom interval
ping -i 0.2 -c 20 10.0.0.10

# Send pings at a faster interval.

Test MTU with DF bit
ping -M do -s 1472 8.8.8.8

# Probe MTU problems by forbidding fragmentation.

Generate mtr report
mtr --report --report-cycles 20 example.com

# Run a report mode path-quality test.

Show cURL timing metrics
curl -o /dev/null -s -w 'dns=%{time_namelookup} connect=%{time_connect} tls=%{time_appconnect} total=%{time_total}
' https://example.com

# Print DNS, connect, TLS, and total timings.

Time a DNS lookup
time dig +short example.com

# Measure how long a DNS query takes.

## System Files and Logs
Show systemd-networkd logs
journalctl -u systemd-networkd --since -1h

# Inspect logs for systemd-networkd.

Show systemd-resolved logs
journalctl -u systemd-resolved --since -1h

# Inspect DNS resolver service logs.

Show NetworkManager logs
journalctl -u NetworkManager --since -1h

# Inspect NetworkManager service logs.

Show recent kernel network messages
dmesg --color=always | egrep -i 'eth|ens|eno|link|mtu|tcp|udp|icmp'

# Filter kernel ring buffer for common networking terms.

Monitor link/address changes
ip monitor all

# Watch interfaces, addresses, and routes in real time.

Show historical network counters
sar -n DEV 1 5

# Inspect sar network statistics if sysstat is installed.

## Name Resolution and Proxy Problems
Show proxy environment variables
env | grep -i proxy

# Inspect current shell proxy settings.

Bypass proxy for one request
curl --noproxy '*' https://example.com

# Temporarily skip configured proxies for a single cURL request.

Inspect NSS host order
grep '^hosts:' /etc/nsswitch.conf

# Show how hostname resolution is ordered.

Flush systemd-resolved caches
sudo resolvectl flush-caches

# Clear cached DNS results.

Show link status with networkctl
networkctl status eth0

# Inspect status for a systemd-networkd link.

Recommended next

No recommendations yet.