Top 40 Linux Commands to Troubleshoot Network Issues

Here are 40 uses of Linux commands for troubleshooting network issues:

S.No.CommandCommand UsesExample
1.pingChecks the accessibility and latency of a network
2.tracerouteTraces the route that packets take to reach a destination host.traceroute
3.netstatShows network statistics, including open ports and active connections.netstat -a
4.digPerforms DNS lookups to retrieve DNS information about a domain.dig
5.nslookupQueries DNS servers to obtain domain or IP address information.nslookup
6.routeDisplays and manipulates network routing tables.route -n
7.ifconfigDisplays network interface configuration details.ifconfig
8.arpDisplays or modifies the ARP (Address Resolution Protocol) cache.arp -a
9.iwconfigConfigures wireless network interfaces.iwconfig
10.ifupActivates a network interface.ifup eth0
11.ifdownDeactivates a network interface.ifdown eth0
12.sshOpens an encrypted session to a remote server.ssh user@remotehost
13.scpCopies files securely between hosts using SSH.scp file.txt user@remotehost:/path/to/destination
14.wgetDownloads files from the web.wget
15.curlTransfers data from or to a server using various protocols.curl
16.iftopMonitors network bandwidth usage by displaying a list of active connections.iftop
17.tcpdumpCaptures and analyzes network traffic.tcpdump -i eth0
18.netcatEstablished TCP/UDP connections to remote remotehost 80
19.hostPerforms DNS lookups and displays IP address
20.mtrCombines the functionality of ping and
21.ethtoolDisplays or modifies Ethernet device settings.ethtool eth0
22.iptablesConfigures firewall rules.iptables -L
23.ssDisplays socket statistics, including open ports and -a`
24.nmapScans ports and discovers network services.nmap -p 1-1000 targethost
25.routeAdds or deletes default gateways.route add default gw gatewayip
26.hostnameDisplays or sets the hostname of a Linux system.hostname
27.dig +tracePerforms a full DNS resolution trace for a domain.dig +trace`
28.tcpdump -nCaptures network traffic and displays IP addresses instead of hostnames.tcpdump -n
29.whoisRetrieves domain registration information.whois
30.ip addr showDisplays detailed IP address configuration of network interfaces.ip addr show
31.ip route showDisplays the routing table of a Linux system.ip route show
32.netcat -l -pListens for incoming connections on a specific -l -p 1234
33.ip link showDisplays the state and properties of network interfaces.ip link show
34.systemd-resolveResolves domain names and displays DNS information.systemd-resolve
35.ip neigh showDisplays the ARP cache tableip neigh show
36.tcpdump -iCaptures network traffic on a specific interface.tcpdump -i eth0
37.iperfMeasures maximum network bandwidth between two hosts.iperf -s (on the receiving end), iperf -c remotehost (on the sending end)
38.dhclientObtains an IP address from a DHCP server.dhclient eth0
39.dig +shortPerforms a DNS lookup and outputs only the IP address.dig +short -t mxRetrieves MX (Mail Exchange) -t mx

Related Posts

Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x
Artificial Intelligence