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 host.ping google.com
2.tracerouteTraces the route that packets take to reach a destination host.traceroute google.com
3.netstatShows network statistics, including open ports and active connections.netstat -a
4.digPerforms DNS lookups to retrieve DNS information about a domain.dig google.com
5.nslookupQueries DNS servers to obtain domain or IP address information.nslookup google.com
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 https://example.com/file.txt
15.curlTransfers data from or to a server using various protocols.curl https://example.com
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 hosts.nc remotehost 80
19.hostPerforms DNS lookups and displays IP address information.host google.com
20.mtrCombines the functionality of ping and traceroute.mtr google.com
21.ethtoolDisplays or modifies Ethernet device settings.ethtool eth0
22.iptablesConfigures firewall rules.iptables -L
23.ssDisplays socket statistics, including open ports and connections.ss -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 google.com`
28.tcpdump -nCaptures network traffic and displays IP addresses instead of hostnames.tcpdump -n
29.whoisRetrieves domain registration information.whois google.com
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 port.nc -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 google.com
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 google.com
40.host -t mxRetrieves MX (Mail Exchange) records.host -t mx google.com

Related Posts

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
Artificial Intelligence