Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to Test Port Connectivity in Linux system

Shulou Source: shulou.com Published: 2022-06-01 16:20:55 10月01日 Update

This article mainly explains "how to test port connectivity under the Linux system". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to test port connectivity under the Linux system".

In the work, there are many times to test whether the server port can be connected or not. The following editor will share with you how to test the connectivity of the port in the Linux environment, testing the TCP port and the UDP port respectively. I hope it can help you. Thank you.

1. This requires that the nc command is supported in the Linux server. If it is not already installed, it will be shown as follows.

2. We can use the yum command to install it directly. Mine is a Centos 6.5 system.

3. If you can't use it, simply typing the nc command will show how to use it.

4. If you need to test whether the port of a server can be accessed normally, for example, I will test whether port 80 of the IP is enabled or not. You can use the command: nc-z-w 1 180.97.33.107 80.

5. You can see that TCP is used for testing by default. If you want to test whether the UDP port is open, you can add-u to use it together. For example, let me test the UDP 53 port of 202.96.128.86 IP: nc-u-z-w 1 202.96.128.86 53.

6. It can be seen above that the successful one will display the relevant information, but if the port is closed or blocked by the firewall, the relevant information will not be returned.

Note: this article is based on their own facts to test port connectivity, powerful can use its test, but the specific IP and port to fill in the test according to their own actual oh.

Thank you for reading, the above is the content of "how to test port connectivity under Linux system". After the study of this article, I believe you have a deeper understanding of how to test port connectivity under Linux system, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Tests ports systems commands situations servers learning services information content openness power success events usage facts reality that is ideas articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi vpn Shulou Information MariaDB Apple