开发者社区 问答 正文

咨询一个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 6673 分享
分享
版权
举报
2 条回答
写回答
取消 提交回答
  • 用6.5不是很好吗,教程也多
    2015-07-16 13:00:24 举报
    赞同 评论

    评论

    全部评论 (0)

    登录后可评论
  • 回楼主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 举报
    赞同 评论

    评论

    全部评论 (0)

    登录后可评论
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等