iptables syntax error

May 20, 2006 2 Replies

downloaded the iptables v1.2.11 and have got the directory structure in which I have the iptables binary in the source code .I then copy the



binary iptables to another file system and so ./iptables -L .I get the output.But when I do SNAT i get the following :- $./iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to 10.0.0.1 iptables v1.2.11: Unknown arg `--to' Try `iptables -h' or 'iptables --help' for more information.



Please help me out .The directory also has binaries iptables-save and iptables-restore .Do I need to copy them too?


I have even tried giving --to-source instead of --to. Does iptables doesnt have support for SNAT ? i did iptables -h and couldnt find any --to or SNAT mention. What might be the problem?



Rather odd output. :)

First ensure that you have IP forwarding enabled:

echo "1" > /proc/sys/net/ipv4/ip_forward

Is your eth0 interface static or dynamic? Use snat for static, use masquerade for dynamic ip assignments.

HTH. Thomas

In article , jeniffer wrote: : downloaded the iptables v1.2.11 and have got the directory structure :in which I have the iptables binary in the source code .I then copy the : :binary iptables to another file system and so ./iptables -L .I get the :output.But when I do SNAT i get the following :- :$./iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to 10.0.0.1 : iptables v1.2.11: Unknown arg `--to' : Try `iptables -h' or 'iptables --help' for more information. : :Please help me out .The directory also has binaries iptables-save and :iptables-restore .Do I need to copy them too?

I think you'll find that 'make install' installs a lot more than just the iptables binary. You're missing the whole /lib/iptables tree, which is where libipt_SNAT.so normally resides.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required