NAT Log Iptables

Discussion in 'HOWTO-Related Questions' started by jariasca, Aug 17, 2011.

  1. jariasca

    jariasca New Member

    Hi, All

    I have a NAT and I neet to LOG the traffic, is there a way that I can do it
    I have try with no luck only by using tcpdump.

    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
     

Share This Page