From: "Neal P. Murphy" <neal.p.murphy@alum.wpi.edu>
Cc: "netfilter@vger.kernel.org" <netfilter@vger.kernel.org>
Subject: Re: Iptables Reject with TCP Reset
Date: Fri, 6 Jan 2017 18:26:23 -0500 [thread overview]
Message-ID: <20170106182623.75d3451d@playground> (raw)
In-Reply-To: <HK2PR0201MB2129ABDBC46F8805B3757387E8630@HK2PR0201MB2129.apcprd02.prod.outlook.com>
On Fri, 6 Jan 2017 16:28:31 +0000
Matt Killock <matt.killock@praemium.com> wrote:
> > Depends on your rule set. Check and fix it. The target usually works.
>
> As a test, I made the very first FORWARD rule this:
>
> iptables -A FORWARD -i eth1 -p tcp -s 192.168.20.0/24 -d 212.58.244.71 --dport 80 -j REJECT --reject-with tcp-reset
Dumb question: can you reset a TCP conn that isn't ESTABLISHED? I don't think a TCP reset applies to the first SYN packet.
Here are the rules I use when a conn passes outside its allowed time frame:
-A timedaction -p tcp -m state --state ESTABLISHED -j REJECT --reject-with tcp-reset
-A timedaction -j REJECT --reject-with icmp-admin-prohibited
When a packet is received for an established TCP conn, a reset is returned to the sender. Each direction is handled separately. Once a particular direction has been reset, it is no longer ESTABLISHED, and further packets in that direction are rejected with ICMP 'admin prohibited' packets.
In short, each direction of established TCP conns is reset individually. All other conns, including each reset direction of TCP conns, are rejected via ICMP.
N
next prev parent reply other threads:[~2017-01-06 23:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-06 15:19 Iptables Reject with TCP Reset Matt Killock
2017-01-06 16:09 ` Noel Kuntze
2017-01-06 16:28 ` Matt Killock
2017-01-06 16:35 ` Noel Kuntze
[not found] ` <HK2PR0201MB212932A38853DB306E300014E8630@HK2PR0201MB2129.apcprd02.prod.outlook.com>
2017-01-06 17:52 ` Noel Kuntze
2017-01-09 10:45 ` Matt Killock
2017-01-10 7:35 ` André Paulsberg-Csibi (IBM Consultant)
2017-01-10 10:09 ` Matt Killock
2017-01-10 11:41 ` André Paulsberg-Csibi (IBM Consultant)
2017-01-10 18:32 ` Neal P. Murphy
2017-01-10 19:29 ` Matt Killock
2017-01-11 10:21 ` André Paulsberg-Csibi (IBM Consultant)
2017-01-11 10:34 ` Matt Killock
2017-01-06 17:30 ` Ethy H. Brito
2017-01-06 23:26 ` Neal P. Murphy [this message]
2017-01-06 23:40 ` Noel Kuntze
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=20170106182623.75d3451d@playground \
--to=neal.p.murphy@alum.wpi.edu \
--cc=netfilter@vger.kernel.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.