Troubleshooting network issues is an essential skill for engineers handling network installations and maintenance. Effectively using network troubleshooting commands can help you locate and fix issues faster, making your work more efficient. Let’s review key network commands to help identify and resolve connectivity problems.
Ping Command: Core Network Troubleshooting Commands for Connectivity Checks
The Ping command is one of the most commonly used Network Troubleshooting Commands for assessing network connectivity. It’s highly effective in determining whether a network is connected properly and identifying the status of the connection. Essentially, Ping acts as a testing tool: when it functions correctly, it helps to eliminate issues within the network access layer, such as faults in network cards, modem lines, cables, and routers. Ping significantly narrows down the potential sources of network problems by confirming connectivity in these areas.
Basic application of Ping command
Generally, users can use ping commands to find out where the problem is or verify the network operation. The following is a typical detection sequence and the corresponding possible faults:
Note: The time after = 25ms is the response time. The smaller this time is, the faster you connect to this address.
① Ping 127.0.0.1
If the test is successful, the network card, TCP/IP protocol installation, IP address, and subnet mask settings are normal. If the test is unsuccessful, there is a problem with the installation or settings of TCP/IP.
② Ping the local IP address
If the test is unsuccessful, it indicates a problem with the local configuration or installation, and the network equipment and communication media should be tested, checked, and eliminated.
③ Ping other IPs in the LAN
If the test is successful, the network card and carrier in the local network are operating correctly. However, if 0 echo replies are received, it means that the subnet mask is incorrect the network card is misconfigured or there is a problem with the cabling system.
④ Ping gateway IP
If this command responds correctly, it means that the gateway router in the LAN is running and can respond.
⑤ Ping remote IP
If a correct response is received, it means that the default gateway is used successfully. For dial-up users, it means that they can successfully access the Internet (but it does not rule out the possibility that the ISP’s DNS may have problems).
Ping command parameters
In the DOS window, enter ping /? (note that there is a space after ping, which cannot be omitted), or directly enter ping followed by a space. Press Enter to display the help instructions for the ping command.
Example: Test the target and perform name resolution.
C:>ping –a target IP address
Ipconfig As Network Troubleshooting Commands: Display IP Configuration Value
IPConfig can be used to display the current TCP/IP configuration settings.
The ipconfig command is an essential tool among Network Troubleshooting Commands, enabling users to quickly access critical network details like the computer’s current IP address, subnet mask, and default gateway. This information is crucial for effective network testing and troubleshooting. Additionally, the ipconfig command can be used to clear the DNS cache, which helps resolve issues related to outdated or incorrect DNS data.
Ipconfig command parameters
The most commonly used method is to enter: ipconfig/all, which will display the complete configuration information. For example:
ARP Network Troubleshooting Commands: Address Translation Protocol
The ARP protocol is a vital component of the TCP/IP suite, used to map IP addresses to the physical (MAC) addresses of network cards. As part of Network Troubleshooting Commands, the ARP command allows users to view the current contents of the ARP cache on a local or remote computer. This command can also be used to manually assign a static IP address and physical address pair, useful for configuring frequently accessed hosts like the default gateway or local servers.
Typically, ARP cache entries are dynamic, meaning that when data needs to be sent to a new location, ARP automatically updates the cache if the required entry is absent.
Common ARP Command Options
① arp –a: used to view all items in the cache.
② arp -a IP: If there are multiple network cards, then use arp -a plus the IP address of the interface to display only the ARP cache items related to the interface.
③ arp -s IP physical address: Manually enter a static entry into the ARP cache. The entry will remain valid during the computer boot process, or when an error occurs, the manually configured physical address will automatically update the entry.
④ arp -d IP: Use this command to manually delete a static item.
Traceroute command
The traceroute command (or tracers in Windows) traces the path packets take from source to destination, making it a key network troubleshooting command. This command is crucial for locating delays or points of failure within a network.
The basic usage of the traceroute command is to type “tracert host_name” or “tracert ip_address” after the command prompt, where tracert is the name of the traceroute on the Windows operating system.
The output has 5 columns:
The first column is the value describing the nth hop of the path, that is, the sequence number of the routers along the path;
The second column is the first round trip delay;
The third column is the second round trip delay;
The fourth column is the third round trip delay;
The fifth column is the name of the router and the IP address of its input port.
If the source receives fewer than 3 messages from any given router (due to packet loss in the network), the traceroute places an asterisk after the router number and reports a round-trip time of less than 3 to that router.
In addition, the tracert command can also be used to view the steps or routes taken by the network when connecting to sites. If a network failure occurs, this command can be used to view the location of the problem.
How to Test Routing in A Large Network
(1) Try the “ping www.sina.com.cn” operation several times and compare the IP addresses of Sina.com. If the IP addresses obtained by the two pings are different, try to consider the reasons (such as load balancing). Then, execute the “tracert ip_address” command for these different IP addresses and observe whether the output results are different.
(2) Perform a traceroute test on a site in a large network and record the test results. Observe whether the delay of the nth hop is less than the delay of the n-1th hop. Try to analyze the reason (Hint: You can consider the role of each component of the delay in the total delay separately).
(3) Use the traceroute program to test the route from a fixed host to a remote host with a fixed IP address multiple times during different hours of the day. Try to analyze and compare the measured data to see if the route changes. If so, how often does it change?
Route command
When there are multiple routers within a network, users may want to direct traffic through specific routers rather than relying solely on the default gateway. For instance, certain remote IP addresses may be routed through one router, while others are directed through a different path. In such cases, routing information—stored within each device’s unique routing table—is essential. Each host and router maintains its distinct routing table, and most routers automatically update these tables using specialized protocols. However, sometimes it’s necessary to manually add entries to these routing tables on both routers and hosts. The route command is a crucial network troubleshooting commands that allows users to display, add, and modify routing table entries as needed. Key options include:
1. Route print: This command is used to display the current items in the routing table. The output results on a single router segment are shown in the figure.
2. route add: Use this command to add routing items to the routing table.
For example, if you want to set a route to the destination network 209.99.32.33, it must pass through 5 router segments. First, it must pass through a router on the local network with an IP of 202.96.123.5 and a subnet mask of 255.255.255.224. Then the user should enter the following command:
route add 209.99.32.33 mask 255.255.255.224202.96.123.5 metric 5
3. Route change: This command can be used to modify the data transmission route, but users cannot use this command to change the destination of the data. The following example changes the route in the previous example to a path containing 3 network segments:
route add 209.99.32.33 mask 255.255.255.224202.96.123.250 metric 3
4. route delete Use this command to delete a route from the routing table. For example, route delete 209.99.32.33
6. Release IP/Reacquire IP Command
If the computer operating system used is Windows, when we cannot connect to the network or there is an IP address conflict, we can release the IP address first and then obtain a new IP address to solve the IP address conflict problem.
Order:
ipconfig /release releases the IP address.
Then you need to use ipconfig /renew to get it again.
Let’s see how to solve them:
1. Release the network IP address first ipconfig /release
At this time, the network will be disconnected and no IP address will be assigned because the IP address has been released.
2. Re-obtain the IP address, ipconfig /renew,
At this time, the network will be reconnected, but the IP address is different from the original one. It is reassigned to an available IP address to connect to the network.
Conclusion: Mastering Network Troubleshooting Commands
These essential network troubleshooting commands—Ping, ipconfig, ARP, traceroute, and route—are vital tools for engineers to diagnose and resolve connectivity issues efficiently. Familiarity with these commands not only reduces network downtime but also enables quicker, more effective problem-solving on-site.