Docker VPN fails when Synology VPN is stopped 🤪

Currently reading
Docker VPN fails when Synology VPN is stopped 🤪

4,063
1,393
NAS
DS4l8play, DS202j, DS3623xs+, DSM 7.3.3-25847
A few days ago I shutdown Synology's VPN server, as it was seldom used. However yesterday, when I launched the Docker container qbittorrentvpn, its web GUI failed.

After changing the containers VPN credentials (I use AirVPN), and updating the Docker image, I continued to get TUN errors whenever the container started.

2022-02-18 03:31:52stdout2022-02-18 03:31:52.441766 [info] OpenVPN config file (ovpn extension) is located at /config/openvpn/AirVPN_NO-Oslo_Camelopardalis_UDP-443.ovpn
2022-02-18 03:31:52stdout2022-02-18 03:31:52.377470 [info] VPN_ENABLED defined as 'yes'
2022-02-18 03:30:28stdoutFri Feb 18 03:30:28 2022 Exiting due to fatal error
2022-02-18 03:30:28stdoutFri Feb 18 03:30:28 2022 ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)

After my frustration level subsided, I remembered exiting several packages a few days before, and for some random reason, I restarted Synology VPN server. When restarting the qbittorrentvpn container, the TUN errors ceased, and I was connected to the AirVPN server.

Hopefully this is obvious to some of you, but I don't understand why shutting down the Synology VPN Server (which accepts incoming connections), would affected a Docker container with an outbound connection to a VPN server.

As it seems now, the Synology VPN Server must be kept running for my container to function. Presumably, if I uninstall the VPN Server, my container is useless.

What is going on here? Why am I dependent upon the VPN Server for my Docker VPN connection? How can I break this dependency so that that container connects when the Synology VPN Server is not running (or uninstalled).
 
I had to set the following script to run at boot:
Code:
#!/bin/sh
 
# Create the necessary file structure for /dev/net/tun
if ( [ ! -c /dev/net/tun ] ); then
    if ( [ ! -d /dev/net ] ); then
        mkdir -m 755 /dev/net
    fi
    mknod /dev/net/tun c 10 200
fi
 
# Load the tun module if not already loaded
if ( !(lsmod | grep -q "^tun\s") ); then
    insmod /lib/modules/tun.ko
 
fi
It used to regularly happen to me with and without the synology VPN running.
I never managed to get the Synology one to run in a stable manner.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

I run a memcached container as part of a stack. When an image update is available, Portainer is unable to...
Replies
0
Views
1,107
Yesterday's Docker update completely wiped my container kingdom. Fortunately a "/" rollback (this is...
Replies
3
Views
1,465
for such purposes it doesn’t matter if Ubnt or Deb headless versions Just care about airflow from/to box...
Replies
16
Views
3,422
  • Solved
App password is unavailable on a free Microsoft email account IIRC. Interestingly, I used the same email...
Replies
8
Views
4,708
  • Solved
So in case anyone has a similar issue, with @Rusty's help I've decided to go a different way. If a...
Replies
3
Views
1,821
Thanks, I bought the same part from startech (or a very similar one) and with this unit the SSD boots on...
Replies
7
Views
2,526
I'll second this EXCEPT I'll say "So I learned not to do any major changes or updates unless *my husband...
Replies
5
Views
2,790

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Back
Top