๐ง Network Troubleshooting
The commands every tech person uses to diagnose network problemsโฑ ~3 min
A doctor doesn't guess randomly โ they follow a sequence: take vitals โ check symptoms โ run tests โ narrow it down. Network troubleshooting follows the same logic: start from the bottom of the network stack (physical) and work up. Is the cable plugged in? Can you reach the router? Can you reach the internet? Can you reach the specific site? Each step narrows the problem.
The Standard Troubleshooting Sequence
- 1.ping 127.0.0.1 โ test the loopback. If this fails, your network stack is broken (reinstall drivers)
- 2.ping [default gateway] โ e.g., ping 192.168.1.1. If this fails, you can't reach your router (cable? WiFi?)
- 3.ping 8.8.8.8 โ ping Google's DNS by IP. If this fails, your router can't reach the internet (ISP issue)
- 4.ping google.com โ ping by name. If this succeeds after step 3, DNS is working normally
- 5.If step 3 works but step 4 fails โ DNS is the problem (try setting DNS to 8.8.8.8 manually)
Essential Commands
| Command | What It Does | Example Output Tells You |
|---|---|---|
| ipconfig (Windows) ifconfig (Linux/Mac) | Shows your IP, subnet mask, default gateway, DNS | Whether you have a valid IP (169.254.x.x = DHCP failed) |
| ipconfig /release ipconfig /renew | Releases and gets a fresh DHCP lease | Fixes IP conflicts or expired leases |
| ping [IP or hostname] | Sends 4 ICMP packets and waits for replies | RTT (round-trip time) and packet loss percentage |
| tracert (Windows) traceroute (Linux) | Shows every router hop to the destination | Where in the path the connection is dying |
| netstat -an | Lists all active connections and open ports | Which ports are listening; detect unexpected connections |
| nslookup [domain] | Queries DNS manually for a domain name | Which IP a name resolves to; which DNS server answered |
Reading a ping result
- โขReply from 8.8.8.8: bytes=32 time=14ms TTL=118 โ success. 14ms is excellent.
- โขRequest timed out โ no reply. Host unreachable, firewall blocking ICMP, or no route.
- โขDestination host unreachable โ your local router doesn't know how to reach that IP.
- โขTTL expired in transit โ packet bounced too many hops and was discarded (routing loop?).
- โข0% packet loss โ perfect. >5% packet loss โ bad connection (WiFi interference, failing cable).
Reading a traceroute
Each line is one router hop. The number on the left is the hop count. Three time values are three test packets. '* * *' means that router blocks ICMP (common for security). A sudden jump from 5ms to 150ms tells you exactly which hop โ and which ISP or country โ is causing the delay.
You run these commands in order: (1) ping 127.0.0.1 โ success. (2) ping 192.168.1.1 โ success. (3) ping 8.8.8.8 โ Request timed out. (4) ping google.com โ Request timed out. Where is the problem?