CentOS 7 Open Firewall port

Source: Internet
Author: User

1. Turn on the firewall

Systemctl Start Firewalld

2. Add

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

3. Re-loading

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

4. Delete

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

Command meaning:

--zone #作用域

--add-port=80/tcp #添加端口 in the format: Port/Communication protocol

--permanent #永久生效, fail after reboot without this parameter

3.firewall-cmd--reload


Attach the basic use of the firewall

1, the basic use of Firewalld start: Systemctl start firewalld off: Systemctl stop firewalld View status: Systemctl status firewalld boot disabled: SYSTEMCT L Disable FIREWALLD Power on: Systemctl enable FIREWALLD 2.systemctl is the main tool in the CentOS7 Service Management tool, which integrates the functionality of the previous service and Chkconfig.

Start a service: Systemctl start Firewalld.service
Close 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: Systemctl enable Firewalld.service
Disable a service at boot: systemctl disable Firewalld.service
Check if the service is booting: Systemctl is-enabled firewalld.service
To view a list of services that have been started: Systemctl List-unit-files|grep enabled
To view a list of services that failed to start: Systemctl--failed

3. Configure Firewalld-cmd

View 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 specified interface zone: Firewall-cmd-- Get-zone-of-interface=eth0 reject All packages: Firewall-cmd--panic-on de-deny status: Firewall-cmd--panic-off View reject: Firewall-cmd-- Query-panic 4. See which ports are open Firewall-cmd--zone=public--list-ports

CentOS 7 Open Firewall port

Related Article

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.