OpenVZ VPN TUN/TAP device

First check if the tun module is loaded on the host node

lsmod | grep tun

If not make sure you load it

modprobe tun

Allow your container to use the tun/tap device by running the following commands on the host node. This example would apply for container number 101


vzctl set $CTID --devnodes net/tun:rw --save

vzctl set $CTID --devices c:10:200:rw --save

vzctl set $CTID --capability net_admin:on --save

vzctl exec $CTID mkdir -p /dev/net

vzctl exec $CTID chmod 600 /dev/net/tun

Thats it restart your container and start installing openVPN.

Leave a Reply

Your email address will not be published. Required fields are marked *