iptables error: No chain/target/match by that name?

After running following command:

iptables -t nat -I POSTROUTING -m state --state NEW -p tcp --dport 25 -o eth0 -m statistic --mode nth --every 5 -j SNAT --to-source 173.224.222.45

I get following error:

iptables: No chain/target/match by that name.

I am running this command to change ips for outgoing smtp connections for postfix.This "173.224.222.45" is a public ip.I am doing this setup for testing purpose so dont blame me for spamming. My system is centos5 32 bit using mail server with postfix as an MTA. You can look at an article from which i learnt to do this http://www.kutukupret.com/2009/11/30/postfix-smtp-outgoing-ip-rotator-using-iptables. Please help me out of this.


Solution 1:

It sounds like the xt_statistic module isn't enabled/loaded into the running kernel. Checking with:

$ grep -i statistic /boot/config-$(uname -r)

If the result is # CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set, then recompile your kernel to enable it:

[*] Networking support  --->
  Networking options  --->
    [*] Network packet filtering framework (Netfilter)  --->
      Core Netfilter Configuration  --->
        <*>   "statistic" match support

If you get CONFIG_NETFILTER_XT_MATCH_STATISTIC=m, load it into the kernel by running:

# modprobe xt_statistic