[SOLVED] PVE 7 OpenVPN (LXC) problem: Cannot open TUN/TAP dev

gosha

Well-Known Member
Oct 20, 2014
302
25
58
Russia
Hi!

After upgrading my cluster to PVE7:
LXC container with OpenVPN server shows an error in the log:

Code:
Mon Jul 19 10:32:50 2021 Diffie-Hellman initialized with 2048 bit key
Mon Jul 19 10:32:50 2021 Socket Buffers: R=[131072->131072] S=[16384->131072]
Mon Jul 19 10:32:50 2021 ROUTE_GATEWAY 192.168.0.254/255.255.255.0 IFACE=eth0 HWADDR=36:65:32:35:37:35
Mon Jul 19 10:32:50 2021 ERROR: Cannot open TUN/TAP dev /dev/net/tun: Operation not permitted (errno=1)
Mon Jul 19 10:32:50 2021 Exiting due to fatal error

Container config:

Code:
arch: amd64
cores: 2
cpulimit: 2
hostname: ovpn
memory: 256
nameserver: 192.168.0.201 8.8.8.8
net0: bridge=vmbr0,gw=192.168.0.254,hwaddr=36:65:32:35:37:35,ip=192.168.0.195/24,name=eth0,type=veth
onboot: 0
ostype: ubuntu
rootfs: LVM_DATA:vm-103-disk-0,size=2G
searchdomain: mfczgo.ru
swap: 0

I searched the forum and found some solutions for unprivileged containers.
But my container doesn't use this option.

However I tried adding to the container config:

lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
lxc.cgroup.devices.allow: c 10:200 rwm

problem still exists.


Help me please!

---
Best regards
Gosha
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!