I have the following setup: in /etc/iptables/rules.v4
# Generated by iptables-save v1.4.21 on Mon Jul 1 11:32:00 2019
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [3:620]
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -s 192.168.35.107/32 -p icmp -m icmp --icmp-type 8 -j DROP
-A INPUT -s 192.168.35.0/24 -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -s 192.168.35.0/24 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -j DROP
COMMIT
# Completed on Mon Jul 1 11:32:00 2019
from above we see that I want to block ping from specific IP.
After I save rules with iptables-restore < /etc/iptables/rules.v4, and I list rules with iptables -L, I can conclude that computer with ip 192.168.35.107 is unable to ping the server.
However, the computer with that IP is able to ping indefinitely until I break the session. Even after I break the ping I still need to make ~60 seconds pause until I am unable to ping again. If I make 5-10 seconds pause between ping command the firewall let me through.
Funnily enough when I enable ping through the iptables it works immediately. I have tried with the Samba port 445 as well. Same.
Is there a way to make iptables dropped ports immidiately effective?