Several steps and tools for troubleshooting the network

Several steps and tools for troubleshooting the network

Let me ask a question first. If one day you suddenly find that the service between the IDC computer room and the public cloud is inaccessible (excluding problems with the service itself, it may be that the network is not connected, or the network becomes very slow and resources cannot be downloaded in time, resulting in the inaccessibility of the service).

How to analyze this problem? After the following 5 steps, the problem can be basically located:

  • Confirm whether the network between the IDC room and the public cloud is connected
  • Confirm the network speed between the IDC room and the public cloud
  • Confirm whether the bandwidth of the machine in the IDC room is limited
  • Confirm whether the bandwidth of the public cloud machine is limited
  • Confirm whether the VPN channel between the IDC room and the public cloud is normal

1. Confirm whether the network between the IDC room and the public cloud is connected

Use the ping command. If it works, it means the network is fine.

2. Confirm the network speed between the IDC room and the public cloud

The network speed can be confirmed by the following tools: wget, iftop, nload, vnstat.

1.wget

Use wget to determine whether the network speed is normal:

  • On the cloud, use wget to access the ID computer room's services and check the network speed.
  • In the IDC computer room, use wget to access the cloud service and check the network speed.

When running wget, compare the speed difference between domain name access and IP address access. If the speed difference between domain name access and IP address access is large, it can be judged that there is a problem with domain name resolution. If the difference is not big, but both are relatively slow, then continue to judge.

 wget http://nexus.dev.mangod.top/repository/maven-releases/top/mangod/xxx-cloud-server/3.0.2-RELEASE/xxx-cloud-server-3.0.2-RELEASE.jar wget http://10.20.0.10:8081/repository/maven-releases/top/mangod/xxx-cloud-server/3.0.2-RELEASE/xxx-cloud-server-3.0.2-RELEASE.jar wget http://sql.dev.mangod.top/js/oneUtils.20efc452.dll.js wget http://10.10.5.53:9000/js/oneUtils.20efc452.dll.js

2.iftop

iftop is a text-based real-time traffic monitoring tool that can display the real-time traffic of the network interface, including upload and download speeds. Install and use iftop:

 yum install iftop # CentOS/RHEL iftop -i <interface> # 例如:sudo iftop -i eth0

3.nload

nload is another text-based real-time network traffic monitoring tool that can visually display network traffic. To install and use nload:

 yum install nload # CentOS/RHEL nload -u K # 显示上传速度,-u 选项表示上传速度,-d 表示下载速度,K 表示以KB/s 为单位显示

4.vnstat

vnstat is a command-line based network traffic monitoring tool that can provide detailed statistics about network interface traffic, including overall traffic and daily/monthly traffic usage. To install and use vnstat:

 yum install vnstat # CentOS/RHEL # 例如:vnstat -l -i eth0,这将显示所选网络接口的实时上传和下载流量。 vnstat -l -i <interface>

5. Installation tool issues

If you encounter the problem of no available packages when installing packages on a CentOS system, try the following two methods:

(1) Update software sources: First try to update the software sources to ensure that the system can find the latest package information. Run the following command:

 yum update

This will update the versions of installed packages on your system and update the list of available packages.

(2) Enable additional repositories: Some packages may not be in the default CentOS repository. You can consider enabling other additional software sources, such as the EPEL (Extra Packages for Enterprise Linux) repository. Install the EPEL repository:

 yum install epel-release

3. Confirm whether the machine bandwidth is limited

After locating the network speed problem, confirm whether it is due to the limited bandwidth of the machine. Use the Iperf tool to confirm whether the IDC machine room machine and the public cloud machine have bandwidth restrictions.

Network bandwidth tool Iperf

Iperf is a tool for testing network bandwidth. It measures the speed of data transfer between networks. It can be executed between two computers, one as a server and the other as a client.

Here are the steps to perform a basic network bandwidth test using iperf:

(1) Install Iperf: In CentOS, use the following command to install iperf on both the Server and Client:

 yum install iperf

(2) Run the Iperf server: On the server side, run the following command to start the Iperf server:

 iperf -s # 选择一台机器做服务端,默认时间1s,默认端口5201 # 设置监控时间10s,端口为5201,防火墙端口要放行iperf3 -s -i 10 -p 5201

This will start a server listening on port 5001 by default.

(3) Run the Iperf client: On the client side, run the following command to connect to the server side and test the bandwidth:

 iperf -c <server_IP> # 选择另外一台做为客户端# 指定-c测速服务器IPx.xxx,-p指定端口为5201,-t测速时间5s,-P指定发送连接数10,-R表示下载测速iperf3 -c xxxx -p 5201 -t 5 -P 10 -R

4. Confirm whether the VPN channel between the IDC computer room and the public cloud is normal

After confirming the bandwidth, if the problem is still not located, continue to determine whether the VPN channel is normal.

1. Use traceroute to view

First, use traceroute to confirm whether the routing process on both sides is normal. The traceroute command can display the path of the data packet from the current machine to the target IP, and display the IP address and delay of each router (hop) passed. Enter the following command in the terminal:

 traceroute <目标IP地址>

The output of traceroute may vary depending on the network topology and router configuration. Sometimes certain routers may be configured not to respond to traceroute requests, so asterisks (*) or timeout information may be displayed.

2. Use of MTR tools

You can also use a more powerful MTR tool. MTR (My Traceroute) is a network diagnostic tool that combines the functions of traceroute and ping to detect the delay, packet loss rate, and path information of each router in the network path. It can provide more detailed network routing information and the network status of the entire path.

MTR can be used for network troubleshooting, detecting network bottlenecks, evaluating network connection quality, etc. The comprehensive information it provides can help you better understand the paths and conditions of data transmission in the network, thereby solving network problems more effectively.

(1) Install MTR

Install using the yum package manager:

 sudo yum install mtr

(2) Use MTR

 mtr <目标IP地址>

At this point, the problem can be basically located.

If the location still cannot be found, check whether the VPN channel between the IDC room and the public cloud is configured correctly. It is possible that the IP address of the IDC room given by the operator has been changed or the operator has done something to the IP. If this is the case, you can consider changing the egress IP.

3. Use CIP.CC tool to obtain the export IP

Execute curl cip.cc on the command line to obtain the export IP address and display it on the command line terminal.

<<:  The relationship and difference between URL, URI and URN

>>:  5G and the Internet of Things: Connecting Millions of Devices

Recommend

Bluetooth 5 and its role in the Internet of Things

What is Bluetooth 5? If you own a car or a smartp...

Explore VLAN aggregation: How to optimize your network performance

VLAN technology is widely used in campus networks...

After three whole years, what changes has 5G brought us?

On June 6, 2019, my country officially issued 5G ...

How energy-efficient networks support sustainable development

As extreme weather conditions wreak havoc, compan...

On the eve of 5G, mobile phone companies should not panic

Not long ago, a video about 5G experience by &quo...

Thoroughly understand Session and Token

Hello everyone, I am amazing. When building a use...

Are wireless networks more energy efficient than wired LANs?

Sustainability and reducing energy consumption ar...

TCP and UDP, 123 things you need to know (TCP)

Preface As a network operation and maintenance pe...

What you need to know about HTTP protocol

Today we will analyze the HTTP protocol, which is...