Network Troubleshooting Basics
# CHAPTER 15
Network Troubleshooting Basics
1. Introduction
Networks break. Cables are severed by construction crews, routers crash due to memory leaks, DNS servers are misconfigured by junior engineers, and firewalls accidentally block legitimate traffic. When a massive outage occurs, panic ensues. A skilled network engineer does not guess what the problem is; they employ a methodical, deductive diagnostic process. In this chapter, we will equip you with the essential diagnostic toolkit. We will master the command-line utilities built into every operating system—Ping, Traceroute, Ipconfig, Nslookup, and Netstat—learning how to isolate connectivity failures layer by layer.2. Learning Objectives
By the end of this chapter, you will be able to:- Adopt a systematic, layer-by-layer troubleshooting mindset.
-
Use the
pingcommand to verify basic end-to-end connectivity.
-
Use
traceroute(tracert) to pinpoint exactly where a packet drops on the internet.
-
Use
ipconfig/ifconfigto audit local IP and gateway configurations.
-
Use
nslookupto diagnose DNS resolution failures.
-
Use
netstatto view active connections and open ports on a local machine.
3. Beginner-friendly Explanations
The Detective Mindset (The OSI/TCP approach): When a user complains, "The internet is down," you must act like a detective, ruling out possibilities from the bottom up.- 1. Layer 1 (Physical): Is the laptop plugged in? Is the Wi-Fi actually turned on? Is the router glowing green?
- 2. Layer 2 (Network Access): Does the computer have a MAC address? Is the switch port active?
- 3. Layer 3 (Internet): Did DHCP give the computer an IP address? Can it ping the home router?
- 4. Layer 4 (Transport): Is the firewall blocking Port 443?
- 5. Layer 7 (Application): Is the web browser crashed? Is the DNS server returning the wrong IP?
Never start troubleshooting complex DNS configurations (Layer 7) before checking if the network cable is unplugged (Layer 1).
4. The Diagnostic Toolkit (Command Line)
These commands are universally available on Windows, macOS, and Linux.1. Ping (The Sonar):
Ping sends a tiny packet (ICMP Echo Request) to a destination and waits for it to bounce back.
ping 8.8.8.8
- If it replies, the internet works.
- If it says "Request timed out," the packet was lost or blocked by a firewall.
- If it says "Destination host unreachable," your local router doesn't even know how to send the packet.
2. Traceroute (The Map):
While Ping just tells you IF a server is reachable, Traceroute tells you the exact path the packet took.
tracert google.com (Windows) or traceroute google.com (Mac/Linux)
It prints every single router the packet hops through. If the connection fails at router #5, you know exactly which ISP or data center is experiencing an outage.
3. Ipconfig / Ifconfig (The Mirror):
Before looking at the internet, look at yourself.
ipconfig (Windows) or ifconfig / ip a (Linux/Mac)
This reveals your current Private IP address, Subnet Mask, and Default Gateway. If your IP address is 169.254.x.x, it means DHCP completely failed and your computer gave itself a dummy "APIPA" address. You have no network access.
4. Nslookup (The Phonebook Check):
If you can ping 8.8.8.8 successfully, but you cannot load google.com in your browser, your internet is fine, but your DNS is broken.
nslookup google.com
This forces your computer to manually ask the DNS server to translate the name. If it returns an error, you must fix your DNS settings.
5. Netstat (The Wiretap):
Used to see all active conversations your computer is having.
netstat -ano (Windows)
This outputs every open port on your computer, what IP address is connected to that port, and the exact software Process ID holding the connection open. Essential for hunting down malware secretly communicating with external servers.
5. Step-by-Step Diagnostic Flow
Scenario: User says "I can't reach the company database server."-
1.
Step 1: Ask them to
ping 10.0.0.50(The database IP).
- If Ping succeeds, the network is perfect. The database software itself is probably crashed.
- If Ping fails, proceed to Step 2.
-
2.
Step 2: Ask them to
ping 192.168.1.1(Their local router / Default Gateway).
- If this fails, their Wi-Fi is broken or they have a bad cable.
- If this succeeds, their local network is fine. The problem is further away. Proceed to Step 3.
-
3.
Step 3: Run
tracert 10.0.0.50.
-
The trace shows successful hops through the building, but stops and dies at the firewall router (
10.0.0.1).
- Conclusion: A security engineer accidentally wrote a bad ACL rule on the firewall blocking the user's subnet.
6. Best Practices
-
Ping 8.8.8.8: The absolute fastest way to prove an internet outage is not a DNS issue is to open a terminal and ping Google's public DNS server:
ping 8.8.8.8. If the pings reply, you have a glorious, working internet connection. If websites still won't load, you know 100% that your DNS configuration is broken.
7. Common Mistakes
- Assuming Ping Failure Means Offline: Many enterprise servers and firewalls are explicitly configured to block ICMP (Ping) packets to prevent hackers from scanning their networks. Just because Microsoft's server doesn't reply to your Ping does *not* mean the server is offline; it might just be ignoring you. You must test the actual port (e.g., trying to access the webpage on Port 443).
8. Mini Project: Diagnose Network Connectivity
Run a full diagnostic audit on your own machine.- 1. Open your terminal.
-
2.
Run
ipconfig(orifconfig). Write down your Default Gateway IP.
-
3.
Run
ping [Your Default Gateway IP]. Verify your local connection is solid.
-
4.
Run
nslookup github.com. Verify your DNS resolver is answering correctly.
-
5.
Run
tracert github.com. Watch the packet jump from your home, to your ISP, across the country to GitHub's data center. Count how many routers (hops) it took!
9. Practice Exercises
-
1.
A user cannot load any webpages, but they can successfully
ping 8.8.8.8. What specific network service has failed, and what command would you use to verify it?
- 2. Explain the diagnostic difference between a "Request Timed Out" error and a "Destination Host Unreachable" error when using the ping command.
10. MCQs with Answers
Which command-line utility is used to display the exact path and router hops a packet takes to reach its final destination?
If a Windows computer fails to reach a DHCP server, it will automatically assign itself an APIPA address. Which of the following is an APIPA address?
11. Interview Questions
- Q: Walk me through your exact troubleshooting methodology if a user reports they cannot access an internal web server.
-
Q: What does the
netstatcommand do, and how would a security engineer use it during a malware investigation?
-
Q: Why might a
pingto a known, working web server return a 100% packet loss?
12. FAQs
Q: My internet is extremely slow. Can these commands help me? A: Yes. Run a continuous ping (ping google.com -t on Windows). Look at the "time=XXms" value. If it jumps wildly from 20ms to 500ms, or if you see frequent "Request timed out" messages, you are experiencing "Packet Loss." This is physical proof that your Wi-Fi signal is terrible or your ISP's cables are degraded.
13. Summary
In Chapter 15, we transformed from network architects into network detectives. We learned to abandon guesswork in favor of a rigid, layer-by-layer deductive methodology. We weaponized the command-line interface, utilizingping to test fundamental connectivity, traceroute to map the geographic path of failure, and nslookup to interrogate DNS architecture. By understanding how to audit our own configurations via ipconfig and netstat, we possess the analytical framework required to rapidly isolate and remediate any catastrophic network failure.