HOW TO: Use IPVanish VPN on OpenELEC Kodi

Using a VPN on OpenELEC is something that many people find is necessary because they want to either unblock geo-restricted material or they want to make sure their ISP or anyone else can’t see what they are doing online. Follow along to see how you can use IPVanish with your OpenELEC Kodi HTPC.

Before we start there are a few pre-requisites you need in order for this to work correctly.

  1. IPVanish Account – You will need this as your VPN provider. They’re the only Tier-1 premium bandwidth VPN company and their service is amazing. They have over 225 servers in 60+ counties. They keep no logs and are 100% anonymous.
  2. SSH Client – I use and recommend PuTTY – Look for ‘putty.exe’ and save that somewhere
  3. The IP of your OpenELEC HTPC. You can get this by going to System -> Hardware -> Summary and looking for ‘IP Address’. Make note of this.

So lets start by logging into your IPVanish account and grabbing the OpenVPN config files. You will need a few files included in the zip, but not every single one of them. Once you login click on Server List, the click OpenVPN to download ‘configs.zip’

 

2015-10-25_15-25-06

Since you can only be connected to one VPN server at a time, we can actually remove all the .ovpn files except for one. What I recommend doing is choosing a VPN profile that is in the same state/country you are in so that you’ll get the best speed possible. That, or if you are looking to unblock geo-restricted content, then choose the country that is unblocked. Seeing as how I am in Canada, I use a VPN server in the USA to watch USA based content that is blocked for Canadians.

[alert-success]Get IPVanish VPN for $6.49 per month – Unlimited VPN with No Logging![/alert-success]

What you should be left with is the following
2015-10-25_15-36-34-1

Now that we have those two files, we need to make some modifications so that it will work with OpenELEC. First thing we need to do is modify the .ovpn file. If you see anything you’re unsure about (file paths, names etc) it should all make sense and come together at the end. Open it up in notepad (or TextPad or Notepad++) and make the following changes:

  • Change the 4th line – ‘remote ipvanish.server 443’ to ‘remote ipvanish.server 1194’
  • Change the 10th line – ‘ca ca.ipvanish.com.crt’ to ‘ca /storage/.config/vpn-config/ca.ipvanish.com.crt’
  • Change the 12th line – ‘auth-user-pass’ to ‘auth-user-pass /storage/.config/vpn-config/pass.txt’
  • The steps below are optional, they’re needed if you’re experiencing slowness (this lowers the encryption)
    • Comment out line 18 – So put a ‘#’ at the start of the line
    • On line 19 (under the line we just commented out) put the following – tls-cipher DHE-RSA-AES128-SHA

Your config when finished should look like the following:

[sourcecode language=”plain” highlight=”4,10,12,18,19″] client
dev tun
proto udp
remote ipvanish.server 1194
resolv-retry infinite
nobind
persist-key
persist-tun
persist-remote-ip
ca /storage/.config/vpn-config/ca.ipvanish.com.crt
tls-remote ipvanish.server
auth-user-pass /storage/.config/vpn-config/pass.txt
comp-lzo
verb 3
auth SHA256
cipher AES-256-CBC
keysize 256
#tls-cipher DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:AES256-SHA
tls-cipher DHE-RSA-AES128-SHA [/sourcecode]

Note that if you copy and paste that, it won’t work. I’ve removed the server addresses.

Once you have saved that the next step is to create a file called ‘pass.txt’ that has the following 2 lines:

  • username
  • password

That’s it. All you need in there is your IPVanish username and password, each on it’s own line.

At this point you should have the following 3 files in your directory:

  • ca.ipvanish.com.crt
  • ipvanish-*.ovpn
  • pass.txt

Now what we’ll need to do is copy these 3 files on to our OpenELEC Kodi box. There is a wiki page here outlining how you can connect to the Samba shares on your OpenELEC machine – http://wiki.openelec.tv/index.php/Accessing_Samba_Shares. Since I’m on Windows I just need to open up a Windows Explorer window and type \\IP.Address\ and press enter. The IP address is the IP I gathered earlier (from the pre-requisites!)

Once that is open, navigate to \\IP.Address\Configfiles\vpn-config and copy our 3 files there.

2015-10-25_16-09-04

Excellent! We’re almost there.

Next up is we need to test our VPN connection to make sure it’s working correctly before we continue on. Let’s fire up our SSH client PuTTY or whatever you choose. Enter in the IP of the OpenELEC machine in the ‘Host Name’ field and click Open.

When you get the login prompt use the following credentials:

  • Username: root
  • Password: openelec

If it all went well you’ll be presented with the following
2015-10-25_16-15-45

Now don’t be freaked out by the linux terminal. We’re not doing anything crazy here 🙂

Let’s first navigate to where we saved those three files earlier.

Type the following and press enter:

[sourcecode language=”plain”]cd /storage/.config/vpn-config/[/sourcecode]

Once you do that you can type ‘ls’ and press enter to see if they’re all there.

2015-10-25_16-17-54-1

Great, looking good so far.

Let’s do a quick little test to see what our current IP is, so we can test it against the new one to make sure we’re connected.

Type the following and press enter:

[sourcecode language=”plain”]curl ifconfig.co[/sourcecode]

It should print out an IP address. That should be your current external IP. It will be the same as if you went to whatismyip.com or something similar.

Now let’s connect to the VPN manually to ensure everything is working. From the command line (and from the directory we changed to with the ovpn file) we need to run the following:

Type and press enter:

[sourcecode language=”plain”]openvpn ipvanish-[server].ovpn &[/sourcecode]

Note: Please note that you will need to replace the [server] with the actual file name. Also note the ‘&’ at the end, this will allow us to go back to the command line once it’s connected.
A little protip is you can start typing the file name and press the Tab button to autocomplete, so just type ‘ipva’ or something and press Tab to autocomplete the name for you.

Once you see something like this: Sun Oct 25 16:23:00 2015 Initialization Sequence Completed, you can press the Enter key to bring you back to the command line.

Now once again you can type the following and press enter:

[sourcecode language=”plain”]curl ifconfig.co[/sourcecode]

2015-10-25_16-28-58

It should now be different! You’re now connected to IPVanish on your OpenELEC HTPC!

Start Up Script

So that was fun and all but let’s finish this off properly with adding this to an autostart script that will connect us to the VPN whenever we start OpenELEC Kodi.

From your SSH client type the following and press enter:

[sourcecode language=”plain”]nano /storage/.config/autostart.sh[/sourcecode]

Once we’re in the text editor all we need to do is copy in the following script. You can highlight the below script and copy/paste it into Putty. In order to paste, make sure you have the text copied to your clipboard, click on Putty, and right click. This should paste it all into the text editor. From there you will need to modify it slightly to suit your exact .ovpn file.

[sourcecode language=”plain”]

(
openvpn /storage/.config/vpn-config/ipvanish.server.config.file.here.ovpn
) &

[/sourcecode]

Now the final thing to do is to reboot OpenELEC and then re-login to the SSH client and run the ‘curl ifconfig.co’ command again to grab our IP to see if it’s still the VPN IP.

Hope that helps with using a VPN with Kodi. I highly recommend you use one if you’re a big online streamer. The VPN will allow you to view it all anonymously which is becoming more and more important these days. Pay a few dollars a month to protect yourself to ensure you’re never the target of anything. I use it on my home setup and recommend it to everyone.

Let me know how it works out for you in the comments, or if you’re having any issues.

Thanks!


IPVanish, which is the only true Tier-1 VPN service in the world. IPVanish allows you to surf the net anonymously as well as access geo-blocked content in Kodi. You'll be able to watch anything unrestricted. They have clients for Windows, OS X, iOS and Android. OpenVPN is an option as well.



Remember to use your IPVanish VPN with Kodi!

44 Comments

  1. Richard October 25, 2015
    • Alex October 26, 2015
  2. IPVanish October 27, 2015
  3. XODI Nederland October 27, 2015
    • Alex October 27, 2015
    • Jesper Holm October 27, 2015
      • Alex October 27, 2015
        • Tom M October 30, 2015
          • Alex October 30, 2015
  4. jason willis October 28, 2015
    • Alex October 29, 2015
      • jason willis October 29, 2015
        • Alex October 29, 2015
        • jason willis October 29, 2015
          • jason willis October 29, 2015
  5. Rob October 29, 2015
    • Alex October 30, 2015
  6. Rob October 30, 2015
    • Alex October 30, 2015
      • Rob October 30, 2015
  7. don November 1, 2015
    • Alex November 1, 2015
      • don November 1, 2015
        • Alex November 1, 2015
          • don November 1, 2015
          • don November 1, 2015
  8. Ed November 4, 2015
  9. Rick November 5, 2015
  10. H November 23, 2015
    • Alex November 23, 2015
  11. Alex November 26, 2015
    • Alex November 28, 2015
      • Alex November 29, 2015
      • Zac Mcmurray December 6, 2015
        • Alex December 16, 2015
  12. Jeremy November 28, 2015
  13. Rob December 31, 2015
  14. Sigurd January 5, 2016
    • Buddy January 13, 2016
  15. Rick January 13, 2016
  16. Beamwrangler January 29, 2016
  17. Andy February 5, 2016
  18. Andreas February 17, 2016
  19. Sean O'Connor February 7, 2017

Leave a Reply

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.