TUN/TAP on LXC Container

NelaxIT

New Member
Apr 3, 2020
1
0
1
25
Hi,
i'm Nicolò from Nelax.it. We are using proxmox and we have some problems during openvpn installation. It says TUN is not available. We serched on the web and we founded this solution:
edit the container file in cd /etc/pve/lxc/containerid.conf
add the following lines:
lxc.cgroup.devices.allow = c 10:200 rwm
lxc.hook.autodev = sh -c "modprobe tun; cd ${LXC_ROOTFS_MOUNT}/dev; mkdir net; mknod net/tun c 10 200; chmod 0666 net/tun"

everytime that we reinstall the vps the last 2 lines are going to overwritten.
Is there a solution to enable the TUN permanently?
Thank You
Bye
 
hi,

another solution is to convert a CT with the already changed config into a template (right click and convert to template). afterwards you can clone the template to create a new CT with these settings