LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-19-2009, 09:44 AM   #1
sang_froid
Member
 
Registered: Oct 2006
Posts: 179

Rep: Reputation: 15
logging iptables


Hi

I have a rule in iptables which says:

ACCEPT tcp -- 192.168.4.253 anywhere tcp dpt:ssh

How do I log all the entries that match this rule to system log ??
 
Old 05-19-2009, 10:46 AM   #2
unixfool
Member
 
Registered: May 2005
Location: Northern VA
Distribution: Slackware, Ubuntu, FreeBSD, OpenBSD, OS X
Posts: 782
Blog Entries: 8

Rep: Reputation: 158Reputation: 158
You'd do it similar to this:

Code:
-A INPUT -s 118.0.0.0/8 -j LOG
-A INPUT -s 118.0.0.0/8 -j DROP
First use the log statement, then the action statement (log/drop, log/accept).

Yours would read:

Code:
LOG tcp -- 192.168.4.253 anywhere tcp dpt:ssh
ACCEPT tcp -- 192.168.4.253 anywhere tcp dpt:ssh

Last edited by unixfool; 05-19-2009 at 10:48 AM.
 
  


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 logging hemi_426 Linux - Server 39 05-01-2008 05:11 AM
Iptables Logging doublejoon Linux - Security 8 01-09-2006 04:20 AM
iptables logging laotalax Linux - Networking 1 10-25-2005 09:55 AM
iptables logging zsoltrenyi Linux - Software 1 08-19-2004 10:15 AM
Iptables logging Mogwa_ Linux - Security 2 08-01-2004 02:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:24 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