TechKnowSurge
CompTIA Network+ 5.5 CompTIA A+ Core 1 2.8 Cisco CCST Networking 5.3 Cisco CCNA 1.10
VideoNetworkFree

DEMO: Linux Command Line Tools

Essential Linux and Raspberry Pi command line tools for network troubleshooting are covered, including ping, ifconfig, ip, dig, traceroute, arp, netstat, hostname, and route. Each command is demonstrated with practical examples showing how to test connectivity, query DNS, inspect interfaces, and examine routing tables.

Complete this video to capture a CTF flag worth 1 point.

About this video

Linux and Raspberry Pi systems provide a robust set of command line tools that network technicians and administrators rely on for diagnosing connectivity issues and gathering network information. Several of these utilities parallel tools found on Windows, but with notable behavioral and syntax differences that are important to understand when working in a Linux environment. For example, ping runs continuously by default on Linux rather than sending a fixed number of packets, and it requires Ctrl+C to stop, after which it displays a packet transmission summary including loss statistics and latency data. Interface and address information can be retrieved using either ifconfig or the more modern ip command, which supports subcommands such as ip address for interface details and ip route for routing information. Because Linux does not bundle DNS query functionality into the base system the way Windows includes nslookup, the dns-utils package must be installed separately using apt. Once installed, the dig utility allows users to perform DNS lookups and inspect returned records, such as A records resolving domain names to IP addresses. Beyond connectivity and DNS testing, several additional tools round out the Linux troubleshooting toolkit. The traceroute command maps the path packets take across network hops to reach a destination, using the full command name rather than the abbreviated tracert found on Windows. The arp command with the -a flag displays the ARP table, showing IP-to-MAC address mappings for devices on the local network. The netstat command lists all active network connections, making it useful for identifying what is communicating with a device. Finally, the route command displays the system routing table, including the default gateway used to reach external networks and the internet.

What you'll learn

What's covered

Linux CLI Troubleshooting Tools

Aligned to

CompTIA Network+
5.5 Given a scenario, use the appropriate tool or protocol to solve networking issues.
CompTIA A+ Core 1
2.8 Given a scenario, use networking tools.
Cisco CCST Networking
5.3 Run basic diagnostic commands and interpret the results.
Cisco CCNA
1.10 Verify IP parameters for Client OS

Key terms

Internet Control Message Protocol
ICMP
A network layer protocol used to send error messages and operational information about network conditions.
IP Address
A numerical label assigned to each device connected to a network that uses the Internet Protocol.
Domain Name System
DNS
A hierarchical naming system that translates human-readable domain names into IP addresses.
Address Resolution Protocol
ARP
A protocol used to map an IP address to a physical MAC address on a local network.
Media Access Control
MAC
A sublayer of the Data Link layer that controls how devices on a network gain access to a medium and transmit data.
Default Gateway
The router that a device uses to send traffic to destinations outside its local network.
Latency
The time delay between sending a request and receiving a response over a network.
Network Interface Card
NIC
A hardware component that connects a computer to a network.
Ping
A command-line diagnostic utility that uses ICMP echo request and echo reply messages to test whether a remote host is reachable on a network and to measure the round-trip time for packets. It is one of the first tools used when troubleshooting network connectivity issues.
traceroute
A Linux command-line tool that maps the path packets take to a destination host by displaying each intermediate hop and its latency.
netstat
A command-line utility that displays active network connections, listening ports, and protocol statistics on a local system.
dig
A Linux command-line tool used to query DNS servers and retrieve DNS records such as A, MX, and CNAME entries.

Transcript

Command line tools on a Raspberry Pi

Here I am on my Raspberry Pi, my demo Pi here, and we're going to go over a few commands that you can do for troubleshooting purposes. I did a similar walkthrough with Windows and I went over some commands, so I'm going to repeat some of those, such as ping.

ping

I can ping an address, and what it's doing is testing the connectivity to that address. So the first one here is the ping, and I see that I have connectivity to it. One thing that we see that's different about this is, on a Windows machine, to continually repeat a ping to something we have to do a dash t, where this just automatically keeps going and I have to hit Ctrl+C to end this and stop it from pinging. And then it gives me this little summary, which is kind of cool, about how many packets were transmitted and how many lost. So then we got some good information on what the delay is to this address right here.

ifconfig and ip

Another one on the Windows machine that we covered was ipconfig, but a similar command on this is ifconfig. So we do an ifconfig and it will show us the interfaces that are on this device and some information about those interfaces.

Similar to ifconfig, we also have ip. So we could just type in ip, and maybe we want to see addresses. Then I can say ip address and it will pop in with some information about the addresses on the different interfaces. Or, if I just type in ip, it will tell me exactly what commands I can work with. So if I need to find out certain information, then I can find out that information — such as, how about ip route. I can type in ip route and then it'll give me some information about the route.

dig

Windows has nslookup installed, so we can do DNS queries and test out DNS. Now, we need to install another application on a Linux machine in order to make this happen.

So what I'm going to do is a sudo apt-get update, so I can update all the repositories and make sure I have everything up to date. Then, once I do that, I'm going to download the dnsutils program, so that way I can use dig and actually look up some of this information. So I'll do a sudo apt-get install and we're looking for dnsutils. Hit enter, and then I'll go through the process of installing this with all of its dependencies. I'm going to confirm yes, and there it is installing everything.

I can verify the installation by typing in dig -v. I can hit that and then it shows that yes, in fact it is installed. So let's try using it. I'm going to do a dig on www.google.com. Hit enter and see if it comes back with an address. We see in here it did a search for www.google.com and has come back with an IP address. It's the A record in here. So we are good to go.

traceroute

Similar to Windows, we have traceroute. This one actually is specified as traceroute rather than tracert. Then we specify what we are tracing this to, so we'll trace it to google.com and hit enter. It goes through the process. This one actually went much quicker, but we can see all of the hops that it took between here and getting to that www.google.com.

arp

These machines do have an ARP table on them as well. So I'm going to type in arp -a and we're going to take a look at the ARP table. We see here the IP addresses and their associated MAC address, and which connection it is on. So we do in fact have this ARP table, and we can look up the ARP table for troubleshooting things.

netstat

The next one that we're going to take a look at is netstat. Netstat is going to show us all of those connections, all the network connections that we have connected. So it's showing us all of these connections that we have in here. Netstat can be used as one of those things to see if there are some issues and what is connected to this device.

hostname and route

Same as Windows, we can type in hostname and we will see what the host name here is. The host name of this device is raspberrypi.

The last one we're going to take a look at is the route command. The route command once again shows us the routes there are to get to different networks. So it's showing us the different routes here, and then the default route — how to get to the outside world, how to get to the internet.

These can be really helpful as you're trying to gather information.

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →