Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to turn on Firewall and specific Port in liunx

2025-01-17 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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report