laitimes

Some common network commands necessary for weak current engineering construction personnel

#夏日生活打卡季#

preface

Hello everyone, cloud intelligence knowledge sharing, some common network commands necessary for weak current engineering construction personnel, let's take a look at what knowledge points are there!

body

ping command

Ping is a highly used utility that is used to determine network connectivity. This is useful for determining if the network is properly connected and the status of the network connection. To put it simply, ping is a test program that, if run correctly, can largely eliminate faults in the network access layer, network cards, modem input and output lines, cables, and routers, thereby narrowing the scope of the problem.

Ping is able to show the amount of time between sending a request and replying 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 relatively fast. Ping can also display the TTL (Time To Live) value, which can be used to calculate how many routers the packet has passed.

Some common network commands necessary for weak current engineering construction personnel

1. Command format

ping the hostname

Ping the domain name

ping IP地址

Some common network commands necessary for weak current engineering construction personnel

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

2. The 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 how well the network is working. A typical detection sequence and the corresponding possible faults are given below:

① ping 127.0.0.1

If the test is successful, the NIC and TCP/IP protocol are installed, and the 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 setup.

② ping 本机IP地址

If the test is unsuccessful, there is a problem with the local configuration or installation, and the network equipment and communication media should be tested, checked, and eliminated.

(3) ping局域网内其他IP

If the test is successful, the NIC and carrier in the local network are running correctly. However, if 0 callback responses are received, the subnet mask is incorrect, the NIC is misconfigured, or there is a problem with the cable system.

(4) Ping the gateway IP

If the command is answered correctly, it means that the gateway router in the LAN is running and able to answer.

(5) Ping the remote IP

If you receive a correct reply, the default gateway has been successfully used. For dial-up Internet users, it means that they can successfully access the Internet (but it is not excluded that the ISP's DNS will have problems).

(6) Ping LocalHost

local host is the system's network reserved name, which is an alias for 127.0.0.1, and every computer should be able to translate that name to this address. Otherwise, there is a problem in the host file (/Windows/host).

(7) Ping www.yahoo.com (a well-known website domain)

To ping this domain name, the computer must first translate 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 native DNS server is not configured correctly, or the DNS server it is accessing is faulty.

If all of the ping commands listed above work correctly, then the computer will have basically no problem communicating locally and remotely. However, the success of these commands does not mean that all of your network configurations are fine, for example, some subnet mask errors may not be detected by these methods.

3. Common parameter options for ping commands

ping IP -t:连续对IP地址执行ping命令,直到被用户以Ctrl C中断。

ping IP -l 2000: Specifies the specific data length in the ping command (2000 bytes in this case) instead of the default 32 bytes.

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

ipconfig command

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

In addition, if the computer and the LAN are using the dynamic host configuration protocol DHCP, you can use the ipconfig command to find out whether your computer has successfully leased an IP address, and if so, you can find out what address it has obtained, including IP address, subnet mask, default gateway and other network configuration information.

The most commonly used options are given below:

1、ipconfig

When using the ipconfig command without any parameter options, the IP address, subnet mask, and default gateway value of each configured interface are displayed.

2、ipconfig /all

When using the all option, ipconfig displays additional information for the DNS and WINS servers that it has configured and all used, as well as the physical address (MAC) built into the local network card. If the IP address is leased from a DHCP server, ipconfig will show the IP address assigned by the DHCP server and the date on which the leased address is expected to expire. The image shows the result window of running the ipconfig /all command.

Some common network commands necessary for weak current engineering construction personnel

3、ipconfig /release和ipconfig /renew

These two additional options are only available on computers that lease an IP address from a DHCP server. If ipconfig /release is entered, the leased IP addresses for all interfaces are re-delivered to the DHCP server (IP addresses are returned). If the user enters ipconfig /renew, then the local computer manages to get in touch with the DHCP server and rent an IP address. In most cases, the NIC will be reassigned the same IP address as before.

Some common network commands necessary for weak current engineering construction personnel

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 NIC corresponding to the IP address.

Using the arp command, you are able to view the current content in the ARP cache of your local computer or another computer. In addition, you can manually set a static NIC physical/IP address pair by using the arp command, which can be used to perform local static configuration for common hosts such as default gateways and local servers, which helps reduce the amount of information on the network.

By default, items in the ARP cache are dynamic, and ARP automatically adds them whenever data is sent to a specified location and the current item does not exist in the cache at that time.

Common Command Options:

(1) arp –a: Used to view all items in the cache.

Some common network commands necessary for weak current engineering construction personnel

(2) arp -a IP: If there are multiple NICs, you can use arp -a plus the IP address of the interface to display only the ARP cache items related to the interface.

(3) arp -s IP physical address: manually enter a static item into the ARP cache. The item will remain valid during the computer boot process, or in the event of an error, the manually configured physical address will automatically update the item.

(4) arp -d IP: You can manually delete a static project by using this command.

traceroute command

Gain the skill of using the traceroute command to measure routing, which is used to show the path a packet takes to reach the destination host.

traceroute命令的基本用法是,在命令提示符后键入"tracert host_name"或"tracert ip_address",其中,tracert是traceroute在Windows操作系统上的称呼。

Some common network commands necessary for weak current engineering construction personnel

The output has 5 columns:

The first column is the numeric value describing the nth hop of the path, that is, the router sequence 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 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-trip times to that router.

In addition, the tracert command can also be used to see what steps the network took to connect to the site or what route it took, and if the network is down, it can be used to see where the problem is occurring.

Reflections:

Test the routing of a large network:

(1) Try the "ping www.sina.com.cn" operation several times to compare the IP address of Sina.com. If the IP addresses are different for two pings, consider the reasons (e.g. load balancing). Then, run the tracert ip_address command for these different IP addresses to observe whether there are any differences in the output results.

(2) Conduct a traceroute test for a site in a large network and record the test results. Observe whether the delay of the nth hop is less than that of the n-1st hop. Try to analyze the reasons (hint: consider the role of each component of the delay in the total delay).

(3) Test the route from the fixed host to the host with a remote fixed IP address multiple times during different times of the day with the traceroute program. Try to analyze and compare the measurement data to see if there is any change in the route? If so, how often?

route command

Most hosts generally reside on a network segment connected to only one router. Since there is only one router, there is no question of choosing which router to use to send packets to the remote computer, and the IP address of that router serves as the default gateway for all computers on that network segment.

However, when you have two or more routers on your network, you don't necessarily want to rely on just the default gateway. In fact, you may want to have some remote IP addresses pass through a particular router while others pass through another router. In this case, the user needs the appropriate routing information, which is stored in the routing table, and each host and each router has its own unique routing table. Most routers use specialized routing protocols to exchange and dynamically update routing tables between routers. However, in some cases, you must manually add items to the routing tables on the router and host. The route command is used to display, manually add, and modify route table items. The command has the following options:

1、route print

This command is used to display the current item in the route table, and the output result on a single router network segment is shown in the figure.

Some common network commands necessary for weak current engineering construction personnel

2、route add

You can use this command to add a route item to a route table.

For example, if you want to set a route to the destination network 209.99.32.33 and pass through five router CIDR blocks, first pass through a router on the local network with IP address 202.96.123.5 and subnet mask 255.255.255.224, you 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 data transmission route, but you cannot use this command to change the destination of the data. In the following example, the above example changes the route to 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 a route from the route table. For example, route delete 209.99.32.33

nslookup command

The function of the nslookup command is to query the IP address of any machine and its corresponding domain name. It usually requires a nameserver to serve the domain name. If the user has already set up the 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 (full name with domain name) and IP address of the machine, and enters the operation command line state with ">" as the prompt; Type "? You can query the detailed command parameters; To exit, type exit.

Some common network commands necessary for weak current engineering construction personnel

(2) Check the IP address of the www.haut.edu.cn. After the prompt, enter the IP address or domain name you want to query and press enter.

Some common network commands necessary for weak current engineering construction personnel

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 out 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 the workgroup you are in, the computer name, the network card address, etc.; If you want to check the situation of other computers on the network, run nbtstat -a *.*.*.*, where *.*.*.* is replaced by an IP address and it will return some information on that host.

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 tables, IPv4 statistics (for IP, ICMP, TCP, and UDP protocols), and IPv6 statistics (for IPv6, ICMPv6, TCP over IPv6, and UDP protocols). When used, netstat shows the active TCP connection without a parameter.

Some common network commands necessary for weak current engineering construction personnel

Some of the common options for netstat are given below:

(1) The netstat –a:-a option displays a list of all valid connections, including those that have been established and those that are listening for connection requests.

(2) netstat –n: Lists IP addresses in dotted decimal form instead of symbolic hostnames and network names.

Some common network commands necessary for weak current engineering construction personnel

(3) netstat -e:-e option is used to display statistics about Ethernet. It lists items such as the total number of bytes of packets 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.

(4) The netstat -r:-r option can display information about the route table, similar to the information you see when you run the route print command. In addition to displaying valid routes, it also displays the connections that are currently valid.

Some common network commands necessary for weak current engineering construction personnel

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

(5) The netstat -s:-s option can display the statistics of each protocol separately. This allows you to see what connections your computer currently has on the network, details of packet sending and receiving, and more. If your application (e.g., a web browser) is slow or cannot display data such as web pages, you can use this option to view the information displayed. Carefully look at the rows of the stats to find the keywords that are going wrong and identify the problem.

Some common network commands necessary for weak current engineering construction personnel

net command

Understand the functions of the Net service and learn how to use the Net service command to solve network problems.

You can 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 with 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 the stop of all dependent server services, and the net stop server/y indicates that the server service is stopped and shut down.

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

Some common network commands necessary for weak current engineering construction personnel

The results of .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 can redirect the results to a printer or a standard text file.

Many services use network commands that start with net, and these net commands have some common properties. To see a list of all available net commands, you can type net/? Get.

Read on