Tun Tap

Enable the Kernel TUN/TAP support

OpenVZ supports VPN inside a container via kernel TUN/TAP module and device. To allow container to use the TUN/TAP device the following should be done:

Make sure the tun module has been already loaded on the hardware node:

lsmod | grep tun 

If it is not there, use the following command to load tun module:

modprobe tun 

To make sure that tun module will be automatically loaded on every reboot you can also add it or into /etc/modules.conf (on RHEL see /etc/sysconfig/modules/ directory).

Enabling the TUN/TAP from the container using Virtualizor Admin panel

While creating or editing the VPS expand the Advance option menu by clicking on it as shown in the figure . Check the TUN/TAP check box .Then just create/edit the vps the tun tap module will be enabled for the container.

To check TUN/TAP is enabled or not

[root@Node /]# vzctl enter CTID 
Inside the VPS:  
# cat /dev/net/tun: File descriptor in bad state  # It means the TUN/TAP is enabled on your VPS. 
cat: /dev/net/tun: No such device     #  If you receive like this, then the TUN/TAP has not enabled on your VPS . Try to enable TUN/TAP again and check.
Was this helpful to you?