Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Alessandro Vesely <vesely@tana.it>
Cc: netfilter@vger.kernel.org, support@iptables.info,
	Jan Engelhardt <jengelh@medozas.de>
Subject: Re: Best way to kill a live TCP connection?
Date: Wed, 12 Jan 2011 01:20:29 +0100	[thread overview]
Message-ID: <4D2CF3CD.1030704@netfilter.org> (raw)
In-Reply-To: <4D2C8374.70408@tana.it>

On 11/01/11 17:21, Alessandro Vesely wrote:
> On 11/Jan/11 15:41, Jan Engelhardt wrote:
>> On Tuesday 2011-01-11 13:35, Alessandro Vesely wrote:
>>
>>> Hi all,
>>> this is clearly an overworked topic.  However, I haven't been able to
>>> find definitive info about it.  Please help providing more insight.
>>> In particular, if it is possible/convenient to design an RST injector
>>> and how to attach it to iptables?
>>
>> If you use a ruleset that emits RST for NEW connections that are picked 
>> up rather than SYN-new,
>>
>> -m conntrack --ctstate NEW -p tcp ! --syn --dport 22 -j REJECT 
>> --reject-with tcp-reset
>>
>> .. makes it possible to RST-kill connections using `conntrack -D`.
> 
> That's the most elegant method I've seen thus far.  Thanks a lot!
> 
> A generic rule like that (i.e. without --dport) is mentioned in the
> tutorial http://www.iptables.info/en/iptables-problems.html#NEWNOTSYN
> but I never realized it can be used this way.  (I CC this there.)

I'll try to add this to the conntrack-tools manual, it's indeed good.

      parent reply	other threads:[~2011-01-12  0:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-11 12:35 Best way to kill a live TCP connection? Alessandro Vesely
2011-01-11 14:41 ` Jan Engelhardt
2011-01-11 16:21   ` Alessandro Vesely
2011-01-11 17:39     ` Pascal Hambourg
2011-01-11 21:10       ` Grant Taylor
2011-01-11 22:31         ` Jan Engelhardt
2011-01-12  8:52           ` Alessandro Vesely
2011-01-18 17:50         ` Alessandro Vesely
2011-01-18 18:45           ` Gáspár Lajos
2011-01-19 13:32             ` Alessandro Vesely
2011-01-12  0:20     ` Pablo Neira Ayuso
2011-01-12  0:20     ` Pablo Neira Ayuso [this message]

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=4D2CF3CD.1030704@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=jengelh@medozas.de \
    --cc=netfilter@vger.kernel.org \
    --cc=support@iptables.info \
    --cc=vesely@tana.it \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox