15 Essential Network Troubleshooting Commands (ping, tracert, nslookup, netstat and More)
When the internet is down or an application will not connect, a handful of commands can usually point you to the cause within minutes. This guide covers the most useful network troubleshooting commands and a simple method for using them.
A Simple Troubleshooting Method
Work from the bottom up, following the OSI model:
- Physical: cable, Wi-Fi, link lights
- IP configuration: do you have a valid address, gateway, and DNS?
- Local network: can you reach the gateway?
- Internet: can you reach an external IP address?
- Name resolution: does DNS work?
- Application and ports: is the service reachable on the right port?
Windows and Linux Commands
| Command | What it does |
|---|---|
ipconfig /all (Windows)ip a (Linux) | Shows IP address, subnet mask, gateway, and DNS servers |
ping 192.168.1.1 | Tests reachability, first to your gateway, then to an outside address like 8.8.8.8 |
tracert 8.8.8.8 (Windows)traceroute 8.8.8.8 (Linux) | Shows each hop on the path and where delays or failures occur |
nslookup example.comdig example.com | Tests DNS name resolution |
netstat -ano (Windows)ss -tulpn (Linux) | Lists open ports and active connections |
arp -a | Shows the IP-to-MAC address table |
pathping example.com (Windows) | Combines ping and traceroute with loss statistics |
curl -I https://example.com | Checks that a website responds and shows the HTTP headers |
Test-NetConnection example.com -Port 443 (PowerShell) | Tests whether a specific TCP port is reachable |
ipconfig /flushdns (Windows) | Clears the local DNS cache |
Cisco IOS Commands
show ip interface brief show ip route show interfaces show mac address-table show vlan brief show running-config
See VLANs Explained and Routing vs Switching for how these fit together.
FortiGate Commands
get system status get system interface physical get router info routing-table all execute ping 8.8.8.8 execute traceroute 8.8.8.8 diagnose sniffer packet any 'host 8.8.8.8' 4
The packet sniffer is a powerful way to see whether traffic is arriving at and leaving the firewall. Run it carefully on production devices, since heavy captures can affect performance. Also see How to Configure a Static Route in FortiGate.
Example Diagnosis
| Symptom | Likely cause |
|---|---|
| Cannot ping the gateway | Cable, Wi-Fi, wrong IP or VLAN |
| Ping to 8.8.8.8 works, but websites fail | DNS problem |
| Ping to outside fails, gateway works | Router, ISP, firewall policy, or routing issue |
| Ping works but the app fails | A port blocked by a firewall. Check the port numbers cheat sheet |
| IP starts with 169.254.x.x | No DHCP response. Read DHCP Not Working? 7 Fixes |
Tips
- Ping may be blocked by firewalls on purpose, so a failed ping does not always mean the host is down.
- Change one thing at a time and test again.
- Keep notes of what you tried.
- Only run scans and captures on networks you manage.
Frequently Asked Questions
What does "Request timed out" mean? No reply was received. The host may be down, unreachable, or blocking ping.
What is the difference between ping and traceroute? Ping tests whether a destination replies, while traceroute shows each router along the path.
Conclusion
Most network problems can be narrowed down by checking IP settings, the gateway, an outside address, DNS, and then the application port. Save this cheat sheet and practice the commands in your home lab.

Join the conversation