CMD window command line commonly used by network workers

Good evening, my network worker friend.

As a network engineer, it is often easy to be blamed at work.

Whenever there is a problem with the business system or various other problems, people will always think it is a network problem, and the initial suspicion points to the network worker.

However, the end result is often a problem with your own server.

Today I will tell you a few ways to check the network status that are often used in daily work.

Some detection methods are too basic, and the official account has said it many times.

For example, ping and tracert, etc., friends who need it can directly search it in the search box.

Today I will tell you about those less commonly used CMD commands.

Today's article reading benefits: "CMD Instructions Encyclopedia"

The Command Prompt may seem like an esoteric tool, but it actually has a lot of useful tricks. Today, I will integrate the commonly used CMD commands for you, code first and then use.

Private message me , send the password "CMD", and get limited resources.

01 Detect whether the TCP port is normal

Usually use the telnet IP address port number to detect under the cmd command. For example, check whether port 80 of 192.168.1.1 is open.

If the port is enabled, a black screen is displayed, indicating that the port is normal.

If the port is unavailable, prompts such as connection timeout or connection rejection will be displayed.

02 Web cannot be accessed, check whether the DNS is resolved correctly

When a certain URL cannot be accessed, we need to check whether the DNS is resolved correctly.

For example, to detect http://www.baidu.com , we need to check whether the corresponding IP address is correctly resolved, and check whether the network is smooth through the ping tool.

03 Check whether the computer gateway generates a route

Sometimes the configured gateway address does not generate a default route, making the gateway unreachable.

We can use the "route print" command to see if there is valid routing information.

04 Static routing configuration when dual network cards exist

If there are dual network cards, such as WiFi and wired network cards, and you need to access the address 192.168.100.1 through WiFi, but always go to the wired gateway and the communication is not smooth, then we need to add a route under the cmd command line.

Solve this problem by adding a temporary route to the 192.168.1.1 gateway.

It should be noted that the added route is a temporary route by default, and it will become invalid after restarting. If you need to use it permanently, you need to add the "-p" parameter to turn it into a permanent route.

We can confirm whether the addition was successful by looking at the routing table.

05 Release the address obtained by dhcp, and let the computer obtain a new address again

If the address obtained by DHCP is not the address we want, or there is an address conflict, we can enter "ipconfig /release" in cmd to release the currently acquired address, and then obtain the address again through "ipconfig /renew".

At this time, there is no address obtained under the wireless network card. Obtain a new address through "ipconfig /renew".

06 Check the arp information of the device

By looking at the ARP information, we can get the MAC address (physical address) of the gateway.

If it does not match the gateway address on the network device, there may be a bogus DHCP server.

We can perform related location analysis through the MAC address.

As network engineers, mastering these methods can help us better troubleshoot and solve network problems and ensure the smooth progress of business.

Finishing: Lao Yang 丨 10-year senior network engineer, more network workers to improve dry goods, please pay attention to the official account: Network Engineer Club

Guess you like

Origin blog.csdn.net/SPOTO2021/article/details/132462112