Scripts and Guide for setting up OpenVPN with Most VPN,s on Enigma2

dsayers2014

VIP Member
Guide for setting up OpenVPN with Most VPN,s on Enigma2



This Guide is for setting up OpenVPN with my private network if done correctly it should download and install your openvpn configs via a simple script


Create an account with my private network -
Code:
https://www.my-private-network.co.uk



Putty can be downloaded at
Code:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html


If using a Mac there are instructions at the end of the document for an alternative to Putty


First open Putty, and in the HostName (or IP address) box enter the enigma2 boxes IP address, and then click the Telnet radio button and click open
Screenshot (132).png

And then log in using the word, root


Screenshot (133).png
clip_image002.png



Download the script from here
Code:
https://www.dropbox.com/s/zfimquxeed9vctx/myvn.txt?dl=1

We only need to edit lines 1 to 3

Change line 1 uuuu with your username between the ""

Example USERNAME='davesayers19'

Change line 2 pppp with your password between the ""

example PASSWORD='149356d'


On line 3 change GBR to the country you want the VPN to connect to

Example COUNTRY='NLD'

NLD is for Netherlands

Do not edit anything below line 3 as it bay cause errors

You can change the country you want the VPN server you want to connect to use the 3 letters 3 Letter Code ie GBR for United Kingdom a list of countries here
Code:
https://help.my-private-network.co.uk/support/solutions/articles/8461-which-countries-can-i-connect-to-


Once you have edited your details copy the script and paste into putty as per example below

Screenshot (131).png
clip_image004.png


And hit enter


Before starting OpenVPN we can run an IP check script this will tell you if the vpn is working and you can test it when changing servers.

The script should have downloaded a plugin called IP Checker.

Goto plugin and you should see IP Checker press ok on the plugin and it should run a simple IP check script

You should get something like this I have removed part of my IP address

clip_image006.jpg

IP Check sh.jpg

Now start openvpn on box

clip_image008.jpg

OpenVPN.jpg

After starting openvpn the above should stay green and say running, You can now go back to plugins and start IP Checker and see if the IP Address has changed


If using Mac


There is a version of Putty for Mac but is not very good.


Open Applications ->Utilities ->

Type the following command telnet 192.168.X.X (change the IP address to the one for the Zgemma/Enigma2 boxes)

Enter the username root (and password if you have set one) and press enter

Then follow the instructions above.

Problem 1,

When enabling OpenVPN I lose internet connection.

Possible Solution

Goto your network settings on box and change DHPC to no then blue button to Edit DNS

Try Google DNS

Nameserver 1 8.8.8.8

Nameserver2 8.8.4.4

I have been working on this script since last Friday, I had a few teething problems but thanks to MYVPN with there help we sorted it and also a big thankyou to
@grog68 with his suggestions and help with making the script more simpler.



==================================================================================================================================================================

OpenVPN script generator


First open Putty, and in the HostName (or IP address) box enter the enigma2 boxes IP address, and then click the Telnet radio button and click open

screenshot-132-png.28837



And then log in using the word, root


screenshot-133-png.28838


Users can now visit
Code:
http://e2openvpn.com/OpenVPN_Generator/

Add there username and password this will now generate a script.

Copy and paste the script in putty and hit enter you should now have the option for what VPN you want to use:

1) Nord VPN
2) IP Vanish
3) Digibit
4) PureVPN
5) PIA VPN
6) Windscrape
7) SurfShark
8) TorGuard
9) Ivacy
10) Quite


Choose your option and hit Enter this should then download the configs and once finished it will say OpenVPN Configs downloaded Please Start OpenVPN.


You will be asked to enter your choice again but you can ignore this.

Reboot box and goto plugins, VPN Changer and choose a country.

Attached is a guide for setting up Digibit, IP Vanish, Pure VPN and Nord
 

Attachments

  • Guide for setting up OpenVPN on Enigma2.pdf
    444.7 KB · Views: 917
Last edited:
Any chance of a script for Digibit VPN users ?

Ill have a look but most other VPN,s have separate conf files for each server location so its harder to work out to switch location. My Private Network only uses one config and you can easily use script to edit it.
 
For other VPN,s to use VPN Manager


On the box create a folder called vpn in hdd

Now FTP your config files to hdd/vpn

You can now create a file called pass.file

Add your username and paasword in the pass.file one under the other so it looks like

USERNAME
PASSWORD

Send pass.file to hdd/vpn

VPN Manager
PY2 images for older images
https://github.com/davesayers2014/OpenVPN/blob/PY3/enigma2-plugin-extensions-vpnmanager_1.1.4_all.ipk?raw=true

PY3 Images OpenATV 6.5/7.0 OpenViX 6.0 qand above
https://github.com/davesayers2014/OpenVPN/blob/PY3/enigma2-plugin-extensions-vpnmanager_1.1.7-py3_all.ipk?raw=true

Install VPN Manager and reboot box then menu, plugins, VPN Manager.

Press menu then set all configs in one folder yes and storage location for config files should be hdd/vpn exit. You should now be able to choose a vpn country

This should work with most VPN,s
 
Last edited:
So I have been playing with this today and have it half working. I downloaded the configs Digibit gave me, then unzip,t it.

On box I created a folder called digibit and dragged all the configs to that folder.

Now I used putty in typed
Code:
cd /digibit
this will put putty in the digibit folder

Now I used a simple command to rename all the .ovpn files to .conf
Code:
for x in *.ovpn; do mv "$x" "${x%.ovpn}.conf"; done

Now to add password.txt to each conf file with one command I used
Code:
sed -i -e "s/auth-user-pass/auth-user-pass password.txt/g" /digibit    /*.conf

Then created a password.txt in etc/openvpn and added my username and password

So now I have all the configs in /digibit I can just drag the server I want to etc/openvpn and start openvpn.

Unfortunately I,m not sure how to get the script to move one selected conf to etc/openvpn with using country at the top, but this works quite well.

On a side note I have seen a plugin that should allow you to switch configs that are on hdd/vpn but I haven't had chance to test it yet

Wooshbuild v7 has a digibit von plug in built in. You just enter your digibit user and pass then select server.
 
I get this after hitting return in putty...

Connecting to raw.githubusercontent.com (151.101.0.133:443)
script.sh 100% |*******************************| 1833 0:00:00 ETA
sed: -i requires an argument
root@zgemmah5:~# script.sh && chmod +x script.sh && ./script.sh
 
I get this after hitting return in putty...

Connecting to raw.githubusercontent.com (151.101.0.133:443)
script.sh 100% |*******************************| 1833 0:00:00 ETA
sed: -i requires an argument
root@zgemmah5:~# script.sh && chmod +x script.sh && ./script.sh

Just ran it and running fine. check you are only editing line 1 to 3 and copying and pasting the whole script.

Screenshot (1).png
 
yep, username and password as per the MPN account screen

There must be an error how your inputting username and password they need to stay between ' ' example

Code:
USERNAME='thomaskieron'
PASSWORD='TK135'
COUNTRY='GBR'
###############################################################
# Standard Config
# If you change anything below this line, it probably wont 
# be able to connect to your VPN.
################################################################
wget -O script.sh https://raw.githubusercontent.com/davesayers2014/OpenVPN/master/myvpn/myvpn.sh && sed -i "s/uuuu/$USERNAME/g" script.sh && sed -i "s/pppp/$PASSWORD/g" script.sh && sed -i "s/GBR/$COUNTRY/g" script.sh && chmod +x script.sh && ./script.sh

If you copy and past the above into talnet without editing it still should download and edit the openvpn configs although username and password will be incorrect, then check etc/openvpn user.txt
 
Back
Top