Recommended mastery: common network commands in weak current engineering
The current weak electricity project can become a network project. Basically, it is digital and networked. Therefore, we need to master certain network knowledge. Today we share some common network commands, and the equipment is used for debugging and maintenance.
Ping command
Ping is a very frequently used utility that is primarily used to determine network connectivity. This is useful for determining if the network is properly connected and for the status of the network connection. Simply put, ping is a test program. If the ping is running correctly, the faults of the network access layer, network card, modem input and output lines, cables and routers can be eliminated, thus narrowing 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 pass too many routers or networks, and the connection speed is faster. The ping can also display the TTL (Time To Live) value. The TTL value can be used to estimate how many routers the packet passes.
1, the command format
Ping hostname
Ping domain
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. This example is normal. A total of four test packets were sent and four packets were received correctly.
2, the basic application of the ping command
In general, users can use a series of ping commands to find out where the problem is or verify the network operation. A typical test sequence and corresponding possible faults are given below:
1 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 are set properly. If the test is unsuccessful, it indicates that there is a problem with the installation or setup of TCP/IP.
2 ping the local IP address
If the test is unsuccessful, it indicates that there is a problem with the local configuration or installation. Network devices and communication media should be tested, checked, and excluded.
3 ping other IPs in the LAN
If the test is successful, the network card and carrier in the local network are running correctly. However, if you receive 0 echo responses, it means that the subnet mask is incorrect or the network card is configured incorrectly or there is a problem with the cable system.
4 ping gateway IP
If this command is answered correctly, it means that the gateway router in the LAN is running and able to respond.
5 ping remote IP
If a correct response is received, the default gateway is successfully used. For dial-up users, it means that they can successfully access the Internet (but not to rule out the ISP's DNS).
6 ping localhost
Local host is the system's network reserved name, which is an alias for 127.0.0.1, and each computer should be able to translate the name into that address. Otherwise, there is a problem in the host file (/Windows/host).
7 ping (a famous domain name)
To execute the Ping command on this domain name, 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 local DNS server is not configured correctly, or the DNS server it accesses is faulty.
If all the ping commands listed above work, then there is basically no problem with the local and remote communication of the computer. However, the success of these commands does not mean that all your network configurations are ok. For example, some subnet mask errors may not be detected by these methods.
3, common parameter options for the ping command
Ping IP -t: pings the IP address continuously until it is interrupted by the user with Ctrl C.
Ping IP -l 2000: Specifies the specific data length in the ping command (here 2000 bytes) instead of the default 32 bytes.
Ping IP -n 20: A ping command that executes a specific number of times (here 20).
Ipconfig command
The ipconfig utility can be used to display the settings of 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, use the ipconfig command to find out if your computer successfully leased an IP address. If you have already rented it, you can know what address it is currently getting. Includes network configuration information such as IP address, subnet mask, and default gateway.
The most common options are given below:
1, ipconfig
When using the ipconfig command without any parameter option, the IP address, subnet mask, and default gateway value of each configured interface are displayed.
2, ipconfig /all
When the all option is used, ipconfig can display additional information that it has configured and used for the DNS and WINS servers, and can display the physical address (MAC) built into the local NIC. If the IP address is leased from a DHCP server, ipconfig will display the IP address assigned by the DHCP server and the date the leased address is expected to expire. The picture shows the result window for 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 to the DHCP server. If you enter ipconfig /release, the leased IP address of all interfaces is re-delivered to the DHCP server (returning the IP address). If the user enters ipconfig /renew, the local computer tries to get a connection with the DHCP server and leases an IP address. In most cases the network card will be reassigned to the same IP address as previously given.
Arp command (address translation protocol)
ARP is an important protocol in the TCP/IP protocol suite for determining the physical address of a network card corresponding to an IP address.
Use the arp command to view the current contents of the ARP cache on the local or another computer. In addition, the arp command can be used to manually set a static NIC physical address/IP address pair. This method can be used for local static configuration of common hosts such as the default gateway and the local server, which helps reduce the amount of information on the network.
By default, the items in the ARP cache are dynamic, and ARP automatically adds the item whenever it sends data to the specified location and the current project does not exist in the cache.
Common command options:
1 arp –a: Used to view all items in the cache.
2 arp -a IP: If there are multiple network cards, use arp -a plus the IP address of the interface to display only the ARP cache entries associated with the interface.
3 arp -s IP Physical Address: Manually enter a static entry into the ARP cache. The project will remain active during the computer boot process, or the manually configured physical address will automatically update the project in the event of an error.
4 arp -d IP: Use this command to manually delete a static project.
Traceroute command
Master the skills of using the traceroute command to measure routing conditions, which is used to display the path that a packet takes 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. 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 router serial number 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 messages 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 check the steps or routes taken by the network when connecting to the site. If the network is faulty, you can use this command to view the location where the problem occurred.
Thinking:
Test the routing of large networks:
(1) Try “ping†several times and compare the IP address of Sina.com. If the IP addresses obtained by the two pings are different, consider the reasons (such as considering load balancing). Then, for these different IP addresses, execute the “tracert ip_address†command to observe whether the results of the analysis output 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-1 hop. Try to analyze the reasons (hint: the role of each component of the delay in the total delay can be considered separately).
(3) Use the traceroute program to test the route from the fixed host to the remote fixed IP address multiple times during different time of day. Try to analyze and compare the measured data to see if the route changes? If there is a change, is this change frequent?
Route command
Most hosts typically reside on a network segment that is connected to only one router. Since there is only one router, there is no question of which router to use to send packets to the remote computer. The router's IP address 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, the user does not necessarily want to rely solely on the default gateway. In fact, you might want to pass some remote IP addresses through a specific router, while other remote IPs pass through another router. In this case, the user needs the corresponding routing information, which is stored in the routing table. 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. However, in some cases, items must be manually added to the routing tables on the router and host. 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 project in the routing table. The output on a single router segment is shown in the figure.
2, route add
With this command, you can add routing items to the routing table.
For example, if you want to set a route to the destination network 209.99.32.33, you must go through 5 router network segments, first through a router on the local network IP is 202.96.123.5, subnet mask is 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. However, users cannot use this command to change the destination of data. The following example uses the path of the above example route change to include three 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 a route from the routing table. For example: route delete 209.99.32.33
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 the domain name. If the user has already 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 check the IP address and domain name server address of the machine.
Directly type the command, the system returns the server name (with the full name of the domain name) and IP address, and enters the command line state with the prompt of ">"; type "?" to query the detailed command parameters; to exit, You need to type exit.
(2) View the IP. Enter the IP address or domain name you want to query at the prompt and press Enter.
Nbtstat command
Use the nbtstat command to view some information about the network configuration on your computer. You can also use this command to find some private information on someone else's computer. If you want to view the network information on your computer, you can run nbtstat -n to get your working group, computer name and network card address, etc. If you want to check other computers on the network, run nbtstat -a *.*. *.*, where *.*.*.* is replaced with an IP address, it will return some information on that host.
Netstat command
Learn to use the netstat command to see 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, IPv6) TCP and UDP protocols). If used without parameters, netstat displays the active TCP connection.
Here are some common options for netstat:
1 netstat –a: The -a option displays a list of all valid connection information, including established connections (ESTABLISHED), as well as those connections that are LISTENING.
2 netstat –n: Lists IP addresses in dotted decimal notation, not symbolic hostnames and network names.
3 netstat -e: The -e option is used to display statistics about Ethernet. The items it lists include the total number of bytes of the transmitted packet, the number of errors, the number of deletions, the number of packets, and the number of broadcasts. These statistics have both the number of packets sent and the number of packets received. Use this option to count some basic network traffic.
4 netstat -r:-r option can display information about the routing table, similar to the information seen when the route print command. In addition to displaying a valid route, the currently active connection is also displayed.
The above figure shows a routing table, where: Network Destination indicates the destination network, 0.0.0.0 indicates the unknown network, which is automatically generated by the system after setting the default gateway; 127.0.0.0 indicates the local network address for testing; 224.0. 0.0 indicates a multicast address; 255.255.255.255 indicates a restricted broadcast address; Netmask indicates a network mask, Gateway indicates a gateway, Interface indicates an interface address, and metric indicates a route hop count.
5 The netstat -s:-s option displays its statistics separately for each protocol. This allows you to see which connections are currently on the network, as well as details of packet transmission and reception. If an application (such as a web browser) runs slower, or does not display data such as web pages, you can use this option to view the information displayed. Look through the rows of the statistics and find the keywords that are in error to determine the problem.
Net command
Learn about the features of Net services and learn to use Net service commands to solve network problems.
Type net help command at the command line to get the 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 is used to prompt the user to confirm that all dependent server services are stopped, and net stop server/y means to confirm the stop and shut down the server service.
The following table lists the basic NET commands and what they do:
The results of the NET command execution are similar to those obtained by other Windows Server 2003 management tools. However, the NET command can provide all the information in one place and redirect the results to a printer or a standard text file.
Network commands used by many services start with net. These net commands have some common properties. To see a list of all available net commands, type net/ in the command prompt window. get.
NINGBO NEW SUCCESS ARTS AND CRAFTS CO.,LTD , https://www.craftandtoy.com