All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Fenn <fenn@stanford.edu>
To: netfilter@lists.netfilter.org
Subject: recent match in SSH chain not working
Date: Sun, 4 Dec 2005 01:59:23 -0800	[thread overview]
Message-ID: <20051204095923.GA20587@stanford.edu> (raw)

I'm using a variant of Grant Taylor's SSH brute force chain table in
my firewall script, but I'm having a bit of trouble.  I first define a
SSH chain as:

/sbin/iptables -N SSH
/sbin/iptables -F SSH
/sbin/iptables -A SSH -m recent --name SSH --set --rsource
/sbin/iptables -A SSH -i ${IFint} -j RETURN
/sbin/iptables -A SSH -m recent ! --rcheck --seconds 60 --hitcount 3 --name SSH --rsource -j RETURN
/sbin/iptables -A SSH -j DUMP

(IFint is a trusted, internal network) and then a jump to the chain in
my INPUT rules:

/sbin/iptables -A INPUT -p tcp -i ${IFext} --dport ssh -m state --state NEW -j SSH
/sbin/iptables -A INPUT -p tcp -i ${IFext} --dport ssh -j ACCEPT

the jump to the SSH chain works fine, and I notice the recent list
being created correctly in /proc/net/ipt_recent/SSH.  However, the
rule:

/sbin/iptables -A SSH -m recent ! --rcheck --seconds 60 --hitcount 3 --name SSH --rsource -j RETURN

never matches any packets, and thus any connection from outside my
trusted network fails.  Strangely, this rule *worked* for awhile, and
only recently stopped allowing outside SSH connections, for reasons
I'm completely mystified by - my only guess is a recent upgrade borked
something, or I'm missing something obvious in the above ruleset.  Any
help/pointers would be greatly appreciated.

If its of any help, I'm using iptables 1.3.0 on a 2.6.12 kernel.

Regards,
Tim


                 reply	other threads:[~2005-12-04  9:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051204095923.GA20587@stanford.edu \
    --to=fenn@stanford.edu \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.