
smtp 서버에 대해 failure2ban을 사용하여 서버를 구성했습니다. 이제 FAIL2BAN은 IP를 올바르게 금지하고 있으며 Fail2ban의 iptables 체인에서 해당 IP를 볼 수 있습니다. 그러나 커널은 iptables fall2ban 체인 REJECT 규칙을 무시하는 것 같습니다. 대신 INPUT 체인에 동일한 규칙을 추가하면 작동합니다.
출력은 다음과 iptables -L -n -v
같습니다.
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
207 8339 f2b-postfix tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dports 80,443,25,587,110,995,143,993,4190
17 2172 REJECT all -- * * 141.98.11.68 0.0.0.0/0 reject-with icmp-port-unreachable
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain f2b-postfix (1 references)
pkts bytes target prot opt in out source destination
0 0 REJECT all -- * * 141.98.11.68 0.0.0.0/0 reject-with icmp-port-unreachable
207 8339 RETURN all -- * * 0.0.0.0/0 0.0.0.0/0
보시다시피 체인 REJECT
의 규칙은 f2b-postfix
무시되고(0 패킷) 모든 패킷이 RETURN
규칙에 포함됩니다. 그러나 체인 REJECT
에 동일한 규칙을 추가하면 INPUT
작동하고 패킷을 거부합니다.
원시 iptables 구성도 확인했는지 확인하십시오.
-A INPUT -s 141.98.11.68/32 -j REJECT --reject-with icmp-port-unreachable
-A f2b-postfix -s 141.98.11.68/32 -j REJECT --reject-with icmp-port-unreachable
그러나 두 규칙은 동일합니다.
어떤 아이디어?