# openvpn

**URL:** <https://forums.plex.tv/t/openvpn/132957>\
**Category:** Apps & Creations\
**Created:** [January 26, 2016, 3:42pm UTC](https://forums.plex.tv/t/openvpn/132957 "2016-01-26T15:42:02Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefano\_p](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@stefano\_p](https://forums.plex.tv/u/stefano_p)\
**Post date:** [January 26, 2016, 3:42pm UTC](https://forums.plex.tv/t/openvpn/132957/1 "2016-01-26T15:42:02Z")

</div>

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:

> **[OpenVPN client access, possible?](https://forums.plex.tv/discussion/109882/openvpn-client-access-possible/p1)**
>
> Hi, I have OpenVPN access server installed on my server and I wonder if it's possible to make rasplex to login on my VPN network?   here is the linux client: ...

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [January 26, 2016, 4:04pm UTC](https://forums.plex.tv/t/openvpn/132957/2 "2016-01-26T16:04:08Z")

</div>

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

Regards

---

<div class="post-metadata">

**Author:** ![stefano\_p](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@stefano\_p](https://forums.plex.tv/u/stefano_p)\
**Post date:** [January 26, 2016, 4:17pm UTC](https://forums.plex.tv/t/openvpn/132957/3 "2016-01-26T16:17:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![benjaminwolf](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/benjaminwolf/32/4305_2.png) [@benjaminwolf](https://forums.plex.tv/u/benjaminwolf)\
**Post date:** [January 26, 2016, 6:41pm UTC](https://forums.plex.tv/t/openvpn/132957/4 "2016-01-26T18:41:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![derzyklus](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@derzyklus](https://forums.plex.tv/u/derzyklus)\
**Post date:** [May 19, 2016, 12:49pm UTC](https://forums.plex.tv/t/openvpn/132957/5 "2016-05-19T12:49:04Z")

</div>

> @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

---

<div class="post-metadata">

**Author:** ![cul8rmom1](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@cul8rmom1](https://forums.plex.tv/u/cul8rmom1)\
**Post date:** [May 20, 2016, 3:32pm UTC](https://forums.plex.tv/t/openvpn/132957/6 "2016-05-20T15:32:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![benjaminwolf](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/benjaminwolf/32/4305_2.png) [@benjaminwolf](https://forums.plex.tv/u/benjaminwolf)\
**Post date:** [May 23, 2016, 12:25am UTC](https://forums.plex.tv/t/openvpn/132957/7 "2016-05-23T00:25:27Z")

</div>

> @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.

---

<div class="post-metadata">

**Author:** ![benjaminwolf](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/benjaminwolf/32/4305_2.png) [@benjaminwolf](https://forums.plex.tv/u/benjaminwolf)\
**Post date:** [May 23, 2016, 2:11am UTC](https://forums.plex.tv/t/openvpn/132957/8 "2016-05-23T02:11:27Z")

</div>

> @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?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [January 8, 2020, 7:12pm UTC](https://forums.plex.tv/t/openvpn/132957/9 "2020-01-08T19:12:12Z")

</div>


