admin管理员组

文章数量:1642347

firewalld防火墙

1.firewalld防火墙入口

防火墙开放端口可使用区域开放

firewall-cmd --permanent --add-port=80/tcp --add-port=8080/tcp

或者是使用netfilter模块

firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -s 172.16.4.0/23 -j ACCEPT

禁止所有流量进入

firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 100 -j REJECT

0:代表优先级

100:代表优先级

2.firewalld防火墙出口

firewalld防火墙一般都是对入口进行防护,网络上也大多是对入口进行限制。出口使用netfilter模块

firewall-cmd --permanent --direct --add-rule ipv4 filter OUTPUT 1 -d 172.16.4.0/23 -j ACCEPT

禁止所有流量出去(禁止主机联网等功能)

firewall-cmd --permanent --direct --add-rule ipv4 filter OUTPUT 100 -j REJECT

1:代表优先级

100:代表优先级

添加规则后需要重载才能生效

firewall-cmd --reload

本文标签: 防火墙firewalld