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 does CentOS7 use firewalld to turn on or off firewalls and ports

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces CentOS7 how to use firewalld to open or close firewalls and ports related knowledge, the content is detailed and easy to understand, the operation is simple and fast, with a certain reference value, I believe that after reading this CentOS7 how to use firewalld to open or close firewalls and ports article will have a harvest, let's take a look.

1. Basic use of firewalld

Start:

Systemctl start firewalld

View status:

Systemctl status firewalld

Stop:

Systemctl disable firewalld

Disable:

Systemctl stop firewalld

2.systemctl is the main tool in centos7's service management tools, which combines the functions of service and chkconfig.

Start a service:

Systemctl start firewalld.service

Shut down a service:

Systemctl stop firewalld.service

Restart a service:

Systemctl restart firewalld.service

Displays the status of a service:

Systemctl status firewalld.service

Enable a service at boot time:

Systemctl enable firewalld.service

Disable a service at boot time:

Systemctl disable firewalld.service

Check to see if the service is powered on:

Systemctl is-enabled firewalld.service

View a list of services that have been started:

Systemctl list-unit-files | grep enabled

View the list of services that failed to start:

Systemctl-failed

3. Configure firewalld-cmd

View the version:

Firewall-cmd-version

View help:

Firewall-cmd-help

Display status:

Firewall-cmd-state

View all open ports:

Firewall-cmd-zone=public-list-ports

Update firewall rules:

Firewall-cmd-reload

View area information:

Firewall-cmd-get-active-zones

View the area to which the specified interface belongs:

Firewall-cmd-get-zone-of-interface=eth0

Reject all packages:

Firewall-cmd-panic-on

Cancel the rejection status:

Firewall-cmd-panic-off

Check to see if you reject:

Firewall-cmd-query-panic

So how do you open a port?

Add

Firewall-cmd-zone=public-add-port=80/tcp-permanent

(--permanent is in effect forever. It will expire after restart without this parameter.)

Reload

Firewall-cmd-reload

View

Firewall-cmd-zone= public-query-port=80/tcp

Delete

This is the end of the article firewall-cmd-zone= public-remove-port=80/tcp-permanent on "how CentOS7 uses firewalld to open or close firewalls and ports". Thank you for reading! I believe that everyone has a certain understanding of "how CentOS7 uses firewalld to open or close firewalls and ports". If you want to learn more, you are welcome to follow the industry information channel.

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

Development

Wechat

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

12
Report