Centos 7 Firewall Firewalld Open 80 port

Source: Internet
Author: User

Turn on port 80

1.Firewall-cmd --zone=public --add-port=/tcp --permanent Success appears to indicate added success

Command meaning:

--zone #作用域

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

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

Restarting the firewall

1.systemctl Restart Firewalld.service1. Run, stop, disable FIREWALLD

Start: # systemctl start Firewalld

View Status: # Systemctl status Firewalld or Firewall-cmd--state

Stop: # systemctl Disable FIREWALLD

Disable: # Systemctl stop Firewalld

2, Configuration Firewalld

View version: $ firewall-cmd--version

View Help: $ firewall-cmd--help

To view the settings:

Display Status: $ firewall-cmd--state

View area information: $ firewall-cmd--get-active-zones

View the specified interface zone: $ firewall-cmd--get-zone-of-interface=eth0

Reject All Packages: # Firewall-cmd--panic-on

Cancel deny status: # Firewall-cmd--panic-off

To see whether to reject: $ firewall-cmd--query-panic

Update firewall rules: # firewall-cmd--reload

# Firewall-cmd--complete-reload

The difference between the two is that the first one without disconnecting, is one of the FIREWALLD features dynamically add rules, the second needs to be disconnected, similar to restart the service

Add an interface to a zone, and the default interface is in public

# Firewall-cmd--zone=public--add-interface=eth0

Permanently effective plus--permanent then reload firewall

Set the default interface area

# Firewall-cmd--set-default-zone=public

Immediate effect without restarting

Open port (looks like this is most commonly used)

To view all open ports:

# Firewall-cmd--ZONE=DMZ--list-ports

Add a port to the zone:

# Firewall-cmd--ZONE=DMZ--add-port=8080/tcp

To permanently effect the method above

Open a service, similar to the port visualization, service needs to be added in the configuration file, the/ETC/FIREWALLD directory has a Services folder, this is not detailed, the details of the reference document

# Firewall-cmd--zone=work--ADD-SERVICE=SMTP

Removal service

# Firewall-cmd--zone=work--REMOVE-SERVICE=SMTP

Centos 7 Firewall Firewalld Open 80 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.