Essential Network Troubleshooting Commands: Ping, Traceroute, tcpdump, nmap and More
This guide presents essential Linux network troubleshooting commands—including ping, traceroute, nslookup, tcpdump, fping, tc traffic‑control, and nmap—along with practical examples and usage tips for testing connectivity, analyzing packets, and scanning hosts and services.
Testing network connectivity and diagnostics on Linux using common command‑line tools.
Basic commands:
ping
ip route
route
traceroute
tracepath
mtr
nslookup
host
dig
tcpdump
wireshark
nmap
netcat (nc)
tcExample of traffic control with tc:
tc qdisc add dev eth0 root netem loss 50%
tc qdisc add dev eth0 root netem delay 1000ms
tc qdisc show dev eth0
tc qdisc delfping
fping sends ICMP probes to multiple hosts efficiently. It supports specifying a list of hosts or a file and is faster than ping for many targets. Install via EPEL on CentOS.
# yum -y install fping
# fping 10.0.0.7
# fping -g 10.0.0.0/24tcpdump
tcpdump captures network packets with powerful filtering options. Common syntax and parameters are listed, e.g., -i eth0, -nn, -c 100, and saving to a file.
tcpdump -i eth0 -nn icmp and src host 10.0.0.6 and dst host 10.0.0.7
tcpdump -c 100 -w ./target.capnmap
nmap scans remote hosts and ports, offering many scan types such as SYN (-sS), TCP connect (-sT), UDP (-sU), OS detection (-O), and version detection (-sV). Example commands illustrate host discovery, port scanning, and aggressive scanning.
# nmap -sS 10.0.0.1
# nmap -sU 10.0.0.1
# nmap -O 10.0.0.1
# nmap -A 10.0.0.1Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Raymond Ops
Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
