CentOS7 Firewall Firewall-cmd

Source: Internet
Author: User

After minimizing the installation of CentOS7, many ports are not opened by default and need to be opened by Firewall-cmd.

Check firewall status

# firewall-cmd--staterunning

Shutting down the firewall

# systemctl Stop firewalld# Firewall-cmd--Statenot running

View open Ports List

# Firewall-cmd--list-all
Public (default, active)
Interfaces:docker0 ENP0S3
Sources
Services:dhcpv6-client SSH
Ports
Masquerade:no
Forward-ports:
Icmp-blocks:
Rich rules:

Temporarily open HTTP Service

# Firewall-cmd--add-service=http

Permanently open HTTP Service

# Firewall-cmd--add-service=http--permanent

To permanently shut down the HTTP service

# Firewall-cmd--remove-service=http--permanent

Let the setting take effect

# systemctl Restart Firewalld

Get the service name for FIREWALLD

# firewall-cmd--get-serviceamandaftpssh telnet tftp tftp-client transmission-client Vnc-server Wbem-https

Query the enabled state of a service

# firewall-cmd--query-service Httpyes

Open the specified port

# firewall-cmd--add-port=/tcp# firewall-cmd--list-allpublic (default)  interfaces:  sources:  services:dhcpv6ftpssh  /TCP  Masquerade:no  forward-ports:  ICMP-blocks:  rich rules:

CentOS7 Firewall Firewall-cmd

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.