Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Using NAT for container with private IPs

No change in size, 11:45, 11 March 2008
m
Robot: Automated text replacement (-VE0 +CT0)
=== IP conntracks ===
IP connection tracking should be enabled for VE0CT0.
'''For OpenVZ kernels 2.6.8''', put the following line into /etc/modprobe.conf:
and reboot.
'''For OpenVZ kernels later than 2.6.8''', connection tracking for VE0 CT0 is enabled by default. '''However''', make sure there is '''no''' line like
options ip_conntrack ip_conntrack_disable_ve0=1
{{Note|If the above is not working then check if one of the following solutions does the trick.}}
1. If you are using stable (currently 2.6.8-based) kernel, then to enable SNAT for the containers on your local network you need to explicitly enable connection tracking in [[VE0CT0]]. Make sure that the following string is present in the <tt>/etc/modprobe.conf</tt> file:
<pre>
options ip_conntrack ip_conntrack_enable_ve0=1
{{Note|in kernels later than 2.6.8, connection tracking is enabled by default}}
In case it is not, add this string to the file by means of any text editor (for example, vi). This setting is not needed for kernels more recent than 2.6.8, since connection tracking for [[VE0CT0]] is enabled by default in those kernels.
2. For unknown reasons the above didn't work on a Debian host. The solution is to do it in an init.d script as follows:
2,253
edits