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

Quick reachability and path diagnostics for incidents.

Ping a host

Send ICMP echo requests to test basic reachability.

bashLINUXpingicmpreachability
bash
ping -c 4 example.com
Notes

Send ICMP echo requests to test basic reachability.

Ping with custom interval

Send pings at a faster interval.

bashLINUXpinglatencyicmp
bash
ping -i 0.2 -c 20 10.0.0.10
Notes

Send pings at a faster interval.

Test MTU with DF bit

Probe MTU problems by forbidding fragmentation.

bashLINUXpingmtufragmentation
bash
ping -M do -s 1472 8.8.8.8
Notes

Probe MTU problems by forbidding fragmentation.

Generate mtr report

Run a report mode path-quality test.

bashLINUXmtrreportlatency
bash
mtr --report --report-cycles 20 example.com
Notes

Run a report mode path-quality test.

Show cURL timing metrics

Print DNS, connect, TLS, and total timings.

bashLINUXcurltiminglatency
bash
curl -o /dev/null -s -w 'dns=%{time_namelookup} connect=%{time_connect} tls=%{time_appconnect} total=%{time_total}
' https://example.com
Notes

Print DNS, connect, TLS, and total timings.

Time a DNS lookup

Measure how long a DNS query takes.

bashLINUXdnstimingdig
bash
time dig +short example.com
Notes

Measure how long a DNS query takes.

System Files and Logs

Inspect kernel, resolver, and network service logs.

Show systemd-networkd logs

Inspect logs for systemd-networkd.

bashLINUXjournalctlnetworkdlogs
bash
journalctl -u systemd-networkd --since -1h
Notes

Inspect logs for systemd-networkd.

Show systemd-resolved logs

Inspect DNS resolver service logs.

bashLINUXjournalctlresolveddns
bash
journalctl -u systemd-resolved --since -1h
Notes

Inspect DNS resolver service logs.

Show NetworkManager logs

Inspect NetworkManager service logs.

bashLINUXjournalctlnetworkmanagerlogs
bash
journalctl -u NetworkManager --since -1h
Notes

Inspect NetworkManager service logs.

Show recent kernel network messages

Filter kernel ring buffer for common networking terms.

bashLINUXdmesgkernelnetwork
bash
dmesg --color=always | egrep -i 'eth|ens|eno|link|mtu|tcp|udp|icmp'
Notes

Filter kernel ring buffer for common networking terms.

Monitor link/address changes

Watch interfaces, addresses, and routes in real time.

bashLINUXipmonitorrealtime
bash
ip monitor all
Notes

Watch interfaces, addresses, and routes in real time.

Show historical network counters

Inspect sar network statistics if sysstat is installed.

bashLINUXsarnetworkhistory
bash
sar -n DEV 1 5
Notes

Inspect sar network statistics if sysstat is installed.

Name Resolution and Proxy Problems

Test proxy settings, NSS, and resolver mismatches.

Show proxy environment variables

Inspect current shell proxy settings.

bashLINUXproxyenvironmentshell
bash
env | grep -i proxy
Notes

Inspect current shell proxy settings.

Bypass proxy for one request

Temporarily skip configured proxies for a single cURL request.

bashLINUXcurlproxybypass
bash
curl --noproxy '*' https://example.com
Notes

Temporarily skip configured proxies for a single cURL request.

Inspect NSS host order

Show how hostname resolution is ordered.

bashLINUXnsswitchdnshosts
bash
grep '^hosts:' /etc/nsswitch.conf
Notes

Show how hostname resolution is ordered.

Flush systemd-resolved caches

Clear cached DNS results.

bashLINUXresolvectldnscache
bash
sudo resolvectl flush-caches
Notes

Clear cached DNS results.

Show link status with networkctl

Inspect status for a systemd-networkd link.

bashLINUXnetworkctlsystemdinterface
bash
networkctl status eth0
Notes

Inspect status for a systemd-networkd link.

Recommended next

No recommendations yet.