CentOS的firewalld和iptables使用

CentOS在7.x和6.x分别使用firewalld和iptables作为防火墙工具,习惯上iptables之后firewalld各种不适应。 下面总结在各个版本CentOS下firewalld和iptables使用。 这里配置打开HTTP/HTTPs端口功能,分别对应80和443端口 CentOS7.x 使用firewalld #====================CENTOS 7.x================== systemctl enable firewalld systemctl start firewalld # HTTP firewall-cmd –permanent –zone=public –add-port=80/tcp # HTTPS firewall-cmd –permanent –zone=public –add-port=443/tcp firewall-cmd —reload