Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have these rules:

-A INPUT -m limit --limit 2/min -j LOG --log-prefix "IPTables Packet Dropped: " --log-level 7
-A INPUT -j DROP

But this logs every DROP that occurs like IPTables Packet Dropped: IN=eth0 OUT= MAC=XXXXXXXX SRC=192.168.100.11 DST=192.168.100.255.

I want to log only when DST is 192.168.100.19.

share|improve this question
    
What have you tried so far? – MadHatter Nov 24 '15 at 15:05
    
@MadHatter i tried what i have above (on question). – Christopher Nov 24 '15 at 15:08
up vote 1 down vote accepted

You need to insert a rule for the IP you want to log before the catch all rule you have.

iptables -A INPUT -d 192.168.100.19 -m limit --limit 2/min -j LOG --log-prefix "IPTables Packet Dropped: " --log-level 7
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.