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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-05-2009, 05:42 AM
|
#1
|
Member
Registered: Dec 2005
Posts: 75
Rep:
|
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.
|
|
|
03-05-2009, 05:59 PM
|
#2
|
Moderator
Registered: May 2001
Posts: 29,415
|
Quote:
Originally Posted by alok.rhct
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.
|
|
|
04-02-2009, 01:35 AM
|
#3
|
Member
Registered: Dec 2005
Posts: 75
Original Poster
Rep:
|
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
|
|
|
04-02-2009, 02:16 AM
|
#4
|
Moderator
Registered: May 2001
Posts: 29,415
|
Please post what you tried (actual commands) and contents of syslog.conf?
|
|
|
04-02-2009, 04:37 AM
|
#5
|
Member
Registered: Dec 2005
Posts: 75
Original Poster
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 04:43 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|