LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-19-2011, 12:36 PM   #1
jarias
LQ Newbie
 
Registered: May 2009
Posts: 12

Rep: Reputation: 0
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
 
Old 08-19-2011, 01:37 PM   #2
kostya
Member
 
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 174
Blog Entries: 5

Rep: Reputation: 18
Read more about the iptables LOG target and options to use with it.
 
Old 08-19-2011, 04:10 PM   #3
jarias
LQ Newbie
 
Registered: May 2009
Posts: 12

Original Poster
Rep: Reputation: 0
спасибо многие

-- Jorge
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables: can't initialize iptables table `NAT' linuxgentoo Linux - Kernel 3 01-17-2010 10:15 AM
Firewall log file, how to make several different log files with IPTables? newtovanilla Linux - Newbie 5 11-28-2008 12:39 PM
Deleted /var/log/messages, can't log any files-iptables chingyenccy Linux - Newbie 7 02-27-2005 04:03 PM
IPTABLES : build NAT using IPTABLES joseph Linux - Networking 4 04-23-2004 05:08 AM
iptables, changing log file from /var/log/messages acid2000 Linux - Networking 3 03-11-2003 08:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration