LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-08-2003, 12:22 AM   #1
yocompia
Member
 
Registered: Apr 2003
Location: Chicago, IL
Distribution: openbsd 3.6, slackware 10.0
Posts: 244

Rep: Reputation: 30
Talking dmesg output full of


i have a problem with the output of dmesg, namely that it is full of logged packets like:

IPT INPUT packet died: IN=ppp0 OUT= MAC= SRC=199.111.227.177 DST=86.79.158.15 LEN=48 TOS=0x00 PREC=0
x00 TTL=115 ID=54145 DF PROTO=TCP SPT=4076 DPT=2751 WINDOW=16384 RES=0x00 SYN URGP=0

and i can't see the boot messages. what gives?

thx for reading,
y-p
 
Old 09-08-2003, 02:06 AM   #2
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 47
That's your iptables log... it will overlap your boot logs after some time of filtering because it uses the same log level by default (warn i think). I believe you can make iptables log to some other file by tinkering with its settings.

I'll take a look at it later because now I'm stuck in Windowsland (at work )... I too am planning to change my iptables log level... and hopefully I can help you out a bit
 
Old 09-08-2003, 10:32 AM   #3
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 47
Hmm... after searching and searching it seems impossible to log iptables somewhere else, therefore I'm going to suggest a workaround for you instead.

Add the following line to your /etc/rc.d/rc.local
Code:
cp /var/log/messages /var/log/bootlog
.

So when you want to view your bootup events, just type cat /var/log/bootlog.

I know this is oversimplistic, therefore I'm really open to suggestions from those who are more knowledgable in this area

Last edited by Azmeen; 09-08-2003 at 07:16 PM.
 
Old 09-08-2003, 12:00 PM   #4
NSKL
Senior Member
 
Registered: Jan 2002
Location: Rome, Italy ; Novi Sad, Srbija; Brisbane, Australia
Distribution: Ubuntu / ITOS2008
Posts: 1,207

Rep: Reputation: 47
Well, i'm not more knowledgable, and i might be totally wrong here BUT i beleive if you mess around with /etc/syslog.conf you could make the firewall log level something higher, and thus make it log to /var/log/secure for example. Note that i'm just guessing here from what i remember reading in "Running Linux". Unfortunately i gave that book over the summer to a friend, who doesn't want to give it back, thus i can't check how exactly to do this, if it all possible...
Reckon i'll have to buy myself the new edition anyway...
Well HTH a little
-NSKL
 
Old 09-08-2003, 12:36 PM   #5
yocompia
Member
 
Registered: Apr 2003
Location: Chicago, IL
Distribution: openbsd 3.6, slackware 10.0
Posts: 244

Original Poster
Rep: Reputation: 30
about that cp command you suggested i insert in rc.local: what is that doing? i know that there is output to /var/log/messages generated on boot, but the messages aren't the same as the ones that would be in dmesg (they're not as verbose and they don't list the device assignments for things like ide-scsi emulation).

i could've sworn that i read a post about this before, but i couldn't think of what to search for to bring it up...
 
Old 09-08-2003, 12:39 PM   #6
yocompia
Member
 
Registered: Apr 2003
Location: Chicago, IL
Distribution: openbsd 3.6, slackware 10.0
Posts: 244

Original Poster
Rep: Reputation: 30
i think you're right NSKL, as the log-level determines where the stuff gets logged. i think i'll just look at the syslogd manpage for a while and see what i can figure out.

btw, what does HTH mean?
 
Old 09-08-2003, 07:27 PM   #7
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 47
Quote:
Originally posted by yocompia
about that cp command you suggested i insert in rc.local: what is that doing? i know that there is output to /var/log/messages generated on boot, but the messages aren't the same as the ones that would be in dmesg (they're not as verbose and they don't list the device assignments for things like ide-scsi emulation).

i could've sworn that i read a post about this before, but i couldn't think of what to search for to bring it up...
OK, maybe a little more explanation is needed on my part. Basically I explored the /etc/rc.d/rc.* files a bit and saw that on bootup rc.local is the last file that will be ran by init.

And since dmesg is basically similar to running cat /var/log/messages (at least I think it is, please correct me if I'm wrong), I thought why not copy the startup log before it gets crowded by the firewall logs.

Quote:
Originally posted by NSKL
Well, i'm not more knowledgable, and i might be totally wrong here BUT i beleive if you mess around with /etc/syslog.conf you could make the firewall log level something higher, and thus make it log to /var/log/secure for example.
I read that in the man pages of syslog.conf as well, but the problem with that man page (in fact almost all of Linux's man), is that it is very stingy on explanations. Googling didn't help much as well. However it did say that the secure log is deprecated.

I would have preferred to log the iptables output to some other file, but I too, am stumped on how to this the right way
 
Old 09-08-2003, 10:12 PM   #8
eric.r.turner
Member
 
Registered: Aug 2003
Location: Planet Earth
Distribution: Linux Mint
Posts: 216

Rep: Reputation: 31
Do your firewall rules have a LOG target? They must since LOG "...[turns] on kernel logging of matching packets." Two options you might consider:

1. Remove the iptables rules that log messages.

2. Use the --log-prefix option in the iptables rules that log messages. If you prefix all your iptables messages with "foo" then you can filter those out of dmesg with "dmesg | grep -v foo". Just make sure you use something unique like "iptables_msg: " or something.
 
Old 09-08-2003, 10:34 PM   #9
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 47
eric,

But the problem is that over time the iptables log entries will completely replace the kernel messages. So even if you grep all iptables log entries away, the bootup entries won't be returned.

In my case I want the iptables log... however, if possible I want it to log to a different file rather than sharing it with /var/log/messages. Do you know how to do this?
 
Old 09-09-2003, 11:34 AM   #10
NSKL
Senior Member
 
Registered: Jan 2002
Location: Rome, Italy ; Novi Sad, Srbija; Brisbane, Australia
Distribution: Ubuntu / ITOS2008
Posts: 1,207

Rep: Reputation: 47
Again, remebering what i read in "Running Linux" you could (i think) do the following:
Change Ip tables log level in syslog.conf to something else, something not used, and exlude it from other logs (look at slack 9's syslog.conf and you'll see how some servises such as mail and cron are excluded from all logs and logged to their special files, only for them.
So make ip tables log to a special file as well. Something like Ip-tables.* /var/log/firewall. The problem here is that ip-tables is not a service like mail or cron, so i'm not really sure if you can do this. If i only had my book with me..... As soon as i get it back i'll read the syslog part again and i'm sure we'll find a solution...
HTH = Hope that Helps
-NSKL
 
Old 09-09-2003, 02:03 PM   #11
yocompia
Member
 
Registered: Apr 2003
Location: Chicago, IL
Distribution: openbsd 3.6, slackware 10.0
Posts: 244

Original Poster
Rep: Reputation: 30
NSKL, i think i've found confirmation and further articulation of what you suggested in this thread:

http://www.linuxquestions.org/questi...ht=kernel+size

the relevant portion on the syslog.conf format is about 50% down the first part of the post (i think that percentage is invariant...). it also has some nice stuff i used to strengthen my firewall.

i'll try this later today and post back with results, unless somebody else does first.

thx,
y-p
 
  


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
please translate my dmesg output for me... Adrian Baker Linux - Software 2 07-27-2005 03:26 PM
cannot understand some dmesg output ninadb Slackware 8 06-29-2005 04:49 PM
dmesg output cranium2004 Linux - Newbie 1 01-27-2005 02:03 AM
Weird Dmesg Output raid517 Linux - Hardware 2 09-22-2003 10:14 PM
dmesg output safrout Slackware 6 05-18-2003 11:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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