Linux Netfilter discussions
 help / color / mirror / Atom feed
* [libipq] local connections problem
@ 2004-11-07 15:21 Enrico
  0 siblings, 0 replies; only message in thread
From: Enrico @ 2004-11-07 15:21 UTC (permalink / raw)
  To: netfilter

Hi, i'm using libipq to develop a small application that blocks
connections from/to hosts if they are in a "black" list. It works fine
for outgoing and incoming traffic but when i try to connect to
localhost or loopback (for ex: ftp 127.0.0.1 or using localhost ip) it
refuses to connect giving a "Connection reset by peer" error. If i try
to connect to a non-opened port it correctly says "Connection
refused".
This is how i QUEUE packets to my app:

iptables -A INPUT -p tcp -m state --state NEW -j QUEUE
iptables -A OUTPUT -p tcp -m state --state NEW -j QUEUE

The only way to make local connections work again is to explicitly
ACCEPT them (before QUEUE'ing them) with:
iptables -I INPUT -p tcp -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT

Chains policy is set to ACCEPT.

I repeat that all the other traffic works fine. I don't understand why
i have to do that, any suggestions?

Enrico


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-11-07 15:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-07 15:21 [libipq] local connections problem Enrico

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