我想使用firewall-cmd的直接规则方法添加一系列输出链端口,如下所示:
firewall-cmd --permanent --direct --add-rule ipv4 filter OUTPUT 0 -p tcp -m tcp --dport=80-1000 -j ACCEPT但这说明success似乎不起作用
发布于 2018-03-21 21:56:42
使用逗号,即--dport 80,1000。
也就是说,不鼓励使用直接规则(您的命令返回'success‘,因为firewall-cmd不检查直接输入的iptables语法--它假定您的规则是正确的)。手册页上写着:
Direct options should be used only as a last resort when it's not possible to use for example --add-service=service or --add-rich-rule='rule'.
参见Configuring Complex Firewall Rules with the "Rich Language" Syntax。
https://stackoverflow.com/questions/49385635
复制相似问题