SERVER MANAGEMENT

How to enable TUN TAP in OpenVZ Container

Enable TUN TAP
Enable TUN TAP

This post explains how to enable TUN TAP in OpenVZ Container. TUN/TAP provides packet reception and transmission for user space programs. TUN and TAP are virtual network kernel devices. TUN (network TUNnel) is a network layer device and TAP (network TAP) is a link layer device. TUN is used with routing and the TAP is used for creating a network bridge, so TUN/TAP kernel module needs to be enabled in VPS for VPN configuration.

Enable TUN TAP in OpenVZ

The below steps explains how to enable TUN TAP in OpenVZ / Virtuozzo container:

First of all, you need to check the TUN module is loaded on the node.

 
lsmod | grep tun

If the above command shows a blank output, the TUN module is not loaded on the node, so we can enable it using the following command.

 
modprobe tun
chmod a+rx /etc/rc.modules

Check again:

 
# lsmod | grep tun
tun   19157   0

Then, enable TUN TAP in OpenVZ / Virtuozzo Container:

 
vzctl set VEID --devices c:10:200:rw --save
vzctl exec VEID mkdir -p /dev/net
vzctl exec VEID mknod /dev/net/tun c 10 200
vzctl exec VEID chmod 600 /dev/net/tun

Also Read:

That’s it!!

If you like the post and wish to receive more articles from us, please like our FB page: If you like this post and wish to receive more articles from us, please like our FB page: Button

Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.

For more details on our services, please drop us an E-mail at info@grepitout.com

Topics