I'm doing this on an Ubuntu server and I spent a long time trying to get netplan (and/or NetworkManager directly) to own the SoftEther interface, but I just couldn't get it to work. So instead I created a systemd unit file to start dhclient automatically with SoftEther. Then I made my VPN connection a "startup connection" in the VPN client config. Now SoftEther automatically connects on startup, and dhclient starts right after.
This depends on using the bundled softether-vpnclient.service in the latest releases on github. Use make -C tmp && make -C tmp package to build an OS-specific package (rpm or deb) which includes this, and systemd enable softether-vpnclient.service so it always starts on reboot.
Here's the unit file for dhclient. Install this as /lib/systemd/system/dhclient-vpn.service and then use systemd enable dhclient-vpn.service to enable it.
Code: Select all
[Unit]
Description=DHCP Client for SoftEther VPN
After=softether-vpnclient.service
Requires=softether-vpnclient.service
PartOf=softether-vpnclient.service
[Service]
Type=forking
ExecStart=/sbin/dhclient -v vpn # <--- Use the name of your VPN interface here
ExecStop=/sbin/dhclient -v -r vpn
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target