Essential Linux Network Troubleshooting Commands You Must Know
This guide introduces the most useful Linux network troubleshooting commands—ping, traceroute, ifconfig/ip, netstat, nslookup/dig, curl/wget, and tcpdump—explaining their purpose, basic usage, and example outputs to help quickly diagnose and resolve connectivity issues.
Network problems are common on Linux systems, and mastering a set of diagnostic commands is crucial for administrators and users to quickly identify and fix issues such as connectivity failures, DNS problems, and latency.
ping command
The ping command sends ICMP echo requests to a target host to verify network reachability.
# Use ping command to test connectivity
ping example.comTypical response shows the round‑trip time and packet details:
64 bytes from 93.184.216.34: icmp_seq=1 ttl=54 time=74.5 mstraceroute command
traceroutetraces the path packets take to a destination, displaying each hop and its latency, which helps locate bottlenecks.
# Trace the route to a host
traceroute example.comifconfig / ip command
ifconfigand ip reveal and configure network interface details such as IP address, netmask, and gateway.
# Show interfaces with ifconfig
ifconfig
# Show interfaces with ip
ip addr shownetstat command
netstatdisplays active network connections, listening ports, and routing tables, providing a snapshot of the system's network state.
# List all listening sockets
netstat -tuln
# Show routing table
netstat -rnslookup / dig command
Both nslookup and dig query DNS records to verify domain name resolution.
# DNS lookup with nslookup
nslookup example.com
# DNS lookup with dig
dig example.comcurl / wget command
curland wget test HTTP/HTTPS connectivity, showing response headers and status codes.
# Test HTTP response with curl
curl -I https://example.com
# Test HTTP response with wget
wget --spider https://example.comtcpdump command
tcpdumpcaptures network packets on a specified interface, allowing deep inspection of traffic for troubleshooting.
# Capture packets on eth0
sudo tcpdump -i eth0These commands together form a practical toolkit for diagnosing and resolving a wide range of Linux network issues, improving reliability and reducing downtime.
Signed-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.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
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.
