OpenVZ VPS

TUN/TAP ( VPN Module ) on openVZ VPS

openVZ supports Tun/TAP in a container through kernel TUN/TAP module. In order to allow for e.g. #9, following is the procedure :

Please make sure you have tun module already on the main hardware node :

================
lsmod | grep tun
================

In case it is not there, you may command the following :

============
modprobe tun
============

Or rather you may also add it to /etc/modules.conf in order to load next time you reboot.

Therefter, in order to allow Access to TUN/TAP :

vzctl set 9 –devices c:10:200:rw –save
vzctl set 9 –capability net_admin:on –save

Then, you may create a character device file within the container :

========================================
vzctl exec 9 mkdir -p /dev/net
vzctl exec 9 mknod /dev/net/tun c 10 200
vzctl exec 9 chmod 600 /dev/net/tun
========================================

You have now enabled TUN/TAP on your VPS Hosting package.

Tags: , , ,