LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-01-2001, 01:08 AM   #1
Wazza
Member
 
Registered: Dec 2000
Location: South Australia
Distribution: RedHat 7.2
Posts: 55

Rep: Reputation: 15

Hello
Is there a way to get ipchains to log to a seperate file?
At the moment it is logging into /var/log/messages, but I would like it done in a file just for ipchains.
Thank you

Wazza
 
Old 02-06-2001, 05:38 PM   #2
devnull
Member
 
Registered: Feb 2001
Posts: 84

Rep: Reputation: 15
Are you familiar with grep, awk, sed, tr and so on?
If not, you might have a look at a logchecker like logcheck ;-)
http://www.psionic.com/
And if you are there, you might also take a look at portsentry.
 
Old 02-25-2001, 09:50 PM   #3
mjakob
Member
 
Registered: Feb 2001
Posts: 69

Rep: Reputation: 15
Ok grep is good enough, but I'm also wondering if anyone has come up with a way to do this. It would be a nice feature since I always take a quick look a /var/log and seeing a file called ipchains with a positive file size would be a quick tip off that someone is trying something...

-Mark
 
Old 02-28-2001, 10:00 AM   #4
devnull
Member
 
Registered: Feb 2001
Posts: 84

Rep: Reputation: 15
Why do you want to put it in a file? Okay i still prefer the "logchecker" software but you can do it also with a little script.
My firewall logs everything (scans, stealth-scans, connection-attempts etc.) to the /var/log/messages file.

So i would write a little script, that also includes a line like this:
cat messages | grep -i "Packet log:" | awk '{print $12}'

In my case this would give me the ip-address of a poosible intruder. You should finetune this with "sed".

Create a cronjob and wait for mail that will inform you on what's going on!

I hope this might help you.
 
Old 02-28-2001, 04:48 PM   #5
mjakob
Member
 
Registered: Feb 2001
Posts: 69

Rep: Reputation: 15
I can dig it. Thanks man.
 
Old 03-01-2001, 10:10 PM   #6
ltd
LQ Newbie
 
Registered: Sep 2000
Location: austin, tx
Posts: 14

Rep: Reputation: 0
what about ipchains-save > /path/to/file , you can also restore by typing ipchains-restore > /path/from/file
 
Old 04-01-2001, 08:58 PM   #7
aimstr8
Member
 
Registered: Mar 2001
Posts: 40

Rep: Reputation: 15
Can't Get ipchains to log


Hi,

Pretty new to Linux, I?m using RH 6.2. I need some help on getting ipchains to log.

My /etc/syslog.conf is as follows:

kern.* /var/log/kern.log
*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none /var/log/messages

I set a rule and it works, but I can not get it to log?anywhere that I can tell. Only thing it does log is when I flush out the polices:

Apr 1 17:53:08 dsl081 ipchains: Flushing all chains: succeeded
Apr 1 17:53:08 dsl081 ipchains: Removing user defined chains: succeeded
Apr 1 17:53:08 dsl081 ipchains: Resetting built-in chains to the default ACCEPT policy succeeded

I have been playing around with an icmp (ping) rule and it works fine?just wont log

root /sbin/ipchains -l -A input -p icmp --icmp-type echo-request -s 0/0 -d 64.31.56.245 -j ACCEPT

Any help would be greatly appreciated!

-Ward

 
Old 04-02-2001, 12:54 AM   #8
aimstr8
Member
 
Registered: Mar 2001
Posts: 40

Rep: Reputation: 15
Can't Get ipchains to log


Hi,

Pretty new to Linux, I?m using RH 6.2. I need some help on getting ipchains to log.

My /etc/syslog.conf is as follows:

kern.* /var/log/kern.log
*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none /var/log/messages

I set a rule and it works, but I can not get it to log?anywhere that I can tell. Only thing it does log is when I flush out the polices:

Apr 1 17:53:08 dsl081 ipchains: Flushing all chains: succeeded
Apr 1 17:53:08 dsl081 ipchains: Removing user defined chains: succeeded
Apr 1 17:53:08 dsl081 ipchains: Resetting built-in chains to the default ACCEPT policy succeeded

I have been playing around with an icmp (ping) rule and it works fine?just wont log

root /sbin/ipchains -l -A input -p icmp --icmp-type echo-request -s 0/0 -d 64.31.56.245 -j ACCEPT

Any help would be greatly appreciated!

-Ward

 
Old 04-02-2001, 04:25 AM   #9
Wazza
Member
 
Registered: Dec 2000
Location: South Australia
Distribution: RedHat 7.2
Posts: 55

Original Poster
Rep: Reputation: 15
Hi there.
I might be wrong, but if any input rules are Appended, should they be listed after the -A option??

mine is written:

/sbin/ipchains -A input -l -J DENY -p icmp -s 0/0 echo-request -i ppp0

Might be nothing in it, some one in here will know the answer I'm sure.

Wazza
 
Old 04-02-2001, 11:07 AM   #10
aimstr8
Member
 
Registered: Mar 2001
Posts: 40

Rep: Reputation: 15
Hi Wazza,

Thanks. I tried that with no difference. However, I have since discovered that by starting klogd with the ?s option, it forces the system call interface as its messaging source. Now it works.

I found some pretty good info and a sh script on ipchains at
http://dsl081-050-241.sfo1.dsl.speak...s-script.shtml

Thanks for the rely!

-Ward

Last edited by aimstr8; 08-24-2001 at 11:42 AM.
 
  


Reply


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
Deleted /var/log/messages, can't log any files-iptables chingyenccy Linux - Newbie 7 02-27-2005 04:03 PM
ipchains log and samba query RichardBuck Linux - Networking 0 12-22-2004 07:16 PM
Strange results in /var/log/apache/access.log subt13 Linux - Security 2 08-03-2004 01:21 PM
pppd logging to /var/log/ppp.log problem mrtwice Linux - Software 1 01-10-2004 05:38 PM
iptables, changing log file from /var/log/messages acid2000 Linux - Networking 3 03-11-2003 08:38 PM

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

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