Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
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.
|
 |
02-01-2001, 01:08 AM
|
#1
|
Member
Registered: Dec 2000
Location: South Australia
Distribution: RedHat 7.2
Posts: 55
Rep:
|
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
|
|
|
02-06-2001, 05:38 PM
|
#2
|
Member
Registered: Feb 2001
Posts: 84
Rep:
|
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.
|
|
|
02-25-2001, 09:50 PM
|
#3
|
Member
Registered: Feb 2001
Posts: 69
Rep:
|
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
|
|
|
02-28-2001, 10:00 AM
|
#4
|
Member
Registered: Feb 2001
Posts: 84
Rep:
|
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.
|
|
|
02-28-2001, 04:48 PM
|
#5
|
Member
Registered: Feb 2001
Posts: 69
Rep:
|
I can dig it. Thanks man.
|
|
|
03-01-2001, 10:10 PM
|
#6
|
LQ Newbie
Registered: Sep 2000
Location: austin, tx
Posts: 14
Rep:
|
what about ipchains-save > /path/to/file , you can also restore by typing ipchains-restore > /path/from/file
|
|
|
04-01-2001, 08:58 PM
|
#7
|
Member
Registered: Mar 2001
Posts: 40
Rep:
|
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
|
|
|
04-02-2001, 12:54 AM
|
#8
|
Member
Registered: Mar 2001
Posts: 40
Rep:
|
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
|
|
|
04-02-2001, 04:25 AM
|
#9
|
Member
Registered: Dec 2000
Location: South Australia
Distribution: RedHat 7.2
Posts: 55
Original Poster
Rep:
|
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
|
|
|
04-02-2001, 11:07 AM
|
#10
|
Member
Registered: Mar 2001
Posts: 40
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 09:08 PM.
|
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
|
|