firewalld默认拒绝全部服务、支持动态修改
iptables默认容许全部服务、须要所有刷新载入
两者维护规则经过netfilter(数据包过滤机制)实现功能
selinux较为复杂,小菜尚未过应用linux
firewalld:
systemctl start firewalld
systemctl status firewalld
systemctl restart firewalld
systemctl stop firewalld
systemctl enable firewalld
systemctl disable firewalld
firewall-cmd --reload 动态更新vim
iptables:
service iptables start
service iptables status
service iptables restart
service iptables stop
chkconfig iptables on
chkconfig iptables off网络
selinux:
setenforce 0 ( permissive宽容模式,违反selinux规则的记录日志,不阻止)
setenforce 1 ( enforcing强制模式,违反selinux规则的记录日志,并终止)
vim /etc/selinux/config 将SELINUX修改成disabled 执行第三种工做模式关闭并发
防火墙浅析工具
netfilter(数据包过滤机制):其由五表五链组成
五表:
filter :对包进行过滤,最经常使用的表有INPUT丶FORWARD丶OUTPUT三个链
nat表:网络地址转换/端口转发,有PREROUTING丶OUTPUT丶POSTROUTING三个链
managle:不经常使用,对包进行操做(标记、修改)
raw:中止iptables对包的追踪,下降开销
security:用于强制访问控制(MAC)的网络规则
五链:
PREROUTING:路由以前经由此链用其规则
INPUT:通过PREROUTING后且目的为本机的包经由此链用其规则(本机进程皆收包)
FORWARD:通过PREROUTING后且须要转发经由此链用其规则
OUTPUT:本机程序需发出经由此链用其规则
POSTROUTING:通过PREROUTING和OUTPUT的包经由此链用其规则并发出
Firewalld 和 Iptables都是为netfilter提供可识别信息来达到防火墙功能的管理型工具rest