In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-12-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "liunx how to open firewall and specific port". 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 "liunx how to open firewall and specific port".
Enable firewall service
In the past, for convenience, the firewalls were turned off, because now the projects are more important and afraid of being attacked, so for the sake of security, we now need to turn on the firewall. Next, we will introduce the steps.
1, first check the firewall status:
Firewall-cmd-state
2. Turn on the firewall
Start firewall:
Systemctl start firewalld.service
Set self-boot:
Systemctl enable firewalld.service
3. Restart the firewall:
Systemctl restart firewalld.service
4, check whether the firewall status is turned on:
Firewall-cmd-state
As shown in the picture, it has been opened.
5. Check whether the firewall is set to boot successfully:
Systemctl is-enabled firewalld.service;echo $?
Open a specific port
Here, take opening port 80 as an example
Command:
Open port command: firewall-cmd-- zone=public-- add-port=80/tcp-- permanent
Restart the firewall: systemctl restart firewalld.service
Meaning of the command:
-- zone # scope
-- add-port=80/tcp # add port in the format: Port / communication protocol
-- permanent # is in effect forever. Without this parameter, it will expire after restart.
As shown in the figure, you can see that the port has been opened successfully:
If you are not assured, you can use the command:
Netstat-ntlp
Or: firewall-cmd-- list-ports
Thank you for reading, the above is the content of "how to open the firewall and specific ports of liunx". After the study of this article, I believe you have a deeper understanding of how to open the firewall and specific ports of liunx, 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!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.