<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Vesa</id>
	<title>OpenVZ Virtuozzo Containers Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Vesa"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Vesa"/>
	<updated>2026-06-13T17:48:50Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Talk:UBC_secondary_parameters&amp;diff=3112</id>
		<title>Talk:UBC secondary parameters</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Talk:UBC_secondary_parameters&amp;diff=3112"/>
		<updated>2007-05-25T20:59:58Z</updated>

		<summary type="html">&lt;p&gt;Vesa: Removing all content from page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vesa</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Talk:UBC_secondary_parameters&amp;diff=3111</id>
		<title>Talk:UBC secondary parameters</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Talk:UBC_secondary_parameters&amp;diff=3111"/>
		<updated>2007-05-25T20:25:51Z</updated>

		<summary type="html">&lt;p&gt;Vesa: New page: How much memory is one page?  It would be nice, if it was explained here... Some of the limis are on &amp;quot;pages&amp;quot;, and it is hard to know what does it's change affect...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How much memory is one page?&lt;br /&gt;
&lt;br /&gt;
It would be nice, if it was explained here... Some of the limis are on &amp;quot;pages&amp;quot;, and it is hard to know what does it's change affect...&lt;/div&gt;</summary>
		<author><name>Vesa</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Talk:Using_NAT_for_container_with_private_IPs&amp;diff=3107</id>
		<title>Talk:Using NAT for container with private IPs</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Talk:Using_NAT_for_container_with_private_IPs&amp;diff=3107"/>
		<updated>2007-05-22T20:44:32Z</updated>

		<summary type="html">&lt;p&gt;Vesa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I was stumbling a lot with the configuration where allowing access to a service from outside, because I assumed that after adding the iptables DNAT rule, I could test the rule from the hardware node. The rule only works for packets send from outside.&lt;br /&gt;
&lt;br /&gt;
I added some text about it now, but maybe someone could rephrase it more nicely.&lt;/div&gt;</summary>
		<author><name>Vesa</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Using_NAT_for_container_with_private_IPs&amp;diff=3106</id>
		<title>Using NAT for container with private IPs</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Using_NAT_for_container_with_private_IPs&amp;diff=3106"/>
		<updated>2007-05-22T20:42:20Z</updated>

		<summary type="html">&lt;p&gt;Vesa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Usually you supply public IP addresses to your VEs. Sometimes you don't want to do it (lack of IPs, etc.). This article describes how to use private IP addresses for VEs.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== IP forwarding ===&lt;br /&gt;
IP forwarding should be turned on on hardware node in order for VE networking to work. Make sure it is turned on:&lt;br /&gt;
&lt;br /&gt;
 $ cat /proc/sys/net/ipv4/ip_forward &lt;br /&gt;
 1&lt;br /&gt;
&lt;br /&gt;
Output should be '1'. If it is '0', enable IP forwarding as it is described in [[Quick installation#sysctl]].&lt;br /&gt;
&lt;br /&gt;
=== IP conntracks ===&lt;br /&gt;
IP connection tracking should be enabled for VE0.&lt;br /&gt;
&lt;br /&gt;
'''For OpenVZ kernels 2.6.8''', put the following line into /etc/modprobe.conf:&lt;br /&gt;
&lt;br /&gt;
 modprobe ip_conntrack ip_conntrack_enable_ve0=1&lt;br /&gt;
&lt;br /&gt;
and reboot.&lt;br /&gt;
&lt;br /&gt;
'''For OpenVZ kernels later than 2.6.8''', connection tracking for VE0 is enabled by default. '''However''', make sure there is '''no''' line like&lt;br /&gt;
&lt;br /&gt;
 options ip_conntrack ip_conntrack_disable_ve0=1&lt;br /&gt;
&lt;br /&gt;
in /etc/modules.conf or /etc/modprobe.conf. If there is such line, comment it out (or remove) and reboot.&lt;br /&gt;
&lt;br /&gt;
== How to provide access for VE to Internet ==&lt;br /&gt;
&lt;br /&gt;
To enable the [[VE]]s, which have only internal IP addresses, to access the Internet, SNAT (Source Network Address Translation, also known as IP masquerading) should be configured on the [[Hardware Node]]. This is ensured by the standard Linux &amp;lt;tt&amp;gt;iptables&amp;lt;/tt&amp;gt; utility. To perform a simple SNAT setup, execute the following command on the [[Hardware Node]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# iptables -t nat -A POSTROUTING -s src_net -o eth0 -j SNAT --to ip_address&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;src_net&amp;lt;/tt&amp;gt; is a range of IP addresses of VEs to be translated by SNAT, and &amp;lt;tt&amp;gt;ip_address&amp;lt;/tt&amp;gt; is the external IP address of your [[Hardware Node]]. Multiple rules are allowed, for example, in case you wish to specify several ranges of IP addresses. If you are using a number of physical network interfaces on the [[Hardware Node|Node]], you may need to specify a different interface for outgoing connections, e.g. &amp;lt;tt&amp;gt;-o eth2&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To make all IP addresses to be translated by SNAT (not only the ones of [[VE]]s with private addresses), you should type the following string:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to ip_address&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If the above is not working then check if one of the following solutions does the trick.}}&lt;br /&gt;
1. If you are using stable (currently 2.6.8-based) kernel, then to enable SNAT for the VEs on your local network you need to explicitly enable connection tracking in [[VE0]]. Make sure that the following string is present in the &amp;lt;tt&amp;gt;/etc/modprobe.conf&amp;lt;/tt&amp;gt; file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
options ip_conntrack ip_conntrack_enable_ve0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|in kernels later than 2.6.8, connection tracking is enabled by default}}&lt;br /&gt;
&lt;br /&gt;
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 [[VE0]] is enabled by default in those kernels.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe ip_conntrack ip_conntrack_enable_ve0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Make sure that this module is loaded before any of the other iptables-modules are loaded! Also remember that if this module is loaded without the option, unloading and reloading doesn't work! You need to reboot the computer.&lt;br /&gt;
&lt;br /&gt;
{{Note|in kernels later than 2.6.8, connection tracking is enabled by default}}&lt;br /&gt;
&lt;br /&gt;
== How to provide access from Internet to a VE ==&lt;br /&gt;
&lt;br /&gt;
In addition, to make some services in VE with private IP address be accessible from the Internet, DNAT (Destination Network Address Translation) should be configured on the [[Hardware Node]]. To perform a simple DNAT setup, execute the following command on the [[Hardware Node]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# iptables -t nat -A PREROUTING -p tcp -d ip_address --dport port_num \&lt;br /&gt;
  -i eth0 -j DNAT --to-destination ve_address:dst_port_num &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;ve_address&amp;lt;/tt&amp;gt; is an IP address of the VE, &amp;lt;tt&amp;gt;dst_port_num&amp;lt;/tt&amp;gt; is a tcp port which requires service use, &amp;lt;tt&amp;gt;ip_address&amp;lt;/tt&amp;gt; is the external (public) IP address of your [[Hardware Node]], and &amp;lt;tt&amp;gt;port_num&amp;lt;/tt&amp;gt; is a tcp port of [[Hardware Node]], which will be used for Internet connections to private VE service. Note that this setup makes the service which is using &amp;lt;tt&amp;gt;port_num&amp;lt;/tt&amp;gt; on the [[Hardware Node]] be unaccessible from the Internet. Also note that SNAT translation is required too.&lt;br /&gt;
&lt;br /&gt;
For example, if you need a web server in a VE to be accessible from outside and, at the same time, keep a web server on the [[Hardware Node]] be accessible, use the following config:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# iptables -t nat -A PREROUTING -p tcp -d ip_address --dport 8080 \&lt;br /&gt;
  -i eth0 -j DNAT --to-destination ve_address:80&lt;br /&gt;
# iptables -t nat -A POSTROUTING -s ve_address -o eth0 -j SNAT --to ip_address&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After applying this, you'll see VE' web server at &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://ip_address:8080/&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please note that the above service will only be available from packets that are send *outside* of the host.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;iptables&amp;lt;/tt&amp;gt; utility allows to set up more complex rules for Network Address Translation, involving various protocols and ports. If you wish to get more information on this, consult the numerous Internet sites (e.g. [http://www.netfilter.org netfilter.org]) and tutorials devoted to this issue.&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
* [http://www.netfilter.org netfilter.org]&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Networking]]&lt;/div&gt;</summary>
		<author><name>Vesa</name></author>
		
	</entry>
</feed>