开发者社区> 问答> 正文

咨询一个CentOS7防火墙firewalld的问题


firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.0.0/24" service name="http" accept"


使用CentOS7有一段时间了,也一直在学习新的防火墙配置工具firewalld,就像例子那样,常用的都是配置入站方向的规则。
然后想到如果有服务器自身出站方向的规则,要怎么写呢,比如限制不能请求外部某个特定IP,或者不能请求外部所有网段的8080端口这样的情形。看了很多文档,发现都没提到这回事儿。该怎么写呢?请高手指点,谢谢!

展开
收起
harveymei 2015-07-16 10:19:46 6660 0
2 条回答
写回答
取消 提交回答
  • 用6.5不是很好吗,教程也多
    2015-07-16 13:00:24
    赞同 展开评论 打赏
  • 回楼主harveymei的帖子
    难道是这样?

    Currently with firewalld it is not possible to block outbound
    connections. You would need to revert back to iptables to get this
    behavior back. Please keep in mind that in CentOS 7, iptables is no
    longer just one package either.

    https://lists.fedorahosted.org/pipermail/firewalld-users/2013-February/000053.html

    还有这个没有权限查看的解决方案

    https://access.redhat.com/solutions/1121463

    还有星星点点的提到的--direct的配置方法。

    https://lists.fedorahosted.org/pipermail/firewalld-users/2014-October/000250.html
    2015-07-16 12:03:36
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
《云防火墙实现多账号统一管控》 立即下载
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载