Get the App
SLTechnology News&Howtos  ›  Servers  › 

How does Aliyun Centos7.X open ports to the outside world

Shulou Source: shulou.com Published: 2022-06-02 09:39:38 10月04日 Update

This article mainly shows you how to open the port to the outside world in Aliyun Centos7.X. The content is simple and easy to understand. I hope you can learn. After learning, there will be some gains. Let's take a look at it.

Bottom line: if you buy CVMs from major manufacturers, go to the security group to configure the ports you need to use.

Because the blogger is using Aliyun, so here is just how to open the port, according to the following three pictures to operate on it

At this time, some students said, not through the platform, I want to exercise my Linux ability. Of course. Next, configure firewall rules directly on Linux to open ports (above Centos7, Centos6 and 7 use different firewall rules, Centos6 is not introduced here)

Master the systemctl+firewall command first.

Description commands View firewall status systemctl status firewalld.service start firewallsystemctl start firewalld stop firewallsystemctl stop firewalld boot firewallsystemctl enable firewalld boot prevent firewallsystemctl disable firewalld from additional learning systemctl command ^ _ ^ check whether the service is powered on systemctl is-enabled firewalld.service View the list of started services systemctl list-unit-files | grep enabled view the list of services that failed to start systemctl-- failed

Secondly, master the firewall-cmd command

Describe commands to view all firewall information firewall-cmd-- list-all view open ports firewall-cmd-- list-ports update firewall rules firewall-cmd-- reload open ports firewall-cmd-- zone=public-- add-port=3000/tcp-- permanent close ports firewall-cmd-- zone=public-- remove-port=3000/tcp-- permanent

Final execution steps:

First check whether firewall is enabled: systemctl status firewalld.service open port (rules need to be updated to take effect after opening): firewall-cmd-- zone=public-- add-port=3000/tcp-- permanent update firewall rules: firewall-cmd-- reload

The above is about how Aliyun Centos7.X can open ports to the outside world. If you have learned knowledge or skills, you can share it for more people to see.

Tags: Port Open Command Rule Ali Firewall Learning Service Fire Prevention Update Open external content configuration No Security next word message classmate Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Shulou Information MySQL Apple Shulou Tech Info