## Network Diagnostics & Storage: Mastering the Command Line
When network connectivity fails, guessing and rebooting your router at random is ineffective. By adopting the systematic troubleshooting methodology used by professional network engineers and mastering fundamental command-line utilities, you can pinpoint the exact origin of a network failure within 60 seconds.
1. The 5-Step Bottom-Up Diagnostic Methodology
Always diagnose network failures starting at Layer 1 (Physical) and progressing toward Layer 7 (Application):
STEP 1: Verify Physical Link (Layer 1 & 2)
- Is the Ethernet link light solid/blinking? Is Wi-Fi associated?
STEP 2: Inspect IP Configuration (Layer 3)
- Did the DHCP server allocate a valid IP address or a 169.254.x.x APIPA failure address?
STEP 3: Ping Local Default Gateway (Layer 3 Reachability)
- Can packets reach the local router gateway (e.g., 192.168.1.1)?
STEP 4: Ping External Public IP (WAN Reachability)
- Can packets reach 1.1.1.1 or 8.8.8.8 across the ISP broadband connection?
STEP 5: Test DNS Domain Name Resolution (Application Layer)
- Can the system resolve "google.com" into a valid IP address?2. The Network Engineer's CLI Cheat Sheet (Windows & Linux)
# ==============================================================================
# WINDOWS POWERSHELL / COMMAND PROMPT DIAGNOSTIC COMMANDS
# ==============================================================================
# 1. Display IP address, subnet mask, default gateway, and active DNS servers
ipconfig /all
# 2. Release and renew DHCP lease if an IP conflict or stale address occurs
ipconfig /release
ipconfig /renew
# 3. Flush the local DNS resolver cache to clear corrupted name records
ipconfig /flushdns
# 4. Test connectivity, packet loss, and latency to gateway or remote host
ping -n 10 192.168.1.1
ping -t 1.1.1.1
# 5. Trace every router hop between your PC and a destination server
tracert 8.8.8.8
# 6. View the local ARP table (maps IP addresses to physical MAC addresses)
arp -a
# 7. Display all active network connections and listening ports
netstat -ano | findstr LISTENING
# 8. Query a specific DNS server for a domain's A or MX record
nslookup example.com 1.1.1.1# ==============================================================================
# LINUX / MACOS TERMINAL EQUIVALENT DIAGNOSTIC COMMANDS
# ==============================================================================
# 1. Display detailed network interfaces and assigned IP addresses
ip addr show # (or 'ifconfig' on macOS)
# 2. Display routing table and current default gateway
ip route show
# 3. Trace route hops with modern packet timing
traceroute -I google.com # (Uses ICMP)
# 4. Modern replacement for netstat: display all listening TCP/UDP sockets
ss -tulpn
# 5. Advanced DNS lookup and diagnostic utility
dig example.com +trace3. Measuring True LAN Throughput with iperf3
Internet speed test websites (like Speedtest.net) measure your PC-to-Internet bandwidth, which is constrained by your ISP subscription. To test whether your local Wi-Fi or Ethernet switch is bottlenecking internal file transfers:
[ Server PC: 192.168.1.50 ] <===== LAN Link =====> [ Client PC / Laptop ]
Runs: iperf3 -s Runs: iperf3 -c 192.168.1.50- 1On a wired desktop PC, launch
iperf3 -sto listen as a server. - 2On your laptop, run
iperf3 -c 192.168.1.50 -P 4(uses 4 parallel streams). - 3
iperf3transmits raw TCP payloads across the local network without touching the internet, revealing your true wireless or wired physical throughput in Mbps.
4. Home Storage & Media Streaming Architecture (NAS & DLNA)
Once your LAN backbone is stable, you can centralize storage, media streaming, and automated backups across your household using a Network Attached Storage (NAS) appliance:
[ GIGABIT HOME NETWORK ]
|
+-------------------------+-------------------------+
| |
v v
[ DEDICATED HOME NAS ] [ CLIENT PLAYBACK ]
- RAID 1 / RAID 5 Storage Pool - Smart TV (DLNA / Plex App)
- SMB / CIFS: Windows File Sharing - Mobile Devices (VLC / Jellyfin)
- NFS: High-Speed Linux Mounts - Laptops (Automated Backups)
- Media Transcoder Engine (Plex / Jellyfin)RAID Levels for Home Resilience
- RAID 0 (Striping): Combines drives for speed. Zero redundancy: if 1 drive fails, all data is permanently lost.
- RAID 1 (Mirroring): Duplicates identical data across 2 drives. Tolerates 1 complete drive failure. Recommended for 2-bay home NAS units.
- RAID 5 (Striping with Distributed Parity): Requires minimum 3 drives. Tolerates 1 drive failure with high storage efficiency (N - 1).
- RAID 10 (Striped Mirrors): Requires 4 drives. Combines RAID 1 redundancy with RAID 0 speed. Best for intensive multi-user database/media editing.