Is IP Masquerade available for OpenVZ?

NO. IP Masquerade is an option for dedicated servers, it is not available for openvz virtualization VPS.
Though, you may obtain similar results using SNAT.


Traditional way (Wrong for VPS):

iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -s 10.8.0.0/24 -j ACCEPT
iptables -A FORWARD -j REJECT
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE

Correct Way for OpenVZ VPS (using SNAT):

iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -s 10.8.0.0/24 -j ACCEPT
iptables -A FORWARD -j REJECT
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j SNAT --to-source


IMPORTANT NOTE: Where you have to replace  with your Public VPS IP given to you.
Also, replace 'eth0' to veth0 or venet0 (IF Required). As, Network Interface could be different in some cases.
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

What are the Features available in SolusVM Control Panel?

Firstly, After you login to your SolusVM Control Panel, you will see IF you VPS is Online...

Setup OpenVPN on CentOS VPS?

Preparations:Firstly, You have to contact your Support in order to Enable Tun/Tap for your OpenVZ...

Powered by WHMCompleteSolution