LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 05: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, 06: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, 09: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, 11:04 AM   #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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:27 PM.

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