1 minute read (178 words).

How to run OpenVPN in LXC Proxmox


Linux

I run a number of small Proxmox installations on a mixture of old and new PC hardware at various location and I needed a secure way to access them and transfer data between VM’s and containers which run on them. Given the limited resources on some, I wanted to run OpenVPN in LXC rather than provisioning a full fat VM.

The limited resource issue was one of the deciding factors for the choice of using Proxmox and LXC containers, to virtualise and containerise my old fashion VMs to conserve resources.

There are a few modifications required on the Proxmox host in order to allow your LXC container to utilite the OpenVPN /dev/net/tun interface.

mkdir -p /devcontainer/net
mknod /devcontainer/net/tun c 10 200
chown 100000:100000 /devcontainer/net/tun

echo "lxc.mount.entry: /devcontainer/net dev/net none bind,create=dir" >> /etc/pve/lxc/***lxc*container*id***.conf

The container doesn’t need to run in privileged mode and don’t forget to enable IP forwarding:

vi /etc/sysctl.conf
net.ipv4.ip_forward=1
net.ipv6.conf.all.forwarding=1


Share via Twitter LinkedIn Facebook Email