Docs / Networking / Network Troubleshooting with Linux CLI Tools

Network Troubleshooting with Linux CLI Tools

By Admin · Feb 25, 2026 · Updated Apr 24, 2026 · 30 views · 1 min read

Connectivity Tests

# Basic ping test
ping -c 4 example.com

# Traceroute (show network path)
traceroute example.com
# Or using mtr (combines ping + traceroute)
mtr example.com

DNS Troubleshooting

# DNS lookup
dig example.com
dig example.com MX

# Trace DNS resolution path
dig +trace example.com

# Check specific DNS server
dig @8.8.8.8 example.com

# Reverse lookup
dig -x 198.51.100.10

Port and Connection Testing

# Check if a port is open
nc -zv example.com 443
# Or using nmap
nmap -p 80,443 example.com

# List all listening ports
ss -tlnp

# Active connections
ss -tnp

Network Traffic Analysis

# Capture packets on interface
sudo tcpdump -i eth0 -n port 80

# Capture to file for analysis
sudo tcpdump -i eth0 -w capture.pcap

# Real-time bandwidth per connection
sudo iftop -i eth0

# Bandwidth by process
sudo nethogs eth0

Interface and Routing

# Show IP addresses
ip addr show

# Show routing table
ip route show

# Show ARP table
ip neigh show

# Check MTU
ip link show eth0

Was this article helpful?