iptables:REJECT 不起作用,但 DROP 起作用

iptables:REJECT 不起作用,但 DROP 起作用

我最近用 fail2ban 设置了一个服务器,它基本上可以正常工作,只是每当尝试执行此命令时都会出现错误:

sudo iptables -D fail2ban-ssh -s xxx.xxx.xxx.xxx -j REJECT --reject-with icmp-port-unreachable

错误信息是:

iptables: No chain/target/match by that name.

当我不使用 REJECT 时,它工作正常。例如:

sudo iptables -D fail2ban-ssh -s xxx.xxx.xxx.xxx -j DROP

执行得很好。我不明白为什么 REJECT 被拒绝了。

答案1

加载外部模块并重modprobe ipt_REJECT试。DROP 是本机的,但 REJECT 是可选的

相关内容