openvpn

hi, is it possible with rasplex 1.0.1 to set up openvpn (with private internet acces as vpn provider)?

looks like in openelec it is possible.
i only found this thread on the matter, but it’s a bit old:

Rasplex supports both Openvpn and pptp for VPN connections, configured in System Settings->Network->Virtual Private Netwoks->Add new VPN configuration.

Regards

cool, thank you. i didn’t notice much what was under settings/network.
easier than i thought

I’ve never gotten the OpenVPN connections to work through the GUI. I wrote a service that autostarts the OpenVPN client with an OpenVPN config file that is very reliable.

@benjaminwolf said:
I’ve never gotten the OpenVPN connections to work through the GUI. I wrote a service that autostarts the OpenVPN client with an OpenVPN config file that is very reliable.

Could you describe how you did that and where to put the files ?
I’m running OpenVPN on my Synology and Rasplex on my Pi3.
Thanks

Are you interested in doing in o the synology box? I have that running with no problems. Let me know and i will try to help.

@derzyklus said:

@benjaminwolf said:
I’ve never gotten the OpenVPN connections to work through the GUI. I wrote a service that autostarts the OpenVPN client with an OpenVPN config file that is very reliable.

Could you describe how you did that and where to put the files ?
I’m running OpenVPN on my Synology and Rasplex on my Pi3.
Thanks

You need 3 files:

.OVPN client configuration file.
A text file containing the UN/PW for you OpenVPN connection. (if you use UN/PW for connections)
A text file containing the service code to autostart the OpenVPN client with the configuration file.

If you use UN/PW, you’ll need to create a new text file. I’m going to use CREDENTIALS.txt for this example. It will only have 2 lines in it. The first line should contain the USERNAME for this OpenVPN connection. The second line should contain the PASSWORD. When you edit the CREDENTIALS.txt file, it’s contents should look like this:

USERNAME
PASSWORD

Now we need to edit the OVPN file to reference the CREDENTIALS file. You want to add the following line inside the OVPN file contents:

auth-user-pass /storage/.config/vpn-config/CREDENTIALS.txt

Once this is done, SSH into the Rasplex PI and copy both the .OVPN file and the CREDENTIALS.txt into the following directory:

/storage/.config/vpn-config/

Now we need to craft the system.d file to autostart OpenVPN when the PI sees a network connection.

Create a new text file, but make the file extension .service. The filename should NOT have spaces in it. For this example, I’m going to use MYOPENVPN.service as the filename.

Add the following contents to the text file. Make sure you change the MYOPENVPN and OVENVPNclientCONFIG.ovpn references to whatever you named the corresponding files. Specifically, the Description= should be the service filename without the .service extension. And the ExecStart line will contain the full path and filename of the .OVPN client configuration file you copied over earlier.

[Unit]
Description=MYOPENVPN
After=network-online.service
Requires=network-online.service

[Service]
Type=forking
ExecStart=/usr/sbin/openvpn --daemon --config /storage/.config/vpn-config/OVENVPNclientCONFIG.ovpn
TimeoutStopSec=1
Restart=always
RestartSec=2
StartLimitInterval=0

[Install]
WantedBy=multi-user.target

Save this file. I saved mine as MYOPENVPN.service . SSH into Rasplex on the PI and copy the file to the following location:

/storage/.config/system.d/

Now we need to enable the service. SSH terminal/putty into the Rasplex console commandline. Enter the following command replacing the MYOPENVPN.service filename with your own.

systemctl enable MYOPENVPN.service

You’ll get a symlink created successfully type message if you did it all right. Reboot and you should be attaching to your VPN client a few moments after it comes up.

I do recommend you disable the Plex SSL encryption and force it to disabled in the Plex server settings. While it will work for the most part with double encryption, it works much much better with only one encrypted tunnel.

@cul8rmom1 said:
Are you interested in doing in o the synology box? I have that running with no problems. Let me know and i will try to help.

Are you saying you got this working via the GUI?