Status firewalld systemctl Service firewalld Start View firewall rules Firewall -cmd --list- All # query port is open Firewall -cmd --query-Port = 8080 / tcp # 80 open ports Firewall -cmd --permanent --add-Port = 80 / TCP # removal port firewall -cmd --permanent --remove-port = 8080 / TCP # restart firewall (firewall modified configured to restart) firewall -cmd - reload restart systemctl the restart firewalld.service firewall -cmd - --zone = Permanent public --add =-Service- HTTP Firewall -cmd --direct -add-filter rule IPv4 TCP --dport the INPUT 0 -p 8081 -ACCEPT J ################################################ ### 1 , close the firewall: systemctl firewalld.service sTOP # stop firewall systemctl disable firewall boot prohibited firewalld.service # 2 , installed iptables firewall yum install iptables - Services to install # 3 edit the firewall configuration file. vi / etc / sysconfig / iptables # edit the firewall configuration file 4 . enable service systemctl restart iptables.service # final restart firewall configuration to take effect systemctl enable iptables.service # set the firewall boot # set the specified port allows iptables the -I --dport the INPUT -p tcp 3036 - ACCEPT J # save & restart the service service iptables save iptables restart Service # check the service status Status iptables Service # turn off the firewall service service iptables stop