Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Been trying to run

iptables -t nat -A POSTROUTING -s -o venet0:0 -j MASQUERADE

and I keep getting the above error message. Trying to set up openvpn on my server.

Does anyone have any idea how to solve this?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

firstly, venet0:0 is not valid, just use venet0, iptables does not care about interface labels.

The error itself is down to the fact that either you do not have the nat table kernel module loaded or you do, but don't have MASQUERADE.

Since this is OpenVZ, you would need to ask your host to provide it.

share|improve this answer
ok, thanks :) found the solution here in case anyone needs it in future http://kyl191.net/2012/09/getting-openvpn-to-work-on-an-openvz-vps/ –  laurenceputra Jan 21 '13 at 13:01

It need nf_nat_masquerade_ipv4.ko and iptable_mangle.ko, enable CONFIG_NF_NAT_MASQUERADE_IPV4 and CONFIG_IP_NF_TARGET_MASQUERADE in .config to build this module.

share|improve this answer
Are you advising to compile a custom kernel on CentOS? –  Deer Hunter Apr 29 at 15:29
@DeerHunter maybe you can try build a module nf_nat_masquerade_ipv4.ko and iptable_mangle.ko –  netawater Apr 30 at 3:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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