Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 06-09-2002, 06:34 AM   #1
Registered: May 2002
Location: Shanghai, PRC
Distribution: RedHat 6.2 | 7.2 | 8 | 9|3
Posts: 81

Rep: Reputation: 15
Lightbulb Please give a simple sample about LOG in iptables!

Hi all,

I tried lotsa times to use LOG function of IPTABLES in RedHat 7.2.
But I always failed.
Would you please give me some sample usage?
(I wanna make the log to my existing chain-- that's "-A POSTROUTING -s -j MASQUERADE")
Thank you very much

Old 06-09-2002, 07:03 AM   #2
Registered: May 2002
Location: Dalec, HU
Distribution: Redhat 7.3
Posts: 696

Rep: Reputation: 30
iptables -A FORWARD -d -s -j LOG -log-prefix "IPTABLES forward:"

would log all packets that are forwarded from your local lan to ip address

Old 06-09-2002, 10:49 AM   #3
LQ Newbie
Registered: Mar 2002
Posts: 3

Rep: Reputation: 0
Try Oskar Andreasson 's tutorial:

It's very helpfull and you will find help on loging,too

In your case:

iptables -A POSTROUTING -s -j LOG -log-prefix "Text to read in log"

So, first log,and after do what ever you want with those packets.
Old 06-09-2002, 12:04 PM   #4
Registered: May 2002
Location: Dalec, HU
Distribution: Redhat 7.3
Posts: 696

Rep: Reputation: 30
also try


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Deleted /var/log/messages, can't log any files-iptables chingyenccy Linux - Newbie 7 02-27-2005 05:03 PM
give it to me simple..mplayer... rab62184 Mandriva 12 11-13-2003 03:31 AM
iptables, changing log file from /var/log/messages acid2000 Linux - Networking 3 03-11-2003 09:38 PM
Is there a simple way to give all permissions frontier1 Linux - General 3 02-28-2003 09:55 PM
Iptables Sample Firewall Generator mqe Linux - Security 2 06-20-2002 03:12 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:36 AM.

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