Notifications
Clear all
Topic starter
06/03/2024 10:00 pm
This cheat sheet provides a foundational set of commands for managing and troubleshooting network issues in Linux. With these tools, you can monitor network performance, diagnose problems, and configure network settings.
Command | Description |
---|---|
ping host |
Send ICMP ECHO_REQUEST packets to a host to test connectivity. |
ifconfig |
Display or configure a network interface (deprecated in favor of ip command in many distributions). |
ip addr show |
Show information for all network interfaces. |
ip link show |
Show state of all network interfaces. |
netstat -tuln |
List all TCP and UDP ports listening on the system. |
ss -tuln |
An alternative to netstat that is faster and more informative, lists listening ports. |
traceroute host |
Trace the route packets take to reach the network host. |
tracepath host |
Similar to traceroute but does not require root privileges. |
nslookup domain |
Query Internet domain name servers for DNS information. |
dig domain |
Fetch DNS information of a domain (more detailed than nslookup). |
host domain |
Lookup DNS information of a domain, simpler than dig. |
hostname -I |
Display the IP addresses associated with the host. |
ip route show |
Show routing table. |
route -n |
Show or manipulate the IP routing table (considered deprecated for ip route ). |
arp -a |
Display the ARP (Address Resolution Protocol) cache. |
iwconfig |
Configure wireless network interfaces (use iw for newer replacements). |
tcpdump |
Capture and display network packets. Requires root privileges. |
nmap |
Network exploration tool and security scanner. |
nc or netcat |
Utility for reading and writing across network connections using TCP or UDP. |
iptables -L |
List all active firewall rules set by iptables. |
firewall-cmd --list-all |
List firewall settings using firewalld (Red Hat/CentOS). |
ufw status |
Show status of firewall using Uncomplicated Firewall (UFW) (Debian/Ubuntu). |
sshd |
SSH daemon for accepting incoming SSH connections. |
scp source target |
Securely copy files between hosts on a network. |
rsync -av source target |
Synchronize files/directories between two hosts. |
wget URL |
Download files from the web. |
curl URL |
Transfer data from or to a server, with URL syntax. |
lsof -i |
List open files and the corresponding network connections. |
mtr host |
Combines the functionality of traceroute and ping in a single network diagnostic tool. |
iftop |
Display bandwidth usage on an interface. |
iptraf |
Interactive Colorful IP LAN Monitor. |
nload |
Visualize network traffic and bandwidth usage. |