-
-
Save wastrachan/8d75ecf39db1fc25ae73c93989a8df11 to your computer and use it in GitHub Desktop.
# 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/[email protected] -- comment out/remove `LimitNPROC=10` | |
4. systemctl daemon-reload or reboot container |
In case you are installing openvpn via the bashfile obtained via
wget https://git.io/vpn -O openvpn-install.sh
make sure that the server files actually lie in folder: /etc/opevpn/ and not in /etc/openvpn/server/.
I had to move all files from /etc/openvpn/server to /etc/openvpn/ in order for the server to start.
Maybe there is also a configuration for this path?
In case you are installing openvpn via the bashfile obtained via
wget https://git.io/vpn -O openvpn-install.sh
make sure that the server files actually lie in folder: /etc/opevpn/ and not in /etc/openvpn/server/.
I had to move all files from /etc/openvpn/server to /etc/openvpn/ in order for the server to start.
Maybe there is also a configuration for this path?
Hello!
Trying to get this working in a container ubuntu/focal. When I first launch the container, I can list /dev/net/tun, so when I try to do mknod it says it exists.
But when I try to launch openvpn I always get
ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
I've tried debian and opensuse containers, same result. What am I doing wrong?
Maybe I did something wrong, however I can't get it to work. I'm using a bridge connection:
Any suggestion?
EDIT:
I found the problem. Does not install without following the proposed order.