Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
To: lartc@vger.kernel.org
Subject: Re: [LARTC] catching DNAT'ed packet
Date: Tue, 19 Dec 2006 10:01:53 +0000	[thread overview]
Message-ID: <1166522513.9727.3.camel@localhost.localdomain> (raw)
In-Reply-To: <1166204683.4051.36.camel@localhost.localdomain>

Maybe my question was too complex, I would try to make it simple...

Is it possible to catch un-DNAT'ed packet with -j ULOG target?

В Птн, 15/12/2006 в 19:44 +0200, Покотиленко Костик пишет:
> Hi.
> 
> I have a Server's network with some servers in it, all with
> 192.168.1.0/25 ips. There is also a router in that network with ip
> 192.168.1.1. This router also connected to a client's network
> 10.10.0.0/16 with ip 10.10.100.1.
> 
> All services on each server are given their virtual address from one of
> two virtual networks 192.168.1.128/28 and 192.168.1.144/28.
> 192.168.1.128/28 is for freely available services, and 192.168.1.144/28
> is for services available only to authenticated ips.
> 
> There is a DNAT working on the router to map virtual ip/port to
> realip/realport. That all works fine.
> 
> For axample:
>  users connecting to 192.168.1.129:80 are brought to 192.168.1.2:80
>  users connecting to 192.168.1.145:80 are brought to 192.168.1.2:81
> 
> I have to put all traffic I need for accounting to "-j ULOG
> --ulog-nlgroup 10". And, packets should have ips seen to users. For
> axample:
> 
>  10.10.102.50 -> 192.168.1.145:80
>  192.168.1.145:80 -> 10.10.102.50
> and
>  10.10.102.50 -> 192.168.1.129:80
>  192.168.1.129:80 -> 10.10.102.50
> 
> BUT, instead I have:
> 
>  10.10.102.50 -> 192.168.1.145:80
>  192.168.1.2:81 -> 10.10.102.50
> and
>  10.10.102.50 -> 192.168.1.129:80
>  192.168.1.2:80 -> 10.10.102.50
> 
> So, I can ulog the packet's in "state seen by users" only in
> client->server direction, and I was unable to do that in server-clients
> direction!
> 
> Here are iptables rules (I don't want to ulog packets to/from the router
> itself):
> 
> iptables -t mangle -A PREROUTING -i br0 -j IPCAD_out
> iptables -t mangle -A POSTROUTING -o br0 -j IPCAD_in
> 
> iptables -t mangle -A IPCAD_out -d 10.10.100.1 -j RETURN
> iptables -t mangle -A IPCAD_out -d 192.168.1.1 -j RETURN
> iptables -t mangle -A IPCAD_out -j ULOG --ulog-nlgroup 10
> 
> iptables -t mangle -A IPCAD_in -s 10.10.100.1 -j RETURN
> iptables -t mangle -A IPCAD_in -s 192.168.1.1 -j RETURN
> iptables -t mangle -A IPCAD_in -j ULOG --ulog-nlgroup 10
> 
> Is it possible to catch un-DNAT'ed packet???
> 
-- 
Покотиленко Костик <casper@meteor.dp.ua>

_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

      reply	other threads:[~2006-12-19 10:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-15 17:44 [LARTC] catching DNAT'ed packet 
2006-12-19 10:01 `  [this message]

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=1166522513.9727.3.camel@localhost.localdomain \
    --to=lartc@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