Network troubleshooting commands are essential command-line utilities that diagnose connectivity issues, analyze traffic patterns, and verify network configurations across Layer 2 through Layer 7 of the OSI model. These tools range from basic reachability tests like ping and traceroute to advanced packet capture with tcpdump and comprehensive port scanning with nmap. The key insight: effective troubleshooting moves systematically through the network stack — test physical connectivity first, then routing, then DNS, then application-level protocols — and the right tool at each layer saves hours of guesswork.
What This Cheat Sheet Covers
This topic spans 15 focused tables and 182 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Basic Connectivity Testing (ICMP)
ping is almost always the first command anyone runs when a network feels broken — it answers the simplest question, "can these two hosts even reach each other?", and reports loss and round-trip time along the way. The flags below turn that blunt test into something sharper: capping the count for a quick check, varying packet size to flush out MTU problems, or skipping reverse DNS so results come back instantly.
| Command | Example | Description |
|---|---|---|
ping -c 4 google.com | • Sends ICMP Echo Request packets to test reachability and measure round-trip time (RTT) • returns packet loss percentage and latency statistics | |
ping -c 10 192.168.1.1 | • Sends exactly 10 ICMP packets then stops • useful for quick tests without manual interruption | |
ping -s 1400 host.com | • Tests with custom packet size (1400 bytes) • helps identify MTU issues or fragmentation problems | |
ping -i 0.2 10.0.0.1 | • Sends packets every 0.2 seconds instead of default 1 second • faster testing but requires root on Linux | |
ping -w 5 example.com | • Stops after 5 seconds regardless of packet count • prevents hanging on unreachable hosts |