Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the very practical windows network debugging commands?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "what are the very practical windows network debugging commands". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "what are the very practical windows network debugging commands?"

1.ping command

Ping is a frequently used utility that is mainly used to determine the connectivity of the network. This is useful for determining whether the network is connected correctly and the condition of the network connection. To put it simply, ping is a test program. If ping runs correctly, it can generally eliminate the problems existing in the network access layer, network card, Modem input and output lines, cables and routers, thus narrowing the scope of the problem.

Ping can display the amount of time between sending a request and returning a reply in milliseconds. If the answer time is short, it means that the Datagram does not have to go through too many routers or networks, and the connection speed is faster. Ping can also display the TTL (time to Live) value, which allows you to calculate how many routers the packet has passed through the TTL value.

Command format

Ping Hostnam

Ping domain name

Ping IP address

As shown in the figure, use the ping command to check the connectivity of the computer to the IP address 210.43.16.17, in this case the connection is normal. A total of four test packets were sent and four packets were received correctly.

Basic Application of ping Command

In general, users can use a series of ping commands to find out what the problem is, or to verify that the network is running.

A typical detection sequence and corresponding possible faults are given below:

① ping 127.0.0.1 if the test is successful, it indicates that the network card, installation of TCP/IP protocol, IP address, and subnet mask are set normally. If the test is unsuccessful, there is a problem with the installation or setup of TCP/IP.

② ping native IP address if the test is not successful, it indicates that there is a problem with the local configuration or installation, and the network equipment and communication media should be tested, checked, and eliminated.

If the other IP in the ③ ping LAN is tested successfully, it shows that the network card and carrier in the local network are running correctly. However, if you receive 0 echo replies, it means that the subnet mask is incorrect, the network card is misconfigured, or there is a problem with the cable system.

If the ④ ping gateway IP command answers correctly, it indicates that the gateway router on the LAN is running and can reply.

If the ⑤ ping remote IP receives a correct reply, it indicates that the default gateway was successfully used. For dial-up users, it is indicated that they can successfully access Internet (but do not rule out the problem with ISP's DNS).

⑥ ping localhostlocal host is the network reserved name of the system, which is an alias of 127.0.0.1, and each computer should be able to translate that name to this address. Otherwise, there is a problem in the hosts file (/ Windows/host).

⑦ ping www.yahoo.com (the domain name of a famous website) executes the Ping command on this domain name, and the computer must first convert the domain name to an IP address, usually through a DNS server. If there is a failure here, it means that the IP address of the native DNS server is not configured correctly, or the DNS server it accesses is malfunctioning.

If all the ping commands listed above work properly, there will be basically no problem for the computer to communicate locally and remotely. However, the success of these commands does not mean that there is nothing wrong with all your network configurations. For example, some subnet mask errors may not be detected by these methods.

Common parameter options for the ping command

Ping IP-t: continuously execute ping commands on the IP address until interrupted by the user with Ctrl+C.

Ping IP-l 2000: specifies the specific data length in the ping command (2000 bytes here) instead of the default 32 bytes.

Ping IP-n 20: execute the ping command for a specific number of times (in this case, 20).

Note: with the widespread use of firewall functions in the network, when you ping other hosts or other hosts ping your host, and show that the host is unreachable, do not jump to conclusions. It is best to compare with the ping results for a "well-set" host.

2. Ipconfig command

The ipconfig utility can be used to display the settings for the current TCP/IP configuration. This information is generally used to verify that the manually configured TCP/IP settings are correct.

Moreover, if the computer and the local area network use the dynamic host configuration protocol DHCP, you can use the ipconfig command to know whether your computer has successfully leased an IP address, and if it has, you can find out what address it is currently getting, including network configuration information such as IP address, subnet mask and default gateway. Here are the most commonly used options:

(1) ipconfig: displays the IP address, subnet mask, and default gateway value of each configured interface when using the ipconfig command without any parameters.

(2) ipconfig / all: when using the all option, ipconfig can display additional information that it has configured and used for DNS and WINS servers, as well as the physical address (MAC) built into the local network card. If the IP address is leased from a DHCP server, ipconfig displays the IP address assigned by the DHCP server and the expected expiration date of the leased address. The figure shows the result window of running the ipconfig / all command.

(3) ipconfig / release and ipconfig / renew: these two additional options can only be used on computers that lease IP addresses from DHCP servers. If you enter ipconfig / release, the leased IP addresses of all interfaces are redelivered to the DHCP server (returning the IP address). If the user enters ipconfig / renew, the local computer tries to contact the DHCP server and lease an IP address. In most cases, the Nic will be re-assigned the same IP address as previously assigned.

3. Arp command (address translation protocol)

ARP is an important protocol in the TCP/IP protocol family, which is used to determine the physical address of the network card corresponding to the IP address.

Using the arp command, you can view the current contents of the ARP cache on your local computer or on another computer. In addition, using the arp command, you can manually set static Nic physical address / IP address pairs, which allows local static configuration for common hosts such as default gateways and local servers, which helps to reduce the amount of information on the network.

By default, the item in the ARP cache is dynamic, and ARP automatically adds the item whenever data is sent to the specified location and the current item does not exist in the cache. Common command options:

① arp-a: used to view all items in the cache.

② arp-an IP: if you have multiple network cards, you can use arp-a plus the IP address of the interface to display only the ARP cache items associated with that interface.

③ arp-s IP physical address: manually enter a static item into the ARP cache. The project will remain valid during computer boot, or the manually configured physical address will automatically update the project when an error occurs.

④ arp-d IP: use this command to manually delete a static project.

4. Traceroute command

Master the skill of using the traceroute command to measure routing, that is, to show the path that packets take to reach the destination host.

The basic use of the traceroute command is to type "tracert host_name" or "tracert ip_address" at the command prompt, where tracert is the name of traceroute on the Windows operating system.

The output has 5 columns:

The first column is the number describing the nth hop of the path, that is, the serial number of the router 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; and the fifth column is the name of the router and the IP address of its input port.

If the source receives less than three messages from any given router (due to packet loss in the network), traceroute places an asterisk after the router number and reports less than three round trips to that router.

In addition, the tracert command can be used to see what steps the network has taken or which route the network has taken to connect to the site, and if the network has failed, you can use this command to see where the problem occurred.

Think about [testing routing for large networks]:

(1) try the "ping www.sina.com.cn" operation several times and compare the IP address of Sina. If the IP addresses obtained by the two ping are different, consider the reasons (such as load balancing). Then, for these different IP addresses, execute the "tracert ip_address" command to see if there is any difference in the output.

(2) traceroute test is carried out for a site in a large network, and the test results are recorded. Observe whether the delay of the nth hop is less than the delay of the nmel1 hop. Try to analyze the reasons (hint: the role of each component of the delay in the total delay can be considered separately).

(3) at different times of the day, use the traceroute program to test the route from a fixed host to a remote host with a fixed IP address. Try to analyze and compare the measured data to see if the route has changed? If there is a change, should it change frequently?

5. Route command

Most hosts typically reside on a network segment connected to only one router. Because there is only one router, there is no question of which router to use to send the packet to the remote computer, and the IP address of that router can be used as the default gateway for all computers on that segment.

However, when there are two or more routers on the network, users do not necessarily want to rely on only the default gateway. You may actually want some remote IP addresses to be passed through a particular router, while other remote IP addresses may be passed through another router. In this case, the user needs the corresponding routing information, which is stored in the routing table, and each host and router is equipped with its own unique routing table. Most routers use special routing protocols to exchange and dynamically update routing tables between routers. In some cases, however, items must be manually added to the routing table on the router and host. The route command is used to display, manually add, and modify routing table items. The following options are available for this command:

(1) route print: this command is used to display the current items in the routing table, and the output on a single router segment is 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 through five router segments, first 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.224 202.96.123.5 metric 5

(3) route change: you can use this command to modify the transmission route of data, but users cannot use this command to change the destination of the data. The following example changes the routing in the previous example to a path that contains three network segments:

Route add 209.99.32.33 mask 255.255.255.224 202.96.123.250 metric 3

(4) route delete uses this command to delete routes from the routing table. For example: route delete 209.99.32.33

6. Nslookup command

The function of the command nslookup is to query the IP address of any machine and its corresponding domain name. It usually requires a domain name server to provide domain names. If the user has set up a domain name server, you can use this command to view the domain name corresponding to the IP address of different hosts.

(1) use the nslookup command on the local machine to view the local IP and domain name server address.

Type the command directly, and the system returns the local server name (with the full name of the domain name) and IP address, and enters the operation command line state with ">" as the prompt; type "?" You can query the detailed command parameters; to exit, type exit.

(2) check the IP of www.haut.edu.cn. Enter the IP address or domain name you want to query at the prompt and enter.

7. Nbtstat command

Use the nbtstat command to view some information about the network configuration on your computer. Using this command, you can also find some private information on other people's computers. If you want to view the network information on your computer, you can run nbtstat-n, you can get your workgroup, computer name and network card address, etc.; if you want to see other computers on the network, run nbtstat-a *. *, replace the *. * here with the IP address and you will return some information on that host.

8. Netstat command

Learn to use the netstat command to understand the current state of the network.

The netstat command displays active TCP connections, ports on which the computer listens, Ethernet statistics, IP routing table, IPv4 statistics (for IP, ICMP, TCP, and UDP protocols), and IPv6 statistics (for IPv6, ICMPv6, TCP over IPv6, and UDP protocols). If used without parameters, netstat displays the active TCP connection.

Here are some common options for netstat:

The ① netstat-an ESTABLISHED option displays a list of all valid connection information, including established connections (connections), as well as those that listen for connection requests (LISTENING).

② netstat-n: lists IP addresses in dotted decimal rather than symbolic hostnames and network names.

The ③ netstat-eRERIMUE option is used to display statistics about Ethernet. It lists the total number of bytes, errors, deletions, packets, and broadcasts of packets transmitted. These statistics include both the number of packets sent and the number of packets received. Use this option to count some basic network traffic.

The ④ netstat-r route print option displays information about the routing table, similar to that seen in the routing command. In addition to showing valid routes, it also shows the currently valid connections.

The figure above shows a routing table, where Network Destination represents the destination network, 0.0.0.0 indicates an unknown network, which is automatically generated by the system after the default gateway is set, 127.0.0.0 represents the local network address for testing, 224.0.0.0 indicates the multicast address, and 255.255.255.255 indicates the restricted broadcast address Netmask represents the network mask, Gateway represents the gateway, Interface represents the interface address, and Metric represents the number of routing hops.

The ⑤ netstat-SvULAMUS option can display its statistics according to each protocol. In this way, you can see what connections the current computer has on the network, as well as the details of the sending and receiving of packets, and so on. If an application, such as a Web browser, is slow or cannot display data such as Web pages, you can use this option to view the information displayed. Take a closer look at the lines of the statistics to find the keywords that went wrong, and then determine where the problem lies.

9. Net command

Understand the functions of Net services and learn to use Net service commands to solve network problems.

Type net help command on the command line to get syntax help for the net command on the command line. For example, to get help on the net accounts command, type "net help accounts". The / y and / n command line options are available for all net commands. For example, the net stop server command prompts the user to confirm that all dependent server services are stopped, and net stop server/y confirms that the server services are stopped and shut down.

The following table lists the basic NET commands and what they do:

The NET command provides all the information in one place and redirects the results to a printer or a standard text file.

Many services use network commands that begin with net, and these net commands have some common properties. To see a list of all available net commands, type net/? at the command prompt Get it.

At this point, I believe you have a deeper understanding of "what are the very practical windows network debugging commands?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report