小编VeL*_*err的帖子

错误的 iptables 参数

我正在尝试使用 IPtables 来保护 Portmap。为此,我应该拒绝从除192.168.0.0/24TCP 和 UDP 之外的所有 IP 接收包。

为此,我编写了这样的 IPtables 规则:

iptables -A INPUT -p tcp -s! 192.168.0.0/24  --dport 111 -j DROP
iptables -A INPUT -p udp -s! 192.168.0.0/24  --dport 111 -j DROP
Run Code Online (Sandbox Code Playgroud)

但我得到这样的错误:

Bad argument `192.168.0.0/24'
Try `iptables -h' or 'iptables --help' for more information.
Run Code Online (Sandbox Code Playgroud)

如何编辑规则以获得正确的规则?

server iptables firewall networking

1
推荐指数
1
解决办法
2万
查看次数

标签 统计

firewall ×1

iptables ×1

networking ×1

server ×1