9 Essential Linux Network Commands Every Admin Should Know
This guide walks Linux administrators through nine core networking utilities—ip, netstat, nmap, traceroute, tcpdump, ssh, wget, netplan, and nmtui—explaining their purpose, key options, and example commands to configure interfaces, inspect routes, capture packets, and manage remote connections.
ip
The ip command replaces the older ifconfig and route utilities. ip a displays all interfaces and their configurations. To limit output, use ip link show. To view details for a specific interface, e.g., ens5, run ip address show dev ens5. The routing table can be displayed with ip route. Interfaces can be enabled or disabled with sudo ip link set ens5 up and sudo ip link set ens5 down.
netstat
netstatinspects network connections, routing tables, interface statistics, masqueraded connections, and multicast memberships. Examples include: netstat -at – list all TCP ports. netstat -l – show only listening sockets. netstat -lt and netstat -lu – list listening TCP and UDP ports respectively. netstat -pt – add process IDs to the output. netstat -s – print aggregate statistics.
nmap
nmapis used for network discovery, auditing, and management. To scan a remote host for open ports, run nmap SERVER where SERVER is the target IP or domain. Sample output lists ports such as 22/tcp open ssh, 80/tcp open http, and 443/tcp open https. Host discovery across a subnet can be performed with nmap -sn 110/24. Operating‑system detection is enabled with sudo nmap -O 11120, and aggressive detection with sudo nmap -A 11120. Example OS detection output shows:
Running: Linux X
OS CPE: cpe:/o:linux:linux_kernel:32
OS details: Linux 32traceroute
If ping shows lost packets, traceroute helps locate the problematic hop. Running traceroute rumenz.com displays each hop from the local machine to the destination with round‑trip times in milliseconds, allowing identification of where packets fail.
tcpdump
tcpdumpcaptures and displays network packets. To listen on all interfaces, use sudo tcpdump -i any. Because live output can be overwhelming, write packets to a file with sudo tcpdump -i any -w capture.pcap, stop the capture with Ctrl+C, and later read the file using tcpdump -r capture.pcap.
ssh
Secure Shell ( ssh) provides encrypted remote management. The basic syntax is ssh USER@SERVER, where USER is the remote username and SERVER the host address. For non‑standard ports, specify -p PORT as in ssh USER@SERVER -p PORT.
wget
The wget command downloads files from a remote server. Use wget http://SERVER/FILE, replacing SERVER with the host and FILE with the desired path.
netplan
On Ubuntu Server, netplan reads YAML configuration files from /etc/netplan. After editing, test the configuration with sudo netplan try. If the test succeeds, apply the changes (and bring up interfaces) with sudo netplan apply. For static IP configuration, refer to Ubuntu 18.04 documentation.
nmtui
nmtuioffers an ncurses‑based UI on Red Hat‑derived distributions to configure, enable, or disable network interfaces. Consult the relevant CentOS documentation for detailed usage.
Linux Tech Enthusiast
Focused on sharing practical Linux technology content, covering Linux fundamentals, applications, tools, as well as databases, operating systems, network security, and other technical knowledge.
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.
