Debian This forum is for the discussion of Debian Linux.
|
| 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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
06-20-2004, 11:20 PM
|
#1
|
|
LQ Newbie
Registered: Jun 2004
Distribution: Debian Testing
Posts: 13
Rep:
|
Logging Deny/Reject packets
I am using Shorewall for my firewall. As it sits it is logging Accept packets fine to /var/log/messages. Does anyone have any info on how to log Deny/Reject packets to /var/log/messages as well?
|
|
|
|
06-21-2004, 08:09 AM
|
#2
|
|
Senior Member
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458
Rep:
|
Add a LOG rule the same as the DROP rule just before each DROP rule,eg
iptables -A FORWARD -i eth1 -p tcp --dport 22 -s ! 80.80.80.81 -j LOG --log-prefix "ssh_drop "
iptables -A FORWARD -i eth1 -p tcp --dport 22 -s ! 80.80.80.81 -j DROP
If you have a DROP policy, add a simple -j LOG rule as the last rule in those chains, eg
iptables -A INPUT -j LOG --log=prefix "policy_drop "
In Shorewall, make a duplicate of the DROP rule, change it to LOG and insert it before the DROP rule,
|
|
|
|
06-21-2004, 08:39 AM
|
#3
|
|
LQ Newbie
Registered: Jun 2004
Distribution: Debian Testing
Posts: 13
Original Poster
Rep:
|
Thanks. I was thinking about doing that but figured there was a way to accomplish that the same as the Accept packets (I didn't have to add the log Accept, it did that automatically). I will give it a try tonight. Thanks again.
|
|
|
|
06-21-2004, 10:15 PM
|
#4
|
|
LQ Newbie
Registered: Jun 2004
Distribution: Debian Testing
Posts: 13
Original Poster
Rep:
|
Peter,
Your post pointed me in the right direction.
Under /etc/shorewall/rules to log packets for any rule you add the syslog level after the "action" for a rule.
Example:
DROP:info loc net tcp - 135,137:139,445 - - -
DROP:info loc net udp - 135,137:139,445,593 - - -
Drop the packet and log to syslog at the info level. I think there are 6 different levels depending on what kind of infformation you want.
Thanks again.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 04:19 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
|
|