I read a firewall script including following lines
iptables -A pfc -p udp --dport 5060 -m recent --name badguy --update --seconds 60 -hitcount 600 -j DROP
iptables -A pfc -p udp --dport 5060 -m recent --name badguy --set
This is a part of deny by default firewall script and pfc is a user-defined subchain of INPUT.
Isn’t something wrong here? The second line doesn’t jump to a chain. What is the fate of packet unless first line match?
I think it should be done
iptables -A pfc -p udp --dport 5060 -m recent --name badguy --set **-j ACCEPT**
Isn’t that right?
As written, this rule:
Sets the
recententry for the packet, and then continues to process additionaliptablesrules that may decide to explicitly reject or accept the packet.On the other hand, your suggested modification…
…accepts the packet immediately with no further processing. That’s a substantial difference in behavior, and whether or not it’s appropriate depends entirely on your local situation.