From: Nils Rennebarth <nils.rennebarth@funkwerk-ec.com>
To: netfilter@vger.kernel.org
Subject: REJECT target faster for remote than for local packets?
Date: Tue, 27 Mar 2012 15:51:34 +0200 [thread overview]
Message-ID: <4F71C5E6.8040001@funkwerk-ec.com> (raw)
Hi,
A simple firwall rule
iptables -I OUTPUT --protocol tcp --dport 80 -j REJECT
prevents local processes from making TCP connections to port 80,
and those who try will get a -ECONNREFUSED. Good.
But why do they get the error only after a few seconds? A tcpdump
shows that ICMP Packets are generated on the loopback interface:
When doing
wget http://host:80/
exactly two ICMP packets show up on lo:
15:45:11.850785 IP 10.10.10.144 > 10.10.10.144: ICMP 10.10.10.31 tcp port 80 unreachable, length 68
15:45:14.849298 IP 10.10.10.144 > 10.10.10.144: ICMP 10.10.10.31 tcp port 80 unreachable, length 68
But only the second one has an effect:
Connecting to host|10.10.10.31|:80... failed: Connection refused
My question is:
1) why?
2) is there another way to make connections to a certain set of hosts fail fast
and without delay, without changing the applications itself.
--
Mit freundlichen Grüßen / with kind regards
Nils Rennebarth, Software Developer
--
Funkwerk IP-Appliances GmbH
Mönchhaldenstraße 28
D-70191 Stuttgart
Tel: +49 711 900300 - 0
Fax: +49 711 900300 - 90
E-Mail: Nils.Rennebarth@funkwerk-ec.com
Location: GmbH Nuernberg, Local Court Nuernberg, HRB 25481
Managing Directors: Torsten Urban
--------------------------------
The information contained in this e-mail has been carefully researched,
but the possibility of it being inapplicable in individual cases cannot
be ruled out. We therefore regret that we cannot accept responsibility
or liability of any kind whatsoever for the correctness of the
information given. Please notify us if you discover that information is
inapplicable.
next reply other threads:[~2012-03-27 13:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-27 13:51 Nils Rennebarth [this message]
2012-03-27 17:21 ` REJECT target faster for remote than for local packets? Humberto Jucá
2012-03-27 17:45 ` Nils Rennebarth
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=4F71C5E6.8040001@funkwerk-ec.com \
--to=nils.rennebarth@funkwerk-ec.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).