原因:因為centos7默認的防火牆是firewalld防火牆,不是使用iptables,因此需要先關閉firewalld服務,或者干脆使用默認的firewalld防火牆。
操作步驟:
關閉防火牆
1.systemctl stop firewalld
2.systemctl mask firewalld
在使用iptables服務
#開放443端口(HTTPS)
3.iptables -A INPUT -p tcp --dport 443 -j ACCEPT
#保存上述規則
4.service iptables save
#開啟服務
5.systemctl restart iptables.service