LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-05-2009, 05:42 AM   #1
alok.rhct
Member
 
Registered: Dec 2005
Posts: 75

Rep: Reputation: 16
IPtables logs, coming to *tty and in dmesg


Hi GURUS,
I have configured iptables to log all incoming packets in a separate file at /var/log location.
which is working fine, but the problem is :
--The logs are displayed to all terminal , dmesg along with the actual file (i.e /var/log/firewall.log)

My syslog contains :
##DUMP FIREWALL LOG : Added by Firewall Script
kern.warn /var/log/firewall.log
kern.info /var/log/firewall.log

I come to know about dmesg LEVEL , using which , firewall messages can be avoided on dmesg, but have no idea about how to use it.
So it will be great help if any one can help me in fixing this issue (with dmesg /or any other way), also if possible , provide me some link , so that I can get full information about these Dmesg LEVELS. (what are the different level and how to use it ??).

After googling around, i tried to fix this by changing the /proc/sys/kernel/printk value.
FYI, my system current printk value is "3 4 1 7 "
I have no idea , what these value stands for , but it's not able to save my dmesg problem.

Thanks in advance for your suggestions.
 
Old 03-05-2009, 05:59 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by alok.rhct View Post
I come to know about dmesg LEVEL , using which , firewall messages can be avoided on dmesg, but have no idea about how to use it. (..) get full information about these Dmesg LEVELS.
Check 'man dmesg' (usage) which leads to 'man 8 syslogd' (syslog daemon nfo) which leads to 'man 3 syslog' (facility/priority) and 'man 2 syslog' (loglevel aka facility listing). You'll find using 'dmesg' is like 'dmesg -n n' where n is a facility between 0 and 7.
 
Old 04-02-2009, 01:35 AM   #3
alok.rhct
Member
 
Registered: Dec 2005
Posts: 75

Original Poster
Rep: Reputation: 16
Thanks for your suggestion but still i am not able to fix it and need help !
Problem is when ever I try to enable log option (with level warn and redirect it to file in syslog.conf [as keren.warn filename]), it start logging to file as well as on screen/terminal, due to which my system accessibility get suffered.
Is there any way to fix it , so that log msg go only to mentioned file not to screen or dmesg.

I am in dark and need some light to fix it.

Thanks for your help in advance
alok
 
Old 04-02-2009, 02:16 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Please post what you tried (actual commands) and contents of syslog.conf?
 
Old 04-02-2009, 04:37 AM   #5
alok.rhct
Member
 
Registered: Dec 2005
Posts: 75

Original Poster
Rep: Reputation: 16
HI,
Below are the steps I followed to log iprules;
-- Enable iptables log by
: iptables -I INPUT 1 -p tcp -s x.x.x.x -i eth0 -j LOG --log-prefix CH-IN: ALL tcp packets --log-level warn
--Setup syslog to log this to file at /var/log/firewall.log
: vi /etc/syslog.conf ;
kern.warn /var/log/firewall.log
kern.info /var/log/firewall.log
kern.none /dev/console

But still the log message are at console along with dmesg and firewall.log

--alok
 
  


Reply

Tags
iptables, log


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
dmesg output to tty joeuser123 Linux - Newbie 9 02-27-2009 12:25 AM
Display logs instead of TTY? tweakmyknob Linux - Server 2 01-17-2008 06:36 PM
iptables logs still shows up in dmesg BlueKnight Linux - Networking 10 09-09-2004 04:23 AM
Coloring real-time logs on tty d1s4st3r Linux - Newbie 4 09-03-2004 05:40 PM
boot message and dmesg and logs aus9 Slackware 4 01-28-2004 01:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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