Centos7 use firewalld to open and close the firewall and Port

Source: Internet
Author: User
Centos7 use firewalld to enable and disable firewall and Port 1. Basic use of firewalld start: systemctl start firewalld Disable: systemctl stop firewalld view status: systemctl status firewalld enable: systemctl disable firewalld enable: systemctl enable firewalld 2. systemctl is the main tool in centos7 service management tools. It integrates the functions of previous services and chkconfig.

Start a service: systemctl start firewalld. Service
Disable 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 startup: systemctl enable firewalld. Service
Disable a service at startup: systemctl disable firewalld. Service
Check whether the service is started: systemctl is-enabled firewalld. Service
View the list of started services: systemctl list-unit-files | grep Enabled
View the list of failed services: systemctl -- failed

3. Configure firewalld-cmd

View version: firewall-cmd -- version view help: firewall-cmd -- help display status: firewall-cmd -- state view all opened ports: firewall-cmd -- zone = public -- list-ports update firewall rules: firewall-cmd -- reload view region information: firewall-cmd -- Get-active-zones to view the region of the specified interface: firewall-cmd -- Get-zone-of-interface = eth0 reject all packets: firewall-cmd -- panic-on cancel rejection status: firewall-cmd -- panic-off check whether the request is rejected: firewall-cmd -- Query-panic how to enable a port and add firewall-cmd -- zone = public -- add-Port = 80/tcp -- Permanent (-- Permanent takes effect permanently, this parameter does not expire after restart) reload firewall-cmd -- reload view firewall-cmd -- zone = public -- Query-Port = 80/tcp delete firewall-cmd -- zone = public -- remove-Port = 80/tcp -- permanent

Centos7 use firewalld to open and close the firewall and Port

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.