Unit 9 · Network Troubleshooting

9.3Command-line tools

ToolWindowsLinuxUse
Show IP settingsipconfig /allip a, ip routeCheck IP, mask, gateway, DNS, MAC
Renew addressipconfig /release and /renewsudo dhclient -r; sudo dhclient (or sudo networkctl renew <interface>)DHCP faults
Test reachabilitypingpingLayer 3 connectivity and latency
Trace pathtracerttracerouteFind where packets stop
Path qualitypathpingmtrLoss at each hop
DNS lookupnslookupdig, nslookupTest name resolution
Connections and portsnetstat -anoss -tulpnSee open ports, processes
ARP tablearp -aip neighIP-to-MAC mapping, duplicate IP
Port testTest-NetConnection host -Port 443nc -zv host 443Is the service reachable?
Capture trafficWiresharktcpdump, WiresharkDeep analysis
Web testbrowser, curlcurl -I http://siteCheck HTTP response
Service statusServices, Get-Servicesystemctl status nameIs the application running?
LogsEvent Viewerjournalctl -xe, /var/log/*Find the error message
ResourcesTask Manager, Get-Processtop, free -h, df -hCPU, RAM, disk full

Interpreting ping results

ResultMeaning
Reply from addressLayer 3 path is working
Request timed outHost down, ICMP blocked, or no route back
Destination host unreachableNo route or ARP failure; check IP, mask and gateway
General failure / transmit failedLocal interface or driver problem
High or variable timeCongestion, wireless interference, overloaded device

Tools and when to reach for them

ToolShows youUse it when
pingICMP reachability and round-trip timeBasic "can I reach X?"
tracert / tracerouteEach hop on the pathWhere packets stop
ipconfig / ip aAddress, mask, gateway, DNSSuspect wrong IP config
ipconfig /allDHCP, MAC, DNS detailsWindows deep check
nslookup / digDNS answersNames fail but IPs work
netstat / ssSockets and listenersPort or service questions
arp -a / ip neighIP↔MAC cacheLocal delivery / duplicate IP clues

Tip: ping the loopback (127.0.0.1), then the host's own IP, then the gateway, then a public IP, then a name. Each step isolates a layer of problems.

Remember

  • Ping tests reachability, not "the website is fine".
  • DNS tools diagnose name failures; address tools diagnose IP failures.