NetFilter
[Top] [All Lists]

Re: iptables NEW TABLE request. WAS[Re: Catching un-DNAT'ed packets]

To: netfilter@lists.netfilter.org
Subject: Re: iptables NEW TABLE request. WAS[Re: Catching un-DNAT'ed packets]
From: Pascal Hambourg <pascal.mail@plouf.fr.eu.org>
Date: Wed, 31 Jan 2007 12:38:43 +0100
Delivered-to: sp-com-lists@consult.net
Delivered-to: netfilter-list1@securepoint.com
In-reply-to: <1170234888.4464.9.camel@localhost.localdomain>
List-archive: </pipermail/netfilter>
List-help: <mailto:netfilter-request@lists.netfilter.org?subject=help>
List-id: General discussion and user questions <netfilter.lists.netfilter.org>
List-post: <mailto:netfilter@lists.netfilter.org>
List-subscribe: <https://lists.netfilter.org/mailman/listinfo/netfilter>, <mailto:netfilter-request@lists.netfilter.org?subject=subscribe>
List-unsubscribe: <https://lists.netfilter.org/mailman/listinfo/netfilter>, <mailto:netfilter-request@lists.netfilter.org?subject=unsubscribe>
Organization: Plouf !
References: <1167054030.16171.10.camel@localhost.localdomain> <459102EC.50402@plouf.fr.eu.org> <1169810473.8286.8.camel@localhost.localdomain> <1170086305.11285.4.camel@localhost.localdomain> <Pine.LNX.4.61.0701301145530.23321@yvahk01.tjqt.qr> <Pine.LNX.4.61.0701301901470.13737@yvahk01.tjqt.qr> <1170234888.4464.9.camel@localhost.localdomain>
Sender: netfilter-bounces@lists.netfilter.org
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
Hello

Pokotilenko Kostik a écrit :

 -t nat -A POSTROUTING -m conntrack --ctstate DNAT --ctorigdst x.x.x.x

Just to make sure. This rule will match the packets with canntrack state
"DNAT" and whose original (before DNAT) destination address was x.x.x.x,
right?

This is my understanding. However I would recommend not to put such a rule in the nat table because chains in the nat table do not see reply packets.

If I add -j ULOG to this rule what would be logged packet source address
for replay packet (Server->Client)? Original, that client was initially
connected to, or real, that was set during DNAT?

The rule would log the current packet source address as usual, so it won't show the original destination address unless you had put it in the --log-prefix option.

By the way does -m conntrack --ctstate DNAT --ctorigdst x.x.x.x match
request or replay packets or packets belonging to connection which was
originally made to x.x.x.x?

From my understanding, the latter. "Original" and "reply" usually refer to connection tracking, not individual packets. However I am not sure whether it would match the first packet creating the connection, can anyone confirm ?


<Prev in Thread] Current Thread [Next in Thread>