LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   IPTABLES NAT Log (https://www.linuxquestions.org/questions/linux-newbie-8/iptables-nat-log-898309/)

jarias 08-19-2011 12:36 PM

IPTABLES NAT Log
 
Hi, All

I have a NAT and I need to LOG the traffic, is there a way that I can do it
I have try with no luck.

this is the NAT

iptables -t nat -A POSTROUTING -s 10.41.15.0/28 -o eth0 -j SNAT --to 200.105.101.241
iptables -t nat -A POSTROUTING -s 10.41.15.16/28 -o eth0 -j SNAT --to 200.105.101.242
iptables -t nat -A POSTROUTING -s 10.41.15.32/28 -o eth0 -j SNAT --to 200.105.101.243
iptables -t nat -A POSTROUTING -s 10.41.15.48/28 -o eth0 -j SNAT --to 200.105.101.244
iptables -t nat -A POSTROUTING -s 10.41.15.64/28 -o eth0 -j SNAT --to 200.105.101.245
iptables -t nat -A POSTROUTING -s 10.41.15.80/28 -o eth0 -j SNAT --to 200.105.101.246
iptables -t nat -A POSTROUTING -s 10.41.15.96/28 -o eth0 -j SNAT --to 200.105.101.247
iptables -t nat -A POSTROUTING -s 10.41.15.112/28 -o eth0 -j SNAT --to 200.105.101.248
iptables -t nat -A POSTROUTING -s 10.41.15.128/28 -o eth0 -j SNAT --to 200.105.101.249
iptables -t nat -A POSTROUTING -s 10.41.15.144/28 -o eth0 -j SNAT --to 200.105.101.250
iptables -t nat -A POSTROUTING -s 10.41.15.160/28 -o eth0 -j SNAT --to 200.105.101.251
iptables -t nat -A POSTROUTING -s 10.41.15.176/28 -o eth0 -j SNAT --to 200.105.101.252
iptables -t nat -A POSTROUTING -s 10.41.15.192/28 -o eth0 -j SNAT --to 200.105.101.253
iptables -t nat -A POSTROUTING -s 10.41.15.208/28 -o eth0 -j SNAT --to 200.105.101.254


Thanks
Regards,

Jorge

kostya 08-19-2011 01:37 PM

Read more about the iptables LOG target and options to use with it.

jarias 08-19-2011 04:10 PM

спасибо многие

-- Jorge


All times are GMT -5. The time now is 09:51 AM.