运行以下命令之后:
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
我得到以下错误:
iptables: No chain/target/match by that name.
我正在运行这个命令来改变ips传出smtp连接postfix.This“173.224.222.45”是一个公共ip.I做这个testing目的的设置,所以不要责怪我的垃圾邮件。 我的系统是centos5 32位邮件服务器与后缀作为MTA。 你可以看一篇文章,我学会了这样做http://www.kutukupret.com/2009/11/30/postfix-smtp-outgoing-ip-rotator-using-iptables 。 请帮我解决这个问题。
这听起来像xt_statistic模块没有启用/加载到正在运行的内核。 检查:
$ grep -i statistic /boot/config-$(uname -r)
如果结果是# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set ,那么重新编译你的内核来启用它:
[*] Networking support ---> Networking options ---> [*] Network packet filtering framework (Netfilter) ---> Core Netfilter Configuration ---> <*> "statistic" match support
如果你得到CONFIG_NETFILTER_XT_MATCH_STATISTIC=m ,运行以下命令将其加载到内核中:
# modprobe xt_statistic