We ❤️ Open Source

A community education resource

5 min read

10 essential networking commands for sysadmins

Explore these powerful Linux tools for monitoring and troubleshooting networks.

Linux provides powerful networking tools for monitoring, troubleshooting, and security. This post covers 10 essential commands, from ping and traceroute to nmap and tcpdump, to help sysadmins manage networks effectively.

My initial reaction to Linux was that I did not fully understand its range of tools. At that time, I was the technology director for a small K-12 public school district with limited resources, but a growing number of classrooms, learning labs, and administrative offices.

I came from a social science background, and although I was willing to learn, I was acutely aware of how little I knew. It did not take too long to understand what powerful tools enabled me to discover our network and learn the intricacies of TCP/IP.

Read more: Get started with gokrazy: Simple self-hosting on Raspberry Pi

Unlock the power of Linux with these networking commands

Here’s a list of ten tools that became a significant part of my repertoire. I used them to teach others about network computing and the power of Linux.

Ping

The ping command is one of the most frequently used by sysadmins. It utilizes ICMP packets to verify whether two machines are connected.

$ ping 192.168.86.1

I learned that I could also ping a domain.

$ ping donwatkins.info

Traceroute

The traceroute command displays the route from your current machine to the remote server/system, showing each hop along the way.

$ traceroute donwatkins.info

Traceroute can identify the network path, detect latency, locate network issues, and visualize network topology. Here is the result of the traceroute command:

1   192.168.1.1  1.114ms  0.234ms  0.125ms 
2   67.252.48.1  21.260ms  12.357ms  20.123ms 
3   24.58.217.101  29.425ms  32.921ms  32.608ms 
4   24.58.38.176  10.866ms  11.450ms  10.017ms 
5   24.58.32.62  25.848ms  25.377ms  15.594ms 
6   66.109.6.2  24.275ms  *  30.399ms 

Read more: Why you should learn assembly language

MTR

The mtr command is a combination of ping and traceroute. It is used to track for packet loss. MTR is a versatile and dynamic tool that provides sysadmins with valuable insights into network performance and helps them identify and resolve issues efficiently.

$ mtr donwatkins.info

ifconfig

You can use the ifconfig tool to find your IP address. It provides TCP/IP information for all your network addresses, including the loopback address.

$ ifconfig 

netstat

The netstat (network statistics) command-line tool provides detailed information about network connections, routing tables, interface statistics, masquerade connections, and multicast memberships on a system. If you want to see all the network activity on your system, consider using the following command.

$ netstat -a

Dig

If you are looking for DNS information, dig is the tool you should use. It is a flexible tool for interrogating DNS name servers. It performs DNS lookups and displays the answers returned from the name server(s) that were queried.

$ dig donwatkins.info

tcpdump

One of my favorite tools for discovering what traffic is coming across my network is tcpdump. It is a powerful command-line packet analyzer used for network traffic monitoring and analysis. It captures and displays the packets being transmitted or received over your network. You need administrative privileges to run the command.

$ sudo tcdump 

Whois

The whois command queries databases that store registered domain names and related information. This command is useful if you need information about a specific domain, such as its registrar.

$ whois donwatkins.info

Nmap

If you are looking for a powerful and versatile tool for network discovery and security auditing, then Nmap is for you. It can discover devices on a network, identify their IP addresses, and collect information about them, creating a detailed network inventory. Be sure to check the Nmap project website for excellent documentation on its use. I use nmap to scan my router to check for open ports.

$ nmap 192.168.1.1

ntopng

One of my favorite network monitoring tools is ntopng. It is a web-based application for monitoring network traffic released under the GPLv3 license. Ntopng is the modern version of the original tool, ntop, created by Luca Deri in 1998. It has been significantly improved in performance, usability, and features.

EtherApe

I am a graphical learner, and EtherApe helped me visualize TCP/IP traffic across our network. EtherApe is easy to install on either .deb or .rpm based systems.

$ sudo apt install etherape
or
$ sudo dnf install etherape

Only an administrator can run EtherApe, so you must add sudo to your command when executing it.

$ sudo etherape

Be sure to consult the documentation and Linux manual pages for all these commands to explore all the different options open to you as a Linux system administrator.

More from We Love Open Source

This article is adapted from “Unlocking the power of Linux” by Don Watkins, and is republished with permission from the author.

About the Author

I am Don Watkins, a free and open source software (FOSS) advocate.

Read Don's Full Bio

The opinions expressed on this website are those of each author, not of the author's employer or All Things Open/We Love Open Source.

Want to contribute your open source content?

Contribute to We ❤️ Open Source

Help educate our community by contributing a blog post, tutorial, or how-to.

This year we're hosting two world-class events!

Join us for AllThingsOpen.ai, March 17-18, and All Things Open 2025, October 12-14.

Open Source Meetups

We host some of the most active open source meetups in the U.S. Get more info and RSVP to an upcoming event.