📘 03-07: CLI Troubleshooting Tools¶
📌 IP Configuration¶
| Command | OS | Shows |
|---|---|---|
ipconfig / ipconfig /all |
Windows | IP, mask, gateway, DNS, MAC, DHCP |
ifconfig |
Linux/macOS (legacy) | Interface config |
ip addr / ip route |
Linux (modern) | Addresses and routes |
📌 Connectivity Testing¶
| Command | Purpose |
|---|---|
ping <host> |
Test reachability & round-trip time (ICMP echo) |
tracert (Win) / traceroute (Linux) |
Show each router hop to a destination |
pathping (Win) / mtr (Linux) |
Combine ping + traceroute with loss stats |
📌 Name Resolution¶
| Command | Purpose |
|---|---|
nslookup <name> |
Query DNS for a record |
dig <name> |
Detailed DNS lookup (Linux/macOS) |
📌 Connections & Neighbors¶
| Command | Purpose |
|---|---|
arp -a |
Show IP → MAC cache |
netstat |
Active connections and listening ports |
ss |
Modern socket stats (Linux) |
nmap |
Scan hosts/ports (discovery) |
🔍 A Typical Troubleshooting Flow¶
ipconfig /all— do I have a valid IP/gateway/DNS? (169.254.x.x = DHCP fail)ping 127.0.0.1— is my TCP/IP stack alive?ping <gateway>— can I reach my router?ping 8.8.8.8— is the Internet reachable by IP?nslookup google.com— is DNS working?tracert— where does the path break?
If step 4 works but step 5 fails, it's a DNS problem, not connectivity.
Tip
Key idea — Master ipconfig/ip, ping, tracert, nslookup, arp, netstat. Test bottom-up (local stack → gateway → Internet → DNS) to isolate exactly where a problem lies.
See also: Troubleshooting Methodology & Safety, DNS
Previous: Ports & Protocols Reference | All Notes | Module 03 Exercise | Next: The TCP/IP Suite & Encapsulation