Linux Netfilter discussions
 help / color / mirror / Atom feed
* Strange behaviour of REDIRECT/ipt_recent
@ 2005-09-22 21:18 Sven Geggus
  2005-09-23 12:55 ` /dev/rob0
  2005-09-24 12:56 ` Sorin Panca
  0 siblings, 2 replies; 3+ messages in thread
From: Sven Geggus @ 2005-09-22 21:18 UTC (permalink / raw)
  To: netfilter

Hi there,

the following rule works fine so far
(redirect any connection to a given IP to Port 22):

iptables -t nat -A PREROUTING  -p tcp ! --dport 22 -d $SSHIP -j REDIRECT \
--to-port 22

But now I need to restrict Connections to 3 accesses per minute to prevent
DOS-Attacken by means of Portscans:

iptables -A INPUT -i eth0 -p tcp -d $SSHIP -m state --state NEW -m recent \
--set --name SSH
iptables -A INPUT -i eth0 -p tcp -d $SSHIP -m state --state NEW -m recent \
--update --seconds 60 --hitcount 4 --rttl --name SSH -j REJECT \
--reject-with tcp-reset

Unfortunately this does not work as expected :(

It just works on port 22 but not on any other port.

I suspect that the redirect rule may change the destination IP to the
default IP of eth0, but I would consider this to be a bug.

Can you confirm this? workarounds?

Sven

P.S.: Please CC me in the reply, because I am not subscribed to the list.

-- 
wenn ping auf localhost nicht funktioniert, solltest Du zuerst TCP/IP
de- und neuinstallieren.
                            (Mario Arndt in de.comm.protocols.tcp-ip)
/me is giggls@ircnet, http://sven.gegg.us/ on the Web


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-09-24 12:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-22 21:18 Strange behaviour of REDIRECT/ipt_recent Sven Geggus
2005-09-23 12:55 ` /dev/rob0
2005-09-24 12:56 ` Sorin Panca

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox