1. ping command
Ping is a very frequently used utility, mainly used to determine network connectivity. This is very useful for determining whether the network is properly connected and the status of the network connection. Simply put, ping is a test program. If ping runs correctly, it can basically eliminate the faults in the network access layer, network card, modem input and output lines, cables, and routers, thereby narrowing the scope of the problem.
Ping can display the amount of time between sending a request and returning a response in milliseconds. If the response time is short, it means that the datagram does not have to go through too many routers or networks, and the connection speed is relatively fast. Ping can also display the TTL (Time To Live) value, and the TTL value can be used to calculate how many routers the packet has passed through.
(1) Command format
ping hostname
ping domain name
ping IP address
As shown in the figure, use the ping command to check the connectivity of the computer with the IP address 210.43.16.17. In this example, the connection is normal. Four test data packets were sent and four data packets were received correctly.
(2) Basic application of ping command
In general, users can use a series of ping commands to find out where the problem is, or to check the network operation.
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, TCP/IP protocol installation, IP address, and subnet mask settings are normal. If the test is unsuccessful, it means that there is a problem with the TCP/IP installation or settings.
â‘¡ ping the local IP address
If the test is unsuccessful, it means that there is a problem with the local configuration or installation, and the network equipment and communication media should be tested, checked and eliminated.
â‘¢ ping other IP in LAN
If the test is successful, it indicates that the network card and carrier in the local network are operating correctly. But if you receive 0 echo responses, it means that the subnet mask is incorrect or the network card configuration is incorrect or there is a problem with the cable system.
â‘£ ping the gateway IP
If this command is answered correctly, it means that the gateway router in the LAN is running and able to respond.
⑤ ping remote IP
If a correct response is received, it means that the default gateway has been successfully used. For dial-up users, it means that they can successfully access the Internet (but it does not rule out that the ISP's DNS will have problems).
â‘¥ ping localhost
Local host is the reserved network name of the system. It is an alias of 127.0.0.1. Every computer should be able to translate the name into this address. Otherwise, it means there is a problem in the host file (/Windows/host).
⑦ ping (a famous website domain name)
To execute the Ping command on this domain name, the computer must first convert the domain name into an IP address, usually through a DNS server. If there is a failure here, it means that the IP address of the local DNS server is incorrectly configured, or the DNS server it accesses is faulty
If all the ping commands listed above can operate normally, then the computer will basically have no problem with local and remote communication. However, the success of these commands does not mean that all your network configurations are okay. For example, some subnet mask errors may not be detected by these methods.
(3) Common parameter options of the ping command
ping IP -t: Continuously execute the ping command on the IP address until it is interrupted by the user with Ctrl+C.
ping IP -l 2000: Specify 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 a specific number of times (20 here).
Note: As the firewall function is widely used in the network, when you ping other hosts or other hosts ping your host, and the host is unreachable, do not jump to conclusions. It's best to compare with the ping result of a "well set up" host.
2. ipconfig command
The ipconfig utility can be used to display the current TCP/IP configuration settings. This information is generally used to verify whether the manually configured TCP/IP settings are correct.
Moreover, if the computer and the local area network use the dynamic host configuration protocol DHCP, use the ipconfig command to know whether your computer has successfully leased an IP address. If it has been leased, you can know what address it currently has. Including network configuration information such as IP address, subnet mask, and default gateway.
The most commonly used options are given below:
(1) ipconfig: When using the ipconfig command without any parameter option, it displays the IP address, subnet mask and default gateway value of each configured interface.
(2) ipconfig /all: When the all option is used, ipconfig can display additional information that it has configured and used for DNS and WINS servers, and can display the physical address (MAC) built into the local network card. If the IP address is leased from a DHCP server, ipconfig will display the IP address assigned by the DHCP server and the expected expiration date of the leased address. The picture 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 the DHCP server. If you enter ipconfig /release, the leased IP addresses of all interfaces will be re-delivered to the DHCP server (return IP addresses). If the user enters ipconfig /renew, then the local computer will try to get in touch with the DHCP server and lease an IP address. In most cases, the network card 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 suite, used to determine the physical address of the network card corresponding to the IP address.
Use the arp command to view the current contents of the ARP cache of the local computer or another computer. In addition, the arp command can be used to manually set a static network card physical address/IP address pair. This method can be used to perform local static configuration for common hosts such as the default gateway and local server, which helps reduce the amount of information on the network.
According to the default setting, the item in the ARP cache is dynamic. ARP will automatically add the item whenever data is sent to a specified location and there is no current item in the cache at this time.
Common command options:
â‘ arp -a: Used to view all items in the cache.
â‘¡ arp -a IP: If there are multiple network cards, use arp -a and the IP address of the interface to display only the ARP cache items related to the interface.
â‘¢ arp -s IP physical address: manually input a static item into the ARP cache. The item will remain valid during the computer boot process, or when an error occurs, the manually configured physical address will automatically update the item.
â‘£ arp -d IP: Use this command to manually delete a static item.
4. traceroute command
Master the skills of using the traceroute command to measure routing conditions, that is, to display the path taken by the data packet to reach the destination host.
The basic usage 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 value describing the nth hop of the path, that is, the sequence 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;
The fifth column is the name of the router and the IP address of its input port.
If the source receives less than 3 packets from any given router (due to packet loss in the network), traceroute puts an asterisk after the router number and reports less than 3 round trips to that router time.
In addition, the tracert command can also be used to view the steps or route taken by the network when connecting to the site. If the network fails, you can use this command to view the location of the problem.
Thinking [test routing of large networks]:
(1) Try the "ping" 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 (for example, considering load balancing). Then, for these different IP addresses, execute the "tracert ip_address" command to observe whether there are differences in the results of the analysis output.
(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 reasons (hint: consider the role of each component of the delay in the total delay).
(3) In different periods 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, and observe whether the route has changed? If there is a change, is it frequent?
5. route command
Most hosts generally reside on a network segment connected to only one router. Since there is only one router, there is no problem of choosing which router to use to send data packets to the remote computer. The IP address of this router can be used as the default gateway for all computers on the network segment.
However, when there are two or more routers on the network, users do not necessarily want to rely only on the default gateway. In fact, you may want some remote IP addresses to be passed through a specific router, while other remote IP addresses are 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 each router is equipped with its own unique routing table. Most routers use specialized routing protocols to exchange and dynamically update routing tables between routers. But in some cases, you must manually add items to the routing tables on routers and hosts. The route command is used to display, manually add and modify routing table items. The command can use the following options:
(1) route print: This command is used to display the current items in the routing table, and the output result on a single router network 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, and pass through 5 router network segments, first 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.224 202.96.123.5 metric 5
(3) Route change: This command can be used to modify the data transmission route, but the user cannot use this command to change the data destination. The following example changes the route of the previous example to use a path with 3 network segments:
route add 209.99.32.33 mask 255.255.255.224 202.96.123.250 metric 3
(4) route delete Use 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 the domain name server, you can use this command to view the domain names corresponding to the IP addresses of different hosts.
(1) Use the nslookup command on the local machine to view the machine's IP and domain name server addresses.
Type the command directly, the system returns the server name (full name with domain name) and IP address of the machine, and enters the command line state with ">" as the prompt; type "?" to query detailed command parameters; if you want to exit, You need to type exit.
(2) View the IP. After the prompt, enter the IP address or domain name to be queried and press Enter.
7. nbtstat command
Use the nbtstat command to view some information about the network configuration on the computer. Use this command to find out 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, network card address, etc.; if you want to view other computers on the network, run nbtstat -a *.* .*.*, where *.*.*.* is replaced with an IP address 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 can display active TCP connections, computer listening ports, Ethernet statistics, IP routing tables, IPv4 statistics (for IP, ICMP, TCP and UDP protocols), and IPv6 statistics (for IPv6, ICMPv6, through IPv6 TCP and UDP protocols). If used without parameters, netstat displays active TCP connections.
Some common options of netstat are given below:
â‘ netstat -a: The -a option displays a list of all valid connection information, including established connections (ESTABLISHED), as well as those connections that monitor connection requests (LISTENING).
â‘¡ netstat -n: List IP addresses in dotted decimal form, rather than symbolic host names and network names.
â‘¢ netstat -e: -e option is used to display statistics about Ethernet. The items it lists include the total number of bytes transmitted, the number of errors, the number of deletions, the number of packets, and the number of broadcasts. These statistics include both the number of packets sent and the number of packets received. Use this option to count some basic network traffic.
â‘£ netstat -r: The -r option can display information about the routing table, similar to the information seen during the route print command. In addition to displaying valid routes, it also displays currently valid connections.
The figure above shows a routing table, where: Network Destination represents the destination network, 0.0.0.0 represents the unknown network, which is automatically generated by the system after setting the default gateway; 127.0.0.0 represents the local network address for testing; 224.0. 0.0 represents a multicast address; 255.255.255.255 represents a restricted broadcast address; Netmask represents a network mask, Gateway represents a gateway, Interface represents an interface address, and Metric represents a routing hop count.
⑤ netstat -s: The -s option can display statistical data according to each protocol. In this way, you can see which connections the current computer has on the network, as well as the details of the sending and receiving of data packets, and so on. If the application (such as a web browser) runs slowly or cannot display data such as web pages, you can use this option to view the displayed information. Look carefully at each line of the statistical data, find the wrong keyword, and then determine the problem.
9. net command
Understand the function of Net service and learn to use Net service commands to solve network problems.
Type net help command on the command line to get the syntax help of the net command on the command line. For example, to get help information about the net accounts command, type "net help accounts".
All net commands can use the /y and /n command line options. For example, the net stop server command is used to prompt the user to confirm to stop all dependent server services, and net stop server/y means to confirm to stop and close the server service.
The following table lists the basic NET commands and their functions:
command | example | effect |
NET ACCOUNTS | NET ACCOUNTS | View current account settings |
NET CONFIG | NET CONFIG SERVER | Check the statistics of this network configuration |
NET GROUP | NET GROUP | Look up the domain group (on the domain controller) |
NET PRINT | NET PRINT\printserverprinter1 | View or modify printer mapping |
NET SEND | NET SEND server1 "test message" | Send messages or broadcast messages to other computers |
NET SHARE | NET SHARE | View shared files on local computer |
NET START | NET START Messenger | Start service |
NET STATISTICS | NET STATISTICS SERVER | View network traffic statistics |
NET STOP | NET STOP Messenger | Out of service |
NET USE | NET USE x:\server1admin | Map network share files to a drive letter |
NET USER | NET USER | Check local user account |
NET VIEW | NET VIEW | Check available computers on the network |
UV Film,UV Screen Protector,UV Curing Screen Protector
Shenzhen Jianjiantong Technology Co., Ltd. , https://www.jjttpucuttingplotter.com