9 Common Network Commands, Very Practical!
1. ping Command
the Internet packet explorer, is a program used to test network connectivity. Ping operates in the TCP/IP network architecture at the application layer, primarily sending ICMP (Internet Control Message Protocol) Echo request messages to a specific destination host to test whether the destination is reachable and to understand its related status.
Command Format
ping hostname
ping domain name
ping IP address

Basic Applications of the ping Command
① ping 127.0.0.1
② ping local IP address
③ ping other IPs in the local area network
④ ping gateway IP
⑤ ping remote IP
⑥ ping localhost
⑦ ping http://www.baidu.com (a well-known website domain)
Common Options for the ping Command
**ping IP -t:** Continuously execute the ping command to the IP address until interrupted by the user with Ctrl+C.
**ping IP -l 2000:** Specify a specific data length (in this case, 2000 bytes) for the ping command instead of the default 32 bytes.
**ping IP -n 20:** Execute the ping command a specified number of times (in this case, 20).
Note: With the widespread use of firewall functionality in networks, when you ping other hosts or other hosts ping your host, and it shows that the host is unreachable, do not jump to conclusions. It is best to compare the ping results with a “well-configured” host.
2. ipconfig Command

(3) ipconfig /release and ipconfig /renew: These two additional options can only be used on computers that lease IP addresses from a DHCP server. If you enter ipconfig /release, all leased IP addresses for all interfaces are returned to the DHCP server (returned IP addresses).
3. arp Command (Address Resolution Protocol)
Common Command Options:
① arp –a: Used to view all items in the cache.

② arp -a IP: If there are multiple network cards, using arp -a followed by the interface’s IP address will only display the ARP cache items related to that interface.
③ arp -s IP physical_address: Manually input a static item into the ARP cache. This item will remain valid during the computer’s boot process, or in case of errors, the manually configured physical address will automatically update this item.
④ arp -d IP: This command can manually delete a static item.
4. traceroute Command

The output has 5 columns:
The first column describes the number of the nth hop along the path, which is the router number along that path;
The second column shows the first round-trip delay;
The third column shows the second round-trip delay;
The fourth column shows the third round-trip delay;
The fifth column shows the router’s name and its input port’s IP address.
Considerations [Testing Routing in Large Networks]:
(1) Try the “ping www.sina.com.cn” operation multiple times and compare the IP addresses obtained for Sina. If the two ping results yield different IP addresses, consider the reasons (e.g., load balancing). Then, for these different IP addresses, execute the “tracert ip_address” command and observe whether there are differences in the output results.
(2) Conduct a traceroute test on a site in a large network, recording the test results. Observe whether there are instances where the nth hop’s delay is less than the n-1 hop’s delay. Try to analyze the reasons (hint: consider the roles of various components of delay in the total delay).
(3) At different times of the day, use the traceroute program to test the route from a fixed host to a remote fixed IP address multiple times. Try to analyze and compare the measurement data, observing whether the route changes? If so, how frequent is that change?
5. route Command

(2) route add: This command can add routing entries to the routing table.
route add 209.99.32.33 mask 255.255.255.224 202.96.123.5 metric 5
(3) route change: This command can modify the data transmission route; however, the user cannot use this command to change the destination of the data. The following example changes the previous route to one that includes a path of 3 subnets:
route add 209.99.32.33 mask 255.255.255.224 202.96.123.250 metric 3
(4) route delete: This command can remove routes from the routing table. For example: route delete 209.99.32.33
6. nslookup Command

(2) View the IP of http://www.baidu.com. Simply enter the IP address or domain name you want to query at the prompt and press enter.

7. nbtstat Command
8. netstat Command

Below are some common options for netstat:
① netstat –a: The -a option displays a list of all valid connection information, including established connections (ESTABLISHED) and those connections that are listening for connection requests (LISTENING).
② netstat –n: Lists IP addresses in dot-decimal format instead of symbolic hostnames and network names.

③ netstat -e: The -e option displays statistics about Ethernet. It lists items including the total number of bytes sent, errors, drops, number of packets, and broadcasts. These statistics include both sent and received packet counts. This option can be used to assess basic network traffic.
④ netstat -r: The -r option displays information about the routing table, similar to what is seen with the route print command. In addition to displaying valid routes, it also shows current valid connections.

⑤ netstat -s: The -s option can display statistics for each protocol separately. This allows you to see which connections exist on the network and the details of packet sending and receiving, etc. If applications (like web browsers) are running slowly or cannot display web pages, this option can be used to check the displayed information. Carefully review the statistics in each row to find the keywords indicating errors, thus determining the problem.

9. net Command
The table below lists basic NET commands and their functions:

Disclaimer: Quality content is valuable for sharing with everyone. Some content is sourced from the internet; if there is any infringement, please inform us, and we will address it promptly. For collaboration and communication, please add WeChat ID:18821279660.