<?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=Alex7xl</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=Alex7xl"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Alex7xl"/>
	<updated>2026-04-30T02:55:53Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=VPN_via_the_TUN/TAP_device&amp;diff=5341</id>
		<title>VPN via the TUN/TAP device</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=VPN_via_the_TUN/TAP_device&amp;diff=5341"/>
		<updated>2008-03-26T19:48:02Z</updated>

		<summary type="html">&lt;p&gt;Alex7xl: /* External links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article describes how to use VPN via the TUN/TAP device inside a [[container]].&lt;br /&gt;
&lt;br /&gt;
== Kernel TUN/TAP support ==&lt;br /&gt;
OpenVZ supports VPN inside a container via kernel TUN/TAP module and device.&lt;br /&gt;
To allow container #101 to use the TUN/TAP device the following should be done:&lt;br /&gt;
&lt;br /&gt;
Make sure the '''tun''' module has been already loaded on the [[hardware node]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lsmod | grep tun&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it is not there, use the following command to load '''tun''' module:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# modprobe tun&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also add it into /etc/modules.conf to make sure it will be loaded on every reboot automatically.&lt;br /&gt;
&lt;br /&gt;
== Granting container an access to TUN/TAP ==&lt;br /&gt;
Allow your container to use the tun/tap device:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 101 --devices c:10:200:rw --save&lt;br /&gt;
 vzctl set 101 --capability net_admin:on --save&lt;br /&gt;
&lt;br /&gt;
And create the character device file inside the container:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 101 mkdir -p /dev/net&lt;br /&gt;
 vzctl exec 101 mknod /dev/net/tun c 10 200&lt;br /&gt;
 vzctl exec 101 chmod 600 /dev/net/tun&lt;br /&gt;
&lt;br /&gt;
== Configuring VPN inside container ==&lt;br /&gt;
After the configuration steps above are done it is possible to use VPN software working with TUN/TAP inside&lt;br /&gt;
container just like on a usual standalone linux box.&lt;br /&gt;
&lt;br /&gt;
The following software can be used for VPN with TUN/TAP:&lt;br /&gt;
* Virtual TUNnel (http://vtun.sourceforge.net)&lt;br /&gt;
* OpenVPN (http://openvpn.sourceforge.net)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://vtun.sourceforge.net Virtual TUNnel]&lt;br /&gt;
* [http://openvpn.sourceforge.net OpenVPN]&lt;br /&gt;
* PPTP [http://vpnprivacy.com VPN service]&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Networking]]&lt;/div&gt;</summary>
		<author><name>Alex7xl</name></author>
		
	</entry>
</feed>