LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 12-11-2003, 10:55 AM   #1
sergio3986
LQ Newbie
 
Registered: Dec 2003
Posts: 7

Rep: Reputation: 0
Need help with LOG entry in IPTABLES


Well I have the following log rule:

iptables -A INPUT -m limit --limit 3/second --limit-burst 5 -i ! lo -j LOG --log-level 6 --log-prefix "FW_INPUT_DROPPED "

But how can I also have it not log ICMP ? Or better yet how can I have more than one thing set to not log? Thanks in advance
 
Old 12-11-2003, 04:51 PM   #2
mrhyde
Member
 
Registered: Jul 2003
Location: Europe
Posts: 198

Rep: Reputation: 30
iptables -t mangle -I PREROUTING -s 0/0 -p 1 -j ACCEPT
iptables -t nat -I PREROUTING -s 0/0 -p 1 -j ACCEPT
iptables -t filter -I INPUT -s 0/0 -p 1 -j ACCEPT

this will allow ICMP (ping or traceroutes) into you machine from any ip address.
protocols are in "/etc/protocols" and "man iptables" for iptables commands.
 
Old 12-11-2003, 05:13 PM   #3
sergio3986
LQ Newbie
 
Registered: Dec 2003
Posts: 7

Original Poster
Rep: Reputation: 0
My question was can you exclude more than one thing in a log entry. My log entry says to log all except for "lo" I want to know if I can add icmp or an ip or another service to this log rule. Or can you only specify one thing to exempt frm per iptable rule.
 
Old 12-11-2003, 05:45 PM   #4
Dewar
Member
 
Registered: Sep 2003
Location: Washington State
Distribution: SuSE 8.0, SuSE 9.0, Slack 9.1
Posts: 90

Rep: Reputation: 15
I think you can only exclude one thing of each type, but I'm not sure.

(i.e. you can exclude lo or eth0 but not both at the same time. You can also exclude lo and icmp both, since they aren't on the option)

That being said, adding "-p ! icmp" will exclude icmp packets.

-Derek
 
Old 12-12-2003, 02:26 PM   #5
mrhyde
Member
 
Registered: Jul 2003
Location: Europe
Posts: 198

Rep: Reputation: 30
why are you logging "-i lo" ? what type of info do you want to capture?
 
Old 12-12-2003, 02:59 PM   #6
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
I'm assuming you have a DROP rule after that -j LOG rule...
and you are ACCEPTing specific packets before the drop..

Better to use the chain structure to isolate the protocol..eg

Everything I want to log gets -j jumped to the logging chain..
then those that you don't want logged get -j RETURNed back to the INPUT chain before they can hit the -j LOG rule
The packets you want logged hit the -j LOG rule,
then they return to the INPUT chain automatically
And the final rule DROPs them.. eg

iptables -A INPUT -i ! lo -j logger
iptables -A logger -p icmp -j RETURN
iptables -A logger -p 47 -j RETURN
iptables -A logger -m limit --limit 3/second --limit-burst 5 -i ! lo -j LOG --log-level 6 --log-prefix "FW_INPUT_DROPPED "
.. some ACCEPT rules ...
INPUT DROP POLICY.
 
  


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
Log entry: can someone explain this? future assassin Slackware 3 11-22-2005 02:46 AM
suspicious entry in /var/log/auth.log buehler Linux - Security 5 04-27-2005 05:11 PM
giFTcurs log entry lapthorn Linux - Software 1 12-05-2003 07:44 AM
Help deciphering this log entry Scruff Linux - Security 6 11-24-2003 07:15 PM
iptables log entry??? bulliver Linux - Security 2 02-15-2003 10:54 PM

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

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