Page 1 of 1

[SOLVED] IPTABLES Error when attempting to add a forward

Posted: Sat Jun 11, 2011 6:52 am
by Gordon
Sorry if this is a common error, and already been answered.

In Centos 5 OpenVPN on a VPS when I try to alter the IPChains with the command

"iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o venet0 -j MASQUERADE"

it gives me a general error
"iptables: Unknown error 4294967295"

Looking at the iptables command list (in iptables -h) seems to show the above command should work, but I do not have enough skill to know exactly what is not working.

I hope one of the experts can help me.

Thanks and Regards

Re: IPTABLES Error when attempting to add a forward

Posted: Sat Jun 11, 2011 9:10 am
by Bebop
Gordon wrote: "iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o venet0 -j MASQUERADE"
Ignoring your error code for a second, it seems your code is mixed. What do I mean by 'mixed'? Well, a VPS comes in two flavours XEN and OpenVZ.

The venet0 interface is usually associated with an OpenVZ VPS.
The MASQUERADE command is usually associated with XEN.

Since you use both venet0 and MASQUERADE, I hypothesize that your code wont work with either XEN or OpenVZ VPS, with the excpetion being that you have a XEN VPS with a venet0 interface. That exception is not likely tho in my opinion.

Possible to confirm if you are OpenVZ or XEN?

If not, try OpenVZ first, its the cheapest and most common VPS around.

When you are ready, you can see the correct code for either OpenVZ or XEN

here: topic7722.html

XEN

Code: Select all

iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
OpenVZ

Code: Select all

iptables -t nat -A POSTROUTING -o venet0 -j SNAT --to-source 100.200.255.256   #Use your OpenVPN server's real external IP here

Re: IPTABLES Error when attempting to add a forward

Posted: Sun Jun 12, 2011 6:41 am
by Gordon
Thank you Bebop that was exactly the error