The default firewall of CentOS7 is firewall

Run sudo systemctl stop firewalld.service to disable the firewall

2, disable the firewall startup: sudo systemctl disable firewalld.service\

Systemctl start firewalld Systemctl enable firewalld # start systemctl stop firewalld # stop systemctl disable firewalld # Cancel firewalld startup firewall-cmd --state systemctl unmask firewalld Failed to start firewald. service: Unit is masked. The systemctl unmask firewalld service is locked. The systemctl unmask firewalld service is locked. To lock the service next time, run systemctl mask firewalldCopy the code

\

\

If you want to use iptables

3. Install the Iptables firewall

Run the following command to install the iptables firewall:

sudo yum install iptables\

sudo yum install iptables-services

4. Configure the iptables firewall and open port \

5. Set iptables firewall startup:

Service iptables restart

Chkconfig iptables on or systemctl enable iptables