Summary of common network commands used in Windows

Source: Internet
Author: User

I don't forget that Windows has evolved from a simple DOS character interface. Although we usually operate on the GUI when using the Windows operating system, we are still very useful in doscommands. Let me see the functions of these commands, learn how to use these commands at the same time.

I. Tips for using Ping commands

Ping is a frequently used utility used to determine whether a local host can exchange (send and receive) data packets with another host. Based on the returned information, we can infer whether the TCP/IP parameter is set correctly and whether the operation is normal. Note that successfully performing one or two exchanges with another host does not indicate that the TCP/IP configuration is correct, we must exchange data between a large number of local hosts and remote hosts to ensure the correctness of TCP/IP.

To put it simply, Ping is a test program. If Ping runs correctly, we can basically eliminate faults in the network access layer, Nic, MODEM input/output lines, cables, and routers, this reduces the scope of the problem. However, Ping can also be used as a DDOS (Denial of Service Attack) tool by someone with ulterior motives to customize the size and endless high-speed transmission of the datagram, for example, many large websites are paralyzed by hackers who use hundreds of computers that can access the Internet at high speed to send a large number of Ping data packets.

According to the default settings, the Ping command on Windows sends four ICMP (inter-network control packet protocol) Send back requests, each 32 bytes of data, if everything is normal, we should be able to receive four replies. Ping can display the time between sending a return request and returning a return response in milliseconds. If the response time is short, the datagram does not have to pass through too many routers or network connections. Ping can also display the TTL value. We can use the TTL value To estimate how many routers the data packet has passed: the start value of the TTL at the source location (that is, a 2th percentile value that is slightly greater than the returned TTL)-the TTL value returned. For example, if the returned TTL value is 119, the initial TTL value of the outbound data packet from the source address is 128, and the source point to the target location must pass 9 vro network segments (128-119 ); if the returned TTL value is 246, the start value of TTL is 256, and the source and target locations must pass through nine vro network segments.

1. Typical order of network faults detected by Ping

Under normal circumstances, when we use the Ping command to find the problem or check the network running status, we need to use many Ping commands. If all of them are running correctly, we can believe that the basic connectivity and configuration parameters are correct. If some Ping commands fail, it can also specify where to locate the problem. The following describes a typical detection sequence and possible faults:

Ping 127.0.0.1
The Ping Command is sent to the IP address software of the local computer, which never exits. If this is not done, it indicates that the installation or running of TCP/IP has some basic problems.

Ping local IP Address
This command is sent to the IP address configured by our computer. Our computer should always respond to this Ping command. If it does not exist, it indicates that there is a problem with the local configuration or installation. When this problem occurs, the LAN user must disconnect the network cable and then resend the command. If this command is correct after the network cable is disconnected, it indicates that the same IP address may be configured on the other computer.

Ping other IP addresses in the LAN
This command should leave our computer, go through the nic and network cable to other computers, and then return. If you receive a response, the NIC and carrier in the local network are running correctly. However, if you receive 0 replies, it indicates the subnet mask (code that separates the network part of the IP address from the host part during subnet division) incorrect or the NIC configuration is incorrect or the cable system is faulty.

Ping the gateway IP Address
If the command is correct, it indicates that the Gateway Router in the LAN is running and can respond.

Ping remote IP
If you receive four responses, the default gateway is successfully used. A dial-up Internet user can successfully access the Internet (but it is not ruled out that the ISP's DNS may be faulty ).

Ping localhost
Localhost is a reserved network name for the system. It is an alias of 127.0.0.1. Every computer that is too computer can convert the name to this address. If this is not done, the host file (/Windows/host) is faulty.

Ping www.xxx.com (for example, www.yesky.com)
Ping www.xxx.com for this domain name. If the DNS server fails, the IP address of the DNS server is incorrectly configured or the DNS server is faulty (for dial-up Internet users, some ISPs do not need to set DNS servers ). By the way, we can also use this command to convert domain names to IP addresses.

If all the Ping commands listed above can run properly, we can basically rest assured that the local and remote communication functions of our computers can be implemented. However, the success of these commands does not mean that all our network configurations are normal. For example, some subnet mask errors may not be detected using these methods.

2. Ping Command Parameters

Ping IP-t
Run the Ping command on the IP address until the IP address is interrupted by Ctrl + C.

Ping IP-l 3000
The Data Length in the Ping command is 3000 bytes instead of the default 32 bytes.

Ping IP-n
Run the Ping command for a specified number of times.
  
Ii. Netstat command usage skills

Netstat is used to display statistics related to IP, TCP, UDP, and ICMP protocols. It is generally used to check the network connection of each port on the local machine.


If the data packets received by our computer sometimes lead to data deletion or failure errors, we do not need to be surprised that TCP/IP can allow these types of errors and automatically resend the data packets. However, if the cumulative number of errors accounts for a considerable percentage of the received IP data packets, or the number of errors increases rapidly, then we should use Netstat to check the cause.

1. Some common netstat options

Netstat-s

This option displays statistical data for each protocol. If our applications (such as Web browsers) run slowly or cannot display data such as Web pages, we can use this option to view the displayed information. We need to carefully check the rows of statistics, find the keyword of the error, and then determine the problem.

Netstat-e

This option is used to display statistics about Ethernet. It lists items including the total number of bytes, number of errors, number of delimiters, number of datagram, and number of broadcasts. These statistics include both the number of sent and received data packets. This option can be used to calculate some basic network traffic ).

Netstat-r

This option displays information about the route table, similar to the information shown later when you use the route print command. In addition to valid routes, valid connections are also displayed.

Netstat-

This option displays a list of all valid connection information, including the ESTABLISHED connections (ESTABLISHED) and those that listen to the LISTENING requests.

Netstat-n

All established valid connections are displayed.

The following is an output example of netstat:

C:> netstat-e

Interface Statistics

ReceivedSent

Bytes399582134047224622

Unicast packets120099131015

Non-unicast packets7579544 3823

Discards 0 0

Errors 0 0

Unknown protocols363054211

C:> netstat-

Active Connections

Proto Local AddressForeign Address State

TCPCORP1: 1572 172.16.48.10: nbsession ESTABLISHED

TCPCORP1: 1589 172.16.48.10: nbsession ESTABLISHED

TCPCORP1: 1606 172.16.105.245: nbsession ESTABLISHED

TCPCORP1: 1632 172.16.48.213: nbsessionESTABLISHED

TCPCORP1: 1659 172.16.48.169: nbsessionESTABLISHED

TCPCORP1: 1714 172.16.48.203: nbsessionESTABLISHED

TCPCORP1: 1719 172.16.48.36: nbsession ESTABLISHED

TCPCORP1: 1241 172.16.48.101: nbsessionESTABLISHED

UDPCORP1: 1025 *:*

UDPCORP1: snmp *:*

UDPCORP1: nbname *:*

UDPCORP1: nbdatagram *:*

UDPCORP1: nbname *:*

UDPCORP1: nbdatagram *:*

C:> netstat-s

IP Statistics

Packets Received = 5378528

Inclued Header Errors = 738854

Received Address Errors = 23150

Required rams Forwarded = 0

Unknown Protocols committed ED = 0

Inclued Packets Discarded = 0

Received Packets Delivered = 4616524

Output Requests = 132702

Routing Discards = 157

Discarded Output Packets = 0

Output Packet No Route = 0

Reassembly Required = 0

Reassembly Successful = 0

Reassembly Failures =

Required rams Successfully Fragmented = 0

Required rams Failing Fragmentation = 0

Fragments Created = 0

ICMP Statistics

ReceivedSent

Messages 693 4

Errors 0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.