2.4 Command Line Tools
Basics
You probably grew up using the graphical user interface on laptops, desktop computers, and other computing devices. This type of interface, called a GUI for Graphical User Interface, is the most common way people all over the world interact with their computers. They use their mouse, finger, or other input device to control a cursor and navigate icons like folders and files plus applications to complete their work.
Terms to Know
You should know the following terms:
Command prompt (CMD)
- arp
- ipconfig (ifconfig)
- ping
- tracert (traceroute)
Graphical User Interface (GUI)
Information
IT technicians and network administrators should also become familiar with another form of interfacing with computers, especially when troubleshooting devices or networks. In addition to the GUI, computers also have the Command Prompt (sometimes abbreviated CMD) that uses text commands to interact with devices and your network. It’s like the “olden days” of computers, which some will remember as the 1980s or earlier, when there was no GUI or mouse and users interacted with operating systems like MS-DOS through the command-line interface. Congratulations if you’re already familiar with the Command Prompt! If not, it’s easy to access on many operating systems, and there are a few simple command lines you can use to become familiar with it while testing components of the network.
ipconfig (ifconfig on Linux)
The first step in using the Command Line Interface or Command Shell is to open it. Simply type CMD into the search box in Windows. There are other ways to run the shell using menus or shortcuts, but that’s a pretty easy one.
All you have to do now is enter a command. But why do that? One reason to use command lines is to check connections to devices on the network. If someone reports that their computer, printer, or other device can’t get on the network, use a command to troubleshoot the issue. Or maybe you want to be sure that the Default Gateway that you’ve installed on a subnetwork is properly connected so that traffic coming from those users is being transmitted correctly.
Before you can run that command, you need to know some information about that device or perhaps about the network, in general. The ipconfig command retrieves basic information about the network, like your device's local IPv4 and IPv6 addresses, subnet mask, default gateway, DNS, and others. Try it out on your device and see what you get.
For even more information, add the parameter /all to the ipconfig command. It’ll look like this: ipconfig /all. What additional information was returned?
(For more information, refer to the ipconfig article from Microsoft.)
ping
If you need to determine whether a device on the network is receiving data, run the ping command. The ping command also shows how much time it takes for information to travel to the device and back. It relies on the Internet Control Message Protocol (ICMP).
Test it out by pinging a local router or default gateway. You need its IP address, but you can figure that out using the ipconfig command. You can run the ipconfig command on the questionable device and write down the IP address. From there, you can either ping a known device on your network, like your office computer or a server, or ping the questionable device using a laptop, another desktop, or back in your office.
The ping command will usually run four times, but you can adjust the number of times you want to run it. If all of the data packets sent also show up as being received, so there is no loss, the device is up and running correctly on your network. The command will also return the round-trip times in milliseconds.
If you can’t ping a device, it is not configured correctly for the network. Enter and check its network settings. The first step is to check using ipconfig, but if they are not correct take steps to change the settings.
You can also ping Internet servers, like the server your district uses to host its website. In that case, simply ping the domain name, and DNS servers will figure out the IP address for you and run the ping command.
(For more information, check out the ping article from Microsoft.)
tracert (traceroute in Linux)
One of the most important aspects of networking is ensuring that the data sent from one device is successfully delivered to the intended recipient device. When that doesn’t happen, you have some tools available to you to troubleshoot the issue.
The tracert command is used to track the route a data packet takes to get to its intended IP address. It can show if there are any delays in the route or if a network loop exists that is preventing the successful delivery of data. If the data packet doesn’t make it, tracert can show where the data packet stops.
(For more information, review the tracert article from Microsoft.)
arp
If you reviewed the information on MAC Addresses, you learned about the Address Resolution Protocol (ARP). You can initiate an ARP broadcast message to find another device’s MAC address using the arp command. Using parameters associated with the command, you can display all of the IP addresses cached in your ARP tables. You can also use the command to add a static IP address or delete an entry, if necessary.
(Review the arp command and its parameters in the arp article from Microsoft.)
Additional Resources
Here are additional resources you may find useful:
- Windows Commands is an overview of the Windows Command shell and PowerShell from Microsoft with links to full descriptions of how you can use ipconfig, ping, tracert, and all other commands, including the correct syntax and additional parameters that can be combined with the commands. Using the correct syntax is critical when using the Command Prompt.
- Andrea Harris provides a good overview of common command prompts in her article Windows IP Commands - ipcongif - nslookup - ping - tracert - netstat etc.
- You may also like this list of 10 Useful Windows Networking Commands published by Steve’s Smart Home Guide.
Task/Self-Assessment
Complete the following task or self-assessment:
Try each of these four command line prompts. You can do this on any computer or operating system.
- Start by using the ipconfig command to determine information about your local network. You don’t need to stay within your own network, however.
- Use the ping command to ping a favorite website, either by domain name or IP address.
- Also try using tracert and arp
Review the information that is returned for each command. Consider how you can apply each of these command lines to troubleshoot issues on your local network.