How to log NAT translations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi guys!

I'm a newbie in this mainling list, so I'm sorry if this question was
already asked.

I'd like to have more specific logging output of NAT translation in
iptables. Is there an way to logging of ORIGINAL_IP/ORIGINAL_PORT +
TRANSLATED_IP/TRANSLATED_PORT?

I know that I can put a logging rule before my NAT rule, but this way
I haven't the TRANS_IP/TRANS_PORT... for instance:

iptables -t nat -I POSTROUTING -s 10.0.0.0/24 -j SNAT --to 172.16.0.1
iptables -t nat -I POSTROUTING -s 10.0.0.0/24 -j LOG

In the above example I don't know how to get the TRANS_PORT...

I also know that we can access this information through
/proc/net/ip_conntrack (or using netstat-nat), but to get all
translation of a whole day its a big overhead to parse that file all
the time...

Thanks for any help!

- -- 
Saudações,

Italo Valcy :: http://wiki.dcc.ufba.br/~ItaloValcy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyPr98ACgkQfidLqjN6RNGWAgCgjLgYUkPiAEp+C2znpRqUskoU
FAQAoIeWZQEXFS9LY2RSnxlSKjrmtkNL
=WLWD
-----END PGP SIGNATURE-----

--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux