[TUTORIAL] VPN Server SoftEther on Proxmox LXC or VM Alpine Linux

q9on8

New Member
Nov 26, 2022
14
1
3
I spent 5 months to get the VPN server SoftEther working on PROXMOX. Finally, I did it on LXC but not on VM.
This is my notes for LXC:
Enable all repositories
cat /etc/apk/repositories
drop "#" for community row (https://wiki.alpinelinux.org/wiki/Repositories)

apk update && apk upgrade

pre-install preparation:
Bash:
apk add --no-cache \
      binutils \
      build-base \
      readline-dev \
      openssl-dev \
      ncurses-dev \
      git \
      cmake \
      gnu-libiconv \
      zlib-dev \
      libsodium \
      libsodium-dev

(better under root)
git clone https://github.com/SoftEtherVPN/SoftEtherVPN_Stable.git
ls
cd SoftEtherVPN_Stable
./configure
make
make install
vpnserver start

Config here: /usr/local/libexec/softether/vpnserver/vpn_server.config

you can drop unnecessary apk:
Bash:
apk del binutils build-base ncurses-dev cmake gnu-libiconv zlib-dev libsodium libsodium-dev


Now it is possible to connect to SoftEther with "SE-VPN Server Manager (Tools)". Create USERS, but users can`t establish VPN tunnels because of no rights to get new IPs to SoftEther.

To fix it LXC should be stopped.

On Proxmox host should do the similar as https://pve.proxmox.com/wiki/OpenVPN_in_LXC
nano /etc/pve/lxc/[ID_of_your_LXC].conf
Add the following lines at the end (if you're using PVE < 7.0, change `cgroup2` with `cgroup`)
Bash:
lxc.cgroup2.devices.allow: c 10:200 rwm
 lxc.mount.entry: /dev/net dev/net none bind,create=dir

Run on host
Bash:
chown 100000:100000 /dev/net/tun
to give permission for LXC`s to get IP`s on host.

Start LXC. All should work.

I will be grateful if somebody can help run SoftEther in the VM.

PS and maybe there is a more secure way than "chown 100000:100000 /dev/net/tun" to give multiple IP`s for LXC`s / VM`s.
 
Last edited:
Needed to registry to thanks for the post. Was very helpful.

Also, I was able to have functional Softether VPN working without adding the

Code:
lxc.cgroup2.devices.allow: c 10:200 rwm
 lxc.mount.entry: /dev/net dev/net none bind,create=dir

I dont know why is working, but is working.

Greetings.
 
Last edited:

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!