All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] catching DNAT'ed packet
@ 2006-12-15 17:44 
  2006-12-19 10:01 ` 
  0 siblings, 1 reply; 2+ messages in thread
From:  @ 2006-12-15 17:44 UTC (permalink / raw)
  To: lartc

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-12-19 10:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-15 17:44 [LARTC] catching DNAT'ed packet 
2006-12-19 10:01 ` 

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.