[SOLVED] IPTABLES Error when attempting to add a forward

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Locked
Gordon
OpenVpn Newbie
Posts: 2
Joined: Sat Jun 11, 2011 6:45 am

[SOLVED] IPTABLES Error when attempting to add a forward

Post by Gordon » Sat Jun 11, 2011 6:52 am

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

User avatar
Bebop
Forum Team
Posts: 301
Joined: Wed Dec 15, 2010 9:24 pm

Re: IPTABLES Error when attempting to add a forward

Post by Bebop » Sat Jun 11, 2011 9:10 am

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
The cure for boredom is curiosity

Gordon
OpenVpn Newbie
Posts: 2
Joined: Sat Jun 11, 2011 6:45 am

Re: IPTABLES Error when attempting to add a forward

Post by Gordon » Sun Jun 12, 2011 6:41 am

Thank you Bebop that was exactly the error

Locked