首页 > 其他 > 详细

Centos 7 firewall的防火墙的规则

时间:2018-01-08 22:54:24      阅读:456      评论:0      收藏:0      [点我收藏+]

这是官方文档:

http://www.firewalld.org/documentation/man-pages/firewall-cmd.html

 

 

想使用iptables的规则,firewall也可以做到

[--permanent--direct --add-rule { ipv4 | ipv6 | eb } table chain priority args

Add a rule with the arguments args to chain chain in table table with priority priority.

The priority is used to order rules. Priority 0 means add rule on top of the chain, with a higher priority the rule will be added further down. Rules with the same priority are on the same level and the order of these rules is not fixed and may change. If you want to make sure that a rule will be added after another one, use a low priority for the first and a higher for the following.

The direct options give a more direct access to the firewall. These options require user to know basic iptables concepts, i.e. table (filter/mangle/nat/...), chain (INPUT/OUTPUT/FORWARD/...), commands (-A/-D/-I/...), parameters (-p/-s/-d/-j/...) and targets (ACCEPT/DROP/REJECT/...).

例如:

firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -s 192.168.100.6 -d 192.168.100.124 -j DROP

设置一条IPV4规则,表为防火墙表 :filter,   处理输入数据包 INPUT ,0 代表在头部添加。后面就是常用的iptables语法

 

关于iptables 这里有一个详解:http://www.cnblogs.com/metoy/p/4320813.html

Centos 7 firewall的防火墙的规则

原文:https://www.cnblogs.com/xfbx/p/8245348.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!