Is IP Masquerade available for OpenVZ? Çap et

  • 1

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.

Bu cavab sizə kömək etdi?

<< Geri

Powered by WHMCompleteSolution