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, 91 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
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 | ||
ping -t 10 remote.host | • Sets Time-To-Live to 10 hops • packets expire after 10 routers, useful for testing hop limits | ||
sudo ping -f 192.168.1.1 | • Sends packets as fast as possible (requires root) • stress-tests network links and measures maximum throughput | ||
ping6 2001:db8::1 | • Tests IPv6 connectivity using ICMPv6 Echo Request • syntax and behavior similar to IPv4 ping | ||
ping -n 8.8.8.8 | • Skips reverse DNS lookups for faster output • shows only IP addresses not hostnames |