Problem Connecting Containers to OpenVPN after Reboot

ThinkPrivacy

Member
Sep 22, 2016
15
1
23
50
So I am running a 3 Node cluster and I have a bunch of containers running on them with HA.

The problem is all containers must connect to an OpenVPN network in order to be accessible via our company VPN (they are not accessible from the outside world) but when they reboot /dev/net/tun is not created or accessible so I have to manually do:

mkdir /dev/net
mknod /dev/net/tun c 10 200
systemctl start openvpn@client.service

On every container to get them to reconnect to the VPN.

This seems to be an issue with either LXC or Debian LXC containers because my master nodes are fine - they come up with the relevant tun device and connect fine.

I currently have 15 servers running as Debian LXC containers so as you can imagine this is a serious pita.

Anyone know how to make /dev/net/tun persist and be accessible across reboots with a Debian LXC container?

Thanks.
 
Last edited:
  • Like
Reactions: fanboyfanboy
I might not fully understand your problem, but have you tried adding these lines to your /etc/pve/lxc/CONTAINERID.conf ?

Code:
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
lxc.cgroup.devices.allow: c 10:200 rwm
 
I might not fully understand your problem, but have you tried adding these lines to your /etc/pve/lxc/CONTAINERID.conf ?

Code:
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
lxc.cgroup.devices.allow: c 10:200 rwm
Sorry for the delayed response I was traveling. That seems to have worked, so thanks :). It would be nice to have this available in the LXC setup as maybe a field to add optional configuration settings for the container. It is as easy as adding a text box to the final stage of the LXC setup wizard to paste additional configuration lines.
 

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!