一、 Centos7和Centos6 防火墙的区别:
使用的工具不一样了。Centos6 使用的是iptables,Centos7 使用的是filewall
iptables 用于过滤数据包,属于网络层防火墙。
firewall 能够允许哪些服务可用,那些端口可用...属于更高一层的防火墙。
二、常用命令:
vim /usr/lib/firewalld/services/ssh.xml
vim /usr/lib/firewalld/services/http.xml
systemctl enable firewalld.service
systemctl restart firewalld.service
firewall-cmd --state 查看状态
firewall-cmd --list-all 查看过滤的列表信息
firewall-cmd --zone=public --permanent --add-port=8502/tcp 添加一个协议为tcp的8502端口过滤
vim /etc/firewalld/zones/public.xml
systemctl restart firewalld.service
三、firewall 配置
配置介绍:
The configuration for firewalld is stored in various XML files
in /usr/lib/firewalld and /etc/firewalld
This allows a great deal of flexibility as the files can be edited, written to, backed up, used as templates f