NOTE! This site uses cookies and similar technologies.

If you not change browser settings, you agree to it.

I understand

WETEK Play

Welcome, Guest
Username: Password: Remember me

TOPIC: openvpn solution (butchered together solution)open

openvpn solution (butchered together solution)open 2 years 9 months ago #1

i've been seeing a lot of problems with openvpn but couldn't find any solutions, I've managed to getting something running using terminal which launches at start , but there's no way to stop it without ssh'ing in that i can think of. I'm new to this so there's probably a lot more elegant ways to do it but this is what I've got at the moment. I've set mine up for Private Internet Access but i'm sure others should work. If this has been solved already feel free to delete this post.



1 - grab your providers openvpn config files, private internet access hold theirs here :
 www.privateinternetaccess.com/openvpn/openvpn.zip

2 - unzip the files and inside the folder should be all the VPN locations as .ovpn files and the ca.crt file. this method only works for one location so choose which one you want and copy that and the ca.crt to a new folder.

3 - next you need to get your username and password for the VPN, there is a page in Private Internet Access where this is generated : https:// www.privateinternetaccess.com/pages/client-control-panel

4 - create a new empty text file with just the user and password in eg :
x5873928
HNdjs9skfR

5 - save this file as pass.txt into the folder with your ca.crt and the .ovpn file.

6 - open the .ovpn file in your text editor it should look something like this :

client
dev tun
proto udp
remote uk-london.privateinternetaccess.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
tls-client
remote-cert-tls server
auth-user-pass
comp-lzo
verb 1
reneg-sec 0


change

ca ca.crt
to
ca /storage/.config/ca.crt

and add /storage/.config/pass.txt after auth-user-pass so it looks like this:

client
dev tun
proto udp
remote uk-london.privateinternetaccess.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /storage/.config/ca.crt
tls-client
remote-cert-tls server
auth-user-pass /storage/.config/pass.txt
comp-lzo
verb 1
reneg-sec 0

7 - you need to transfer these 3 files to your openelec, using either sftp or whatever sharing is showing on your computer. Put them in /storage/.config

8 - ssh into this folder where all three files are and type this command to start the VPN

openvpn /storage/.config/whatever_the_name_of_your_ovpn.ovpn

you should see the VPN service starting up with no errors finishing with "Initialization Sequence Completed"

you can now check you IP address using the command:

curl ifconfig.me

make sure everything is working and the IP is what you expect. your openvpn is now working if you want it to start when you boot continue from here.

9 - then type this :

echo "#!/bin/sh" > /storage/.config/autostart.sh && chmod +x /storage/.config/autostart.sh

10 - then type

nano /storage/.config/autostart.sh

in here you need to add the lines so it looks like this:

#!/bin/sh

sleep 10s
openvpn /storage/.config/whatever_the_name_of_your_ovpn.ovpn &

write this file , and now your vpn will run on startup.


if there is a better way of doing this feel free to add on.
[/color][/color][/color]
Last Edit: 2 years 9 months ago by funnyitworkedlasttime.
The administrator has disabled public write access.
The following user(s) said Thank You: connex91, freduruncle, isno, Widget21, skeniver, huntz, dochipo, mhkb, andypiznti

openvpn solution (butchered together solution)open 2 years 8 months ago #2

  • e n
  • e n's Avatar
  • Offline
  • Expert Boarder
  • Posts: 442
  • Thank you received: 45
  • Karma: 0
hi thanks for this I could not use the autostart because I need different VPN connections for different countries
And this i my solution:

I made my VPN .conf files for al vpn connecties i need and 1 to close the VPN connectioen
placed these in seperate sh files like this : openvpn /storage/.config/vpn-config/usa.conf &

Then I installed Advanced Launcher made 3 advanced Launcher files (one for norway.vpn, one for usa.vpn and one for closeall.vpn),
added these 3 advanced Launcher to my Favorites
and added each favorite to a button that only works from the homescreeen
So now the Red button on the remote opens the VPN to the USA,
the Green button on the remote opens VPN to norway
and the Yellow button on the remote closes the VPN connection
Last Edit: 2 years 8 months ago by e n.
The administrator has disabled public write access.

openvpn solution (butchered together solution)open 2 years 8 months ago #3

  • connex91
  • connex91's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 1
  • Karma: 0
Thanks a million @funnyitworkedlasttime!! This works beautifully. Had a few hiccups along the way but was able to smooth out the bumps in about an hour.

Hi @ e n, could you give more detailed steps for us newbies? I'd love to be able to have buttons to turn different VPN locations on or off.

Thanks!
Last Edit: 2 years 8 months ago by connex91. Reason: additional info
The administrator has disabled public write access.

openvpn solution (butchered together solution)open 2 years 8 months ago #4

  • e n
  • e n's Avatar
  • Offline
  • Expert Boarder
  • Posts: 442
  • Thank you received: 45
  • Karma: 0
connex91 wrote:
Thanks a million @funnyitworkedlasttime!! This works beautifully. Had a few hiccups along the way but was able to smooth out the bumps in about an hour.

Hi @ e n, could you give more detailed steps for us newbies? I'd love to be able to have buttons to turn different VPN locations on or off.

Thanks!

Hi what details do you need? how to use advanced laucher or how to a make a button/key to start a favorite?
The administrator has disabled public write access.

openvpn solution (butchered together solution)open 2 years 8 months ago #5

I would actually love to know how to do both as I want to be able to watch SVT Play (and other Swedish channels) but at the same time be able to watch US based programming without any issues - so in a perfect world, OpenElec would open without using VPN and then when I wanted to watch SVT Play or other programming from Sweden, I could at the press of a button launch the VPN service.

That being said, I am still struggling with how to even successfully use the VPN feature within OpenElec, not to mention I don't have the foggiest on how to set up a command within the Advanced Launcher that maps to my remote (Haromony One). If the documentation of steps on 1) setting up the VPN connection, and 2) using the Advanced Launcher to activiate the VPN connection would take a lot of time - then no worries, but if you have the time/patience to walk myself (and i'm sure many others would benefit) on how you successfully set up your VPN connection to watch Norweigan programming, I would truly appreciate it.

Regards,
Jimmy
The administrator has disabled public write access.

openvpn solution (butchered together solution)open 2 years 8 months ago #6

  • e n
  • e n's Avatar
  • Offline
  • Expert Boarder
  • Posts: 442
  • Thank you received: 45
  • Karma: 0
what about setting up a skype talk or someting like that
ps no swedish channels Norwegian :)
Last Edit: 2 years 8 months ago by e n.
The administrator has disabled public write access.

openvpn solution (butchered together solution)open 2 years 8 months ago #7

  • geoffl
  • geoffl's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 6
  • Karma: 0
@ e n

Would you be able to share your closeall.vpn? Thanks!
The administrator has disabled public write access.

openvpn solution (butchered together solution)open 2 years 8 months ago #8

  • e n
  • e n's Avatar
  • Offline
  • Expert Boarder
  • Posts: 442
  • Thank you received: 45
  • Karma: 0
it is a closevpn.sh file
with just 1 line: killall openvpn &
The administrator has disabled public write access.
The following user(s) said Thank You: geoffl

openvpn solution (butchered together solution)open 2 years 8 months ago #9

@ e n,

Well I am wondering if you could document your steps in setting up your VPN connection for Norway as an example. I digested & think I follow the original directions in the thread on how to get the right folder/file names ready....but i'm a bit unclear on how I then "SSH" them into OpenElec (would I use a program like Putty on my windows machine to communicate with my OpenElec box on the same network or can you access a command terminal within OpenElec?). And I would really love the steps within the Advanced Launcher add-on on how you created short-cuts to launch the VPN connection and then close it. I'm new to all this (just got my NUC in the mail today) so will be setting that up with OpenElec over the weekend. Thanks for any help!

ps. be nice to the Swedes! :)
The administrator has disabled public write access.

openvpn solution (butchered together solution)open 2 years 8 months ago #10

  • e n
  • e n's Avatar
  • Offline
  • Expert Boarder
  • Posts: 442
  • Thank you received: 45
  • Karma: 0
why would you ssh them into OpenElec? smb share will do the trick or Winscp

this is all i did :

I made my VPN .conf files for al vpn connecties i need and 1 to close the VPN connectioen
placed these in seperate sh files like this : openvpn /storage/.config/vpn-config/usa.conf &

Then I installed Advanced Launcher made 3 advanced Launcher files (one for norway.vpn, one for usa.vpn and one for closeall.vpn),
added these 3 advanced Launcher to my Favorites
and added each favorite to a button that only works from the homescreeen
So now the Red button on the remote opens the VPN to the USA,
the Green button on the remote opens VPN to norway
and the Yellow button on the remote closes the VPN connection
The administrator has disabled public write access.

openvpn solution (butchered together solution)open 2 years 7 months ago #11

  • e n
  • e n's Avatar
  • Offline
  • Expert Boarder
  • Posts: 442
  • Thank you received: 45
  • Karma: 0
njgadgetfreak wrote:
@ e n,

Well I am wondering if you could document your steps in setting up your VPN connection for Norway as an example. I digested & think I follow the original directions in the thread on how to get the right folder/file names ready....but i'm a bit unclear on how I then "SSH" them into OpenElec (would I use a program like Putty on my windows machine to communicate with my OpenElec box on the same network or can you access a command terminal within OpenElec?). And I would really love the steps within the Advanced Launcher add-on on how you created short-cuts to launch the VPN connection and then close it. I'm new to all this (just got my NUC in the mail today) so will be setting that up with OpenElec over the weekend. Thanks for any help!

ps. be nice to the Swedes! :)

didyou get it to work?
The administrator has disabled public write access.

openvpn solution (butchered together solution)open 2 years 7 months ago #12

  • Arogantis
  • Arogantis's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 1
  • Karma: 0
Been trying to get advanced launcher to work and am unable to do so. I've created a .sh file containing
openvpn /storage/.config/UK.ovpn &
and my launchers.xml file looks like this
<launcher>
		<id>eba34e67bde9024598cad328dd2a00fc</id>
		<name>uk</name>
		<category>608bc696c360c41023ceab2c178e6e86</category>
		<application>/storage/.config/vpn-config/uk.sh</application>
		<args></args>
		<rompath></rompath>
		<thumbpath>/storage/</thumbpath>
		<fanartpath>/storage/</fanartpath>
		<trailerpath></trailerpath>
		<custompath></custompath>
		<romext></romext>
		<platform>Linux</platform>
		<thumb></thumb>
		<fanart></fanart>
		<genre></genre>
		<release></release>
		<publisher></publisher>
		<launcherplot></launcherplot>
		<finished>false</finished>
		<minimize>false</minimize>
		<lnk></lnk>
		<roms>
		</roms>
	</launcher>
but when running the item in xbmc it does nothing. Any help appreciated.
Last Edit: 2 years 7 months ago by Arogantis.
The administrator has disabled public write access.

openvpn solution (butchered together solution)open 2 years 7 months ago #13

  • e n
  • e n's Avatar
  • Offline
  • Expert Boarder
  • Posts: 442
  • Thank you received: 45
  • Karma: 0
Arogantis wrote:
Been trying to get advanced launcher to work and am unable to do so. I've created a .sh file containing
<code>openvpn /storage/.config/UK.ovpn &</code>
and my launchers.xml file looks like this
<launcher>
		<id>eba34e67bde9024598cad328dd2a00fc</id>
		<name>uk</name>
		<category>608bc696c360c41023ceab2c178e6e86</category>
		<application>/storage/.config/vpn-config/uk.sh</application>
		<args></args>
		<rompath></rompath>
		<thumbpath>/storage/</thumbpath>
		<fanartpath>/storage/</fanartpath>
		<trailerpath></trailerpath>
		<custompath></custompath>
		<romext></romext>
		<platform>Linux</platform>
		<thumb></thumb>
		<fanart></fanart>
		<genre></genre>
		<release></release>
		<publisher></publisher>
		<launcherplot></launcherplot>
		<finished>false</finished>
		<minimize>false</minimize>
		<lnk></lnk>
		<roms>
		</roms>
	</launcher>
but when running the item in xbmc it does nothing. Any help appreciated.

You forgot something : Add Items -> Scan for new items'
read this forum.xbmc.org/showthread.php?tid=140782&page=2
and check this
<launchers>
<launcher>
<id>e797db1bfce12fee0e47800a0b87bffe</id>
<name>sh</name>
<category>default</category>
<application>/bin/sh</application>
<args>"%rom%"</args>
<rompath>/storage/.config/vpn-config/</rompath>
<thumbpath>/storage/.config/vpn-config/</thumbpath>
<fanartpath>/storage/.config/vpn-config/</fanartpath>
<trailerpath></trailerpath>
<custompath></custompath>
<romext>sh</romext>
<platform>Linux</platform>
<thumb></thumb>
<fanart></fanart>
<genre></genre>
<release></release>
<publisher></publisher>
<launcherplot></launcherplot>
<finished>false</finished>
<minimize>false</minimize>
<lnk></lnk>
<roms>
<rom>
<id>a7a8985a0d46fda464717c053d900f5d</id>
<name>closevpn</name>
<filename>/storage/.config/vpn-config/closevpn.sh</filename>
<thumb>/storage/.xbmc/addons/Aeon-Nox-master/media/close.png</thumb>
<fanart></fanart>
<trailer></trailer>
<custom></custom>
<genre></genre>
<release></release>
<publisher></publisher>
<gameplot></gameplot>
<finished>true</finished>
<altapp></altapp>
<altarg></altarg>
</rom>
<rom>
<id>2221bc3d2afa17e7719b992080e5e09c</id>
<name>norges</name>
<filename>/storage/.config/vpn-config/norges.sh</filename>
<thumb>/storage/.config/vpn-config/norway.png</thumb>
<fanart></fanart>
<trailer></trailer>
<custom></custom>
<genre></genre>
<release></release>
<publisher></publisher>
<gameplot></gameplot>
<finished>true</finished>
<altapp></altapp>
<altarg></altarg>
</rom>
<rom>
<id>a6131082e982c13fd8ab58ca6a49343e</id>
<name>usa</name>
<filename>/storage/.config/vpn-config/usa.sh</filename>
<thumb>/storage/.config/vpn-config/united_states.png</thumb>
<fanart></fanart>
<trailer></trailer>
<custom></custom>
<genre></genre>
<release></release>
<publisher></publisher>
<gameplot></gameplot>
<finished>true</finished>
<altapp></altapp>
<altarg></altarg>
</rom>
</roms>
</launcher>
</launchers>
Last Edit: 2 years 7 months ago by e n.
The administrator has disabled public write access.
The following user(s) said Thank You: Arogantis

openvpn solution (butchered together solution)open 2 years 7 months ago #14

  • Arogantis
  • Arogantis's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 1
  • Karma: 0
Got it working, awesome. Thanks a lot.
The administrator has disabled public write access.

openvpn solution (butchered together solution)open 2 years 7 months ago #15

  • xsy77
  • xsy77's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
Hi guys,

You guys seem to be the only folk who can get the VPN feature working as far as I can read.

I followed your directions to the letter (1st post), even using the same VPN provider but keep getting AUTH error.

I also tried using the GUI (both options) but no go there either.

Can you help?

Im no master of SSH or linux but can follow instructions pretty well.

Thanks,
Christopher
The administrator has disabled public write access.
Moderators: lrusak