0

I want to have UDP load balancer, which seems to achieved from iptables from this post

I run this command which resulted in error as shown below.

iptables -t nat -A PREROUTING -p udp -i em1 --dport 9998 --mode nth --every 2 --packet 0 -j DNAT --to-destination xx.xx.xx.xx:9998

Output :

iptables v1.4.21: unknown option "--mode"

I have also installed the ipset package,

yum install ipset

How to install the iptables-module which has --mode option ?, from the man pages, seems like i need to install statistic module but could not find out the tar/rpm file.

0

The syntax is incorrect. Except for "protocol" modules (tcp, udp, icmp...) you have to explicitely state the module to which belongs the option. So after a look at "man iptables-extensions" --mode nth is indeed described under the statistic module. That means you just have to add -m statistic before its options.

try:

iptables -t nat -A PREROUTING -p udp -i em1 --dport 9998 -m statistic --mode nth --every 2 --packet 0 -j DNAT --to-destination xx.xx.xx.xx:9998
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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