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