Network troubleshooting tips

An idea of ​​​​this article:
1. Necessary conditions
for network troubleshooting 2. Basic ideas
for network troubleshooting 3. Detailed steps for network troubleshooting
4. Final important instructions

1. Necessary conditions for network troubleshooting
Why are there necessary conditions? Because the network troubleshooting mentioned here is not just on the use of a small command, but a systematic method. Without these conditions, I really can't guarantee that you can understand the following. , and can be applied to practice, so let's take a look at these basic conditions first.

1. Familiar with the OSI seven-layer model and the TCP/IP protocol stack
This should be the most basic knowledge to know for network troubleshooting.
Whether it is the OSI seven-layer model or the DoD model, it is a process used to describe network communication, so that we can have a general process of sending and receiving network data. The OSI seven-layer model corresponds to the protocol of the OSI seven-layer model, and the DoD model corresponds to the protocol of the DoD model, that is, the TCP/IP protocol stack.
The protocols in the TCP/IP protocol stack are very important, such as DNS, TCP, UDP, IP, ICMP, and ARP. These basic ones should be known. It's so detailed, but at least we have to know the basic functions of these protocols. I don't think these can be explained clearly by one or two people, or that sentence, please Baidu yourself.

2. Understand the basic equipment of network communication and its corresponding OSI level
, such as switches, three-layer switches, routers, firewalls and other basic network equipment should have some understanding, especially their corresponding OSI levels and functions, such as ordinary two-layer The switch corresponds to the data link layer in the OSI seven-layer model, it can isolate the collision domain, and at the same time, it may isolate the broadcast domain through the virtual local area network technology (VLAN). Another example is a router, which corresponds to the network layer and can provide routing addressing functions and so on.
Maybe you don't need to know so much, but I think you should know about a general process.

3. To understand the basic structure of the small and medium-sized enterprise network is
actually to know how the network devices mentioned above are generally connected. If you troubleshoot in the actual environment, you should know a basic structure of the current network.
Here is a brief mention. Generally, the basic architecture of small and medium-sized enterprise networks is as follows: access layer--aggregation layer--core layer--network egress.
Network troubleshooting tips
If the network environment is relatively large, there will be both the aggregation layer and the core layer. As here, there is no aggregation layer, but the idea is the same. The troubleshooting described below is actually explained for the user PC. In fact, the network troubleshooting in the data center is similar. No matter how complicated the network environment is, in fact, it is similar to this in simplification.
4. Know the commonly used network troubleshooting commands
If the user is using the Windows operating system, then the following commands are very important:
ipconfig View the computer's IP address, subnet mask and gateway
ipconfig/all View the computer's IP address, Subnet mask, gateway and DNS address
ping Test the network connectivity between hosts
nslookup request the IP address corresponding to the domain name, and use this to test whether the DNS address can be
traced by tracert -d, and do not do reverse resolution
arp -a view Whether the computer has obtained the MAC address of the gateway
If the Linux operating system is used, there are corresponding commands. In fact, in the final analysis, you need to be familiar with the equipment you are using. Of course, in the process of actual network troubleshooting, if it is just to test whether the network communication is normal, you can replace the equipment you are familiar with.
5. Clearly know an important principle of
network troubleshooting Network troubleshooting is not about judging where the network goes wrong, therefore, you must know the direction of the data.
So this important principle is: pay attention to the direction of the data.
The idea of ​​network troubleshooting mentioned below is actually to narrow down the network failure points step by step by tracking the trend of data. Therefore, it is very, very important to keep this in mind! This is why the above needs to let you understand the basic structure of small and medium business networks.

2. The basic idea of ​​network troubleshooting The basic
idea is as follows, which should be similar to what most people on the Internet wrote.
(1) Check whether there is a problem with the physical link
(2) Check whether there is a problem with the IP address, routing, and DNS settings of the machine
(3) Test the smoothness of the gateway or router. First test the gateway and then test the router, test level by level
(4) Test the smoothness of ping the public network IP (usually remember a few external IPs)
(5) Test the smoothness of DNS, you can directly ping
the following website address The third part will give a detailed description of the above basic ideas.

3. Detailed steps for network troubleshooting
(1) Check whether there is any problem with the physical link
This step is the first step that I personally think must be done when doing network troubleshooting! I often hear from friends that the leader of ××× can’t access the Internet, and he needs to go to the past to troubleshoot the problem. This is really a tragedy, and I wasted a lot of time not to mention that such network troubleshooting ideas are inherently wrong.
Because maybe not everyone can go to the computer room to check the wiring of the switch, so in this step, the focus of our investigation should be on which line is connected to the switch.
In this step, the following points need to be paid attention to:

1. Confirm whether there is any problem with the network card of ××× itself
2. Confirm whether there is any problem with the connected network cable
3. The switch connected to the machine (if you can go to the computer room to check)

     如果上面这几点排查都没有问题了,那么就是该网络环境中的其他设备问题了。这一范围的排查相对比较简单,因为只涉及到物理链路的连接问题。
对于这种测试,可以考虑使用测线器,但个人的建议是,拿一台配置正确的笔记本来做测试也未尝不可。**

(2) Check whether there is any problem with the settings of the local IP address, routing, and DNS.

上面第一步,物理链路的排查没有问题了,也就是说,×××接上网线之后,×××有有反应了,可以识别,但是网络还是不通,来到这一步,就应该先把注意的范围放在×××的设置上面了。
这上步,我们关注的重点是:**

1. If you use the DHCP automatic acquisition method for IP address settings
, then you only need to check whether the settings of your own machine have enabled the settings of automatic IP acquisition and whether you have enabled related services;
if you use static IP, Then you must pay attention to whether the IP address is incorrectly filled in (generally given by network administrators), and whether there is a problem with the subnet mask of the IP address (this is very important, for static IP, many people set the wrong here, the suggestion is, It is best to learn the knowledge of IP address and VLSM).
Generally, you can use the following command to view:
C:\Users\XpLeaf>ipconfig

Windows IP configuration

Ethernet Adapter Local Area Connection:

Connection-specific DNS suffix. . . . . . . :
link-local IPv6 address. . . . . . . : fe80::4cf8:896f
IPv4 address. . . . . . . . . . . .
Subnet mask. . . . . . . . . . . . : 255.255.255.0
Default gateway. . . . . . . . . . . . .
. .

2. Routing settings
For servers and PCs, it generally refers to the default gateway settings; for routers or Layer 3 switches, it is the problem of static routing or dynamic routing settings.

3. The DNS setting
is mainly to ensure whether the set DNS server address provides domain name resolution services or whether there is a failure. As for how to judge, the method will be given later. The concern here is that you have to set a correct DNS server. The address may be obtained automatically. On Windows you can view it with the following command:

C:\Users\XpLeaf>ipconfig/all

Windows IP configuration

Ethernet Adapter Local Area Connection:

Physical Address. . . . . . . . . . . . : 00-00-29-5E-22-F7
DHCP enabled. . . . . . . . . . : No
Autoconfiguration enabled. . . . . . . . . . : is the
link-local IPv6 address. . . . . . . . : fd60::4ed8:896f:7d55:1432%11 (preferred)
IPv4 address. . . . . . . . . . . : 192.168.2.1 (preferred)
subnet mask. . . . . . . . . . . : 255.255.255.0
Default gateway. . . . . . . . . . . .

DNS server . . . . . . . . . . : 202.116.145.145
202.96.128.86

(3) Test the smoothness of the gateway or router. Test the gateway first and then the router, and test it level by level

(4) Test the smoothness of ping the public network ip (usually remember several external IPs)

来到这一步的时候,就说明前面三步是没有问题的,也就是说,本地局域网络的通信是正常的,这时要做的就是判断本地局域网络与外网(公网)之间的通信有没有问题了:
      这里采取的是直接ping公网地址的方法,是为了排除DNS的影响(万一你的DNS设置又有问题),至于要ping什么样的公网地址,个人建议是,可以ping一些没有禁止ping的公共DNS服务器地址,比如114.114.114.114和8.8.8.8的:

C:\Users\XpLeaf>ping 114.114.114.114

Pinging 114.114.114.114 with 32 bytes of data:
reply from 114.114.114.114: bytes=32 time=52ms TTL=61
reply from 114.114.114.114: bytes=32 time=127ms TTL=87
from 114.114.114.114 Reply from: bytes=32 time=96ms TTL=82
Reply from 114.114.114.114: bytes=32 time=100ms TTL=74

Ping stats for 114.114.114.114:
Packets: Sent = 4, Received = 4, Lost = 0 (0% lost),
Estimated time in milliseconds for round trip:
Min = 52ms, Max = 127ms , average = 93ms
After this, you can basically determine that the network is no problem. Of course, there is no mention of placing a firewall at the exit. In fact, the idea is the same, but what you need to consider is whether your access data is filtered by the firewall, is it filtered when the data goes out, or is it Is the data filtered when it comes back? Since it also involves the settings of the firewall, I won't mention it here, but I still need to pay attention to this point.
Of course, it is not ruled out that it is the problem of the ISP, so call and ask. For example, you can directly ping the website address to see if the IP address is echoed. As for whether the connection is not working, it is another matter. As long as the IP address can be echoed, then there is no problem with DNS. However, I still want to talk about the nslookup command here. It is a very useful command. I usually use it when I debug the network: C:\Users\XpLeaf>nslookup Default server: server1.gdut-dns.edu.cn Address: 202.116.145.145
(5)测试DNS的通畅情况,可以直接ping网站地址



www.baidu.com
Server: server1.gdut-dns.edu.cn
Address: 202.116.145.145

Non-authoritative answer:
Name: www.a.shifen.com
Addresses: 180.97.33.107
180.97.33.108 Aliases
: www.baidu.com

Fourth, the last important note
Basically, a relatively complete network troubleshooting process should be as mentioned above, but it is basic, because the above explanations almost assume that you do not have permission to enter the computer room to view the network the condition of the equipment.
In fact, you don't need to copy all the above steps at all. In the actual troubleshooting process, you may only use a small part of them. After all, if it goes like this every time, no one is I won't go crazy, because some very simple problems have to be tossed like this, which is a waste of time! However, the above method only proposes an idea of ​​network troubleshooting. I hope that according to this idea, we can judge where the network problem occurs. As for how to solve it, it really involves too many experience problems ( In fact, if you encounter problems, you can Baidu),
in fact, I personally think that the most important thing is still not the technology itself, but an idea in the process of network troubleshooting. The idea determines the way out, which can make oneself in the process of network troubleshooting. It is very important to keep a clear mind at all times!
Author: xpleaf Source: http://blog.51cto.com/xpleaf/1689438

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325163296&siteId=291194637