From: Martijn Lievaart <m@rtij.nl>
Cc: "Сергеев Сергей Николаевич" <serg@dinfo.ru>,
netfilter@lists.netfilter.org
Subject: Re: iptables -j REDIRECT
Date: Thu, 08 Jul 2004 18:08:41 +0200 [thread overview]
Message-ID: <40ED7189.2070408@rtij.nl> (raw)
In-Reply-To: <1089212276.3299.19.camel@anduril.intranet.cartel-securite.net>
Cedric Blancher wrote:
>Le lun 05/07/2004 à 23:08, Сергеев Сергей Николаевич a écrit :
>
>
>>how can I manage packets incoming from 80 port to my LAN?
>>All chains and tables(OUTPUT:mangle,nat,filter and
>>POSTROUTING:mangle,nat) shows that one go from
>>local_ip_of_gateway:3128.
>>But tcpdump started at LAN interface shows that packets go from real
>>ip addresses and src_port 80....
>>In what chain and table netfilter replaces SRC_ip & SRC_port back by
>>real?
>>
>>
>
>After POSTROUTING, so you are not able to match them. But what you can
>do is use CONNMARK target and connmark match to spot thoses connections.
>
>Something like :
>
> iptables -A PREROUTING -t mangle -i LAN -p tcp --dport 80 \
> -j CONNMARK --set-mark 0x01
>
>Now, every packet that belongs to a connection beginning by one of
>theses packets will get connmarked with 0x01. To match them back, use
>connmark match like this :
>
> -m connmark --mark 0x01
>
>Hope it will help.
>
>
>
I don't think it will help. There is no nat going on after the
port-redirect. Squid will open a new tcp connection so the source-ip
will always be squids. Nothing you can do about that, but you can maybe
account for the traffic by using the squid logs.
HTH,
Martijn Lievaart
next prev parent reply other threads:[~2004-07-08 16:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-05 21:08 iptables -j REDIRECT Сергеев Сергей Николаевич
2004-07-07 14:57 ` Cedric Blancher
2004-07-08 16:08 ` Martijn Lievaart [this message]
2004-07-10 15:37 ` Cedric Blancher
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=40ED7189.2070408@rtij.nl \
--to=m@rtij.nl \
--cc=netfilter@lists.netfilter.org \
--cc=serg@dinfo.ru \
/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.