Skip to contentSkip to conversation

'recent' module HOWTO

DISCUSSION Sudheer Divakaran 2 participants 3 messages Aug 11, 2004 – Aug 12, 2004

lore
Share & tools
lore
#0 lore raw

Hi,
Where can I find detailed documentation of 'recent' module?.

To test the recent module, I've given the following commands and pinged to my machine from another one. But I got the reply 'Destination port Unreachable'. What is wrong in it?

iptables -F

iptables -P INPUT ACCEPT

iptables -P OUTPUT ACCEPT

iptables -A INPUT -m recent -p icmp --icmp-type echo-request --update --seconds 10 -j REJECT

iptables -A INPUT -m recent -p icmp --icmp-type echo-request --set -j ACCEPT

Kind Regards,
Sudheer

#1 lore raw
Quoted 3 lines · Sudheer Divakaran

Hi,
Where can I find detailed documentation of 'recent' module?.

http://snowman.net/projects/ipt_recent/

Quoted 4 lines

To test the recent module, I've given the following commands and pinged to my machine from another one. But I got the reply 'Destination port Unreachable'. What is wrong in it?

There's nothing wrong with that. You did specify to REJECT packets, which means that you can send back an ICMP error of your choice.

I guess 'Destination port Unreachable' is the default one.

Quoted 5 lines

iptables -F

iptables -P INPUT ACCEPT

Quoted 8 lines

iptables -P OUTPUT ACCEPT

iptables -A INPUT -m recent -p icmp --icmp-type echo-request --update --seconds 10 -j REJECT

iptables -A INPUT -m recent -p icmp --icmp-type echo-request --set -j ACCEPT

However, you should be able to get a single ping reply before being rejected. Is that what happen ?

Quoted 4 lines

Kind Regards,
Sudheer

Hope this helps.

Samuel Jean
CookingLinux.org

#2 lore raw

Hi,
The problem has been solved. When I set the rules like this, it
worked as expected (i.e., it accepted an icmp echo request, then rejected icmp echo requests for 10 seconds, ...). Earlier it were rejecting ALL icmp-echo requests. My question is this the correct usage of this module?

iptables -A INPUT -m recent -p icmp --icmp-type echo-request --update

iptables -A INPUT -m recent -p icmp --icmp-type echo-request --rcheck --seconds 10 -j REJECT

iptables -A INPUT -m recent -p icmp --icmp-type echo-request --set

Thanks everybody,
Sudheer.

Quoted 52 lines · Samuel Jean
Quoted 4 lines · Sudheer Divakaran

Hi,
Where can I find detailed documentation of 'recent' module?.

http://snowman.net/projects/ipt_recent/

Quoted 4 lines

To test the recent module, I've given the following commands and pinged to my machine from another one. But I got the reply 'Destination port Unreachable'. What is wrong in it?

There's nothing wrong with that. You did specify to REJECT packets, which means that you can send back an ICMP error of your choice.

I guess 'Destination port Unreachable' is the default one.

Quoted 4 lines

iptables -F

iptables -P INPUT ACCEPT

Quoted 9 lines

iptables -P OUTPUT ACCEPT

iptables -A INPUT -m recent -p icmp --icmp-type echo-request --update --seconds 10 -j REJECT

iptables -A INPUT -m recent -p icmp --icmp-type echo-request --set -j ACCEPT

However, you should be able to get a single ping reply before being rejected. Is that what happen ?

Quoted 4 lines

Kind Regards,
Sudheer

Hope this helps.

Samuel Jean
CookingLinux.org