15 Essential Network Troubleshooting Commands (ping, tracert, nslookup, netstat and More)

Learn the essential network troubleshooting commands for Windows, Linux, Cisco, and FortiGate, with examples and a simple step-by-step method

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:

  1. Physical: cable, Wi-Fi, link lights
  2. IP configuration: do you have a valid address, gateway, and DNS?
  3. Local network: can you reach the gateway?
  4. Internet: can you reach an external IP address?
  5. Name resolution: does DNS work?
  6. Application and ports: is the service reachable on the right port?

Windows and Linux Commands

CommandWhat it does
ipconfig /all (Windows)
ip a (Linux)
Shows IP address, subnet mask, gateway, and DNS servers
ping 192.168.1.1Tests 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.com
dig example.com
Tests DNS name resolution
netstat -ano (Windows)
ss -tulpn (Linux)
Lists open ports and active connections
arp -aShows the IP-to-MAC address table
pathping example.com (Windows)Combines ping and traceroute with loss statistics
curl -I https://example.comChecks 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

SymptomLikely cause
Cannot ping the gatewayCable, Wi-Fi, wrong IP or VLAN
Ping to 8.8.8.8 works, but websites failDNS problem
Ping to outside fails, gateway worksRouter, ISP, firewall policy, or routing issue
Ping works but the app failsA port blocked by a firewall. Check the port numbers cheat sheet
IP starts with 169.254.x.xNo 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.

NextGen Digital... Welcome to WhatsApp chat
Howdy! How can we help you today?
Type here...