Skip to content

Instantly share code, notes, and snippets.

@andrewnimmo
Forked from wastrachan/openvpn-in-lxd.txt
Created April 10, 2018 07:19
Show Gist options
  • Save andrewnimmo/64a7294692bda687900a37e11e924814 to your computer and use it in GitHub Desktop.
Save andrewnimmo/64a7294692bda687900a37e11e924814 to your computer and use it in GitHub Desktop.
OpenVPN in LXD Container
# On the host
=============
lxc config set openvpn raw.lxc 'lxc.cgroup.devices.allow = c 10:200 rwm'
lxc config device add openvpn tun unix-char path=/dev/net/tun
# In the container
==================
1. mknod /dev/net/tun c 10 200
2. install OpenVPN (https://github.com/Nyr/openvpn-install or manual)
3. edit /lib/systemd/system/openvpn@.service -- comment out/remove `LimitNPROC=10`
4. systemctl daemon-reload or reboot container
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment