LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 06-09-2002, 06:34 AM   #1
yuzuohong
Member
 
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 10.0.0.0/255.255.255.0 -j MASQUERADE")
Thank you very much

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

Rep: Reputation: 30
iptables -A FORWARD -d 192.168.1.0/24 -s 1.2.3.4/32 -j LOG -log-prefix "IPTABLES forward:"

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

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

Rep: Reputation: 0
Try Oskar Andreasson 's tutorial:
http://www.linuxsecurity.com/resourc...-tutorial.html

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

In your case:

iptables -A POSTROUTING -s 10.0.0.0/255.255.255.0 -j LOG -log-prefix "Text to read in log"
iptables -A POSTROUTING -s 10.0.0.0/255.255.255.0 -j MASQUERADE

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

Rep: Reputation: 30
also try www.linuxguruz.org/iptables
 
  


Reply


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


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration