Skip to contentSkip to conversation

Error when adding an entry to mangle/PREROUTING

DISCUSSION Ralf 2 participants 3 messages Feb 9, 2009 – Feb 10, 2009

lore
Share & tools
lore

Ralf

author
#0 lore raw

The following command brings an error ("iptables: Invalid argument"):

  $IPTABLES -t mangle -A PREROUTING -p tcp --dport 9999 -j REJECT

What's wrong here?

#1 lore raw

Quoting from man iptables: " This target is only valid in the INPUT, FORWARD and OUTPUT chains"

Since the validation is done by the kernel module, you don't see the error message directly, but rather via syslog; e.g. in my case, in /var/log/messages you see " kernel: ip_tables: REJECT target: only valid in filter table, not mangle"

Quoted 17 lines

-----Original Message-----
From: [email protected] [mailto:netfilter- [email protected]] On Behalf Of Ralf
Sent: Monday, February 09, 2009 12:08 PM
To: [email protected]
Subject: Error when adding an entry to mangle/PREROUTING

The following command brings an error ("iptables: Invalid argument"):

   $IPTABLES -t mangle -A PREROUTING -p tcp --dport 9999 -j REJECT

What's wrong here?

--
To unsubscribe from this list: send the line "unsubscribe netfilter" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#2 lore raw
Quoted 7 lines · Gilad Benjamini

Quoting from man iptables: " This target is only valid in the INPUT, FORWARD and OUTPUT chains"

Since the validation is done by the kernel module, you don't see the error message directly, but rather via syslog; e.g. in my case, in /var/log/messages you see " kernel: ip_tables: REJECT target: only valid in filter table, not mangle"

DROP works, but REJECT does not work.
Maybe it is a bug/oversight, because IMHO I don't see any reason why REJECT shouldn't be allowed here.

Quoted 12 lines
Quoted 12 lines

-----Original Message-----
From: [email protected] [mailto:netfilter- [email protected]] On Behalf Of Ralf
Sent: Monday, February 09, 2009 12:08 PM
To: [email protected]
Subject: Error when adding an entry to mangle/PREROUTING

The following command brings an error ("iptables: Invalid argument"):

   $IPTABLES -t mangle -A PREROUTING -p tcp --dport 9999 -j REJECT

What's wrong here?