Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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'm (still) trying to build an iptables firewall, but this time, I'm stuck trying to log dropped packets. Here is how I'm doing this (this code is inserted after the ACCEPT rules; $IPT represents the absolute path to iptables, here /sbin/iptables):

$IPT -A LOGDROP -j LOG -m limit --limit 5/min -j LOG --log-level debug --log-prefix "iptables rejected: "

When I try to execute this code, iptables rejects it, saying :

iptables v1.4.8: multiple -j flags not allowed
Try `iptables -h' or 'iptables --help' for more information.

And yet, I saw everywhere on the web that this is the way to apply two actions on selected packets, so why is my iptables version in such a bad mood?

share|improve this question
Thanks for corrections, Ladadadada. – Penegal Mar 8 '12 at 13:43
up vote 3 down vote accepted

You have specified -j LOG twice in this line:

$IPT -A LOGDROP -j LOG -m limit --limit 5/min -j LOG --log-level debug --log-prefix "iptables rejected: "
share|improve this answer
Aw f*ck... Please excuse my stupidity. – Penegal Mar 8 '12 at 13:46

Your Answer


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.