Changes

From Amahi Wiki
Jump to: navigation, search
3,196 bytes added ,  17:33, 15 June 2016
<br>We are going to connect your HDA through a VPN tunnel to Ipvanish's servers. We will ssh into your HDA, show your current IP addresses Geo location and then connect to Ipvanish's servers and show the geolocation again. I will also introduce you to ways on how to check that your HDA is definitely connected by using a shell based text browser called lynx. Connecting is not a problem as such. I have yet to find a clean way to disconnect the VPN tunnel. in the last part of this tutorial we will disconnect from the VPN tunnel manually ( the hard way).
== what What is Ipvanish ==Ipvanish is a service that allows you to connect through a secure VPN tunnel and change your locations IP address. this is in particular useful if you need to browse something that is not accessible for your country location. read more about IPvanish here [https://ipvanish.comhere]
== Prerequisites ==
- This tutorial assumes that you are running your Amahi HDA headless on version 9 based on fedora 23. Installation instructions can be found here [https://wiki.amahi.org/index.php/Amahi_9_Installhere]<br>- You have Openvpn server installed. ( for this tutorial we purchased the amahi app for openvpn). can be purchased here [https://www.amahi.org/apps/openvpnhere]
<br>- Please understand that this tutorial is not perfect as closing the VPN tunnel still requires some manual work.
<br>- I am currently working on a shell script that will allow you to connect , show the status of your geolocation and disconnect.
== Getting your config files ==
<p>You will need to browse on another computer to the location of Ipvanish's config files and decide which location config file you would like to use. please see here [http://www.ipvanish.com/software/configs/here ]
<br> For this example I have used ipvanish-NL-Amsterdam-ams-a17.ovpn. You will also need the certificate file ca.ipvanish.com.crt
<br>
<br><code> cd ipvanish</code><br>
<br> now lets download the files
<br><code>wget <nowiki>http://www.ipvanish.com/software/configs/ca.ipvanish.com.crt </nowiki></code><br><code>wget <nowiki>http://www.ipvanish.com/software/configs/ipvanish-NL-Amsterdam-ams-a17.ovpn</nowiki></code>
== Connecting to your VPN ==
<br><br>
issue the following command
<br><code>sudo openvpn --config ipvanish-NL-Amsterdam-ams-a17.ovpn</code>. <br>of course replace your server config name with the one you have chosen.<br>You will be firstly asked to input your HDA's super user password and then the script will run. At some point during the script you will be prompted for your Ipvanish username and password.
<br>
<br>You are now connected. The shell window will show a bunch of code. you will not be able to enter any code to it. Just close the Shell window.
 
== Confirming your Ipvanish VPN connection ==
There are a couple ways to check wether your connection to Ipvanish's servers has really happened. I will show you a couple ways below<br>
<br>- Using freegeoip.net
<br><br> firstly lets get our wan IP address.
<br> Issue the following command whilst logged into shell.
<br> <code>dig +short myip.opendns.com @resolver1.opendns.com</code>
<br><br>
this will show you you current wan IP address. <br>in the example above it shows <code>81.171.81.95</code>
<br><br>Using freegeoip.net we are going to see what the location of this IP address is by issuing the following command
<br>
<code>curl freegeoip.net/xml/81.171.81.95</code>
<br>this will display the location of the server and you will see that you are now connected through a different country.
<code>
 
<Response>
<br><IP>81.171.81.95</IP>
<br><CountryCode>US</CountryCode>
<br><CountryName>United States</CountryName>
<br><RegionCode>NY</RegionCode>
<br><RegionName>New York</RegionName>
<br><City>New York</City>
<br><ZipCode>10118</ZipCode>
<br><TimeZone>America/New_York</TimeZone>
<br><Latitude>40.7143</Latitude>
<br><Longitude>-74.006</Longitude>
<br><MetroCode>501</MetroCode>
<br></Response>
 
</code>
 
<br>- The second way you can confirm that you are connected to Ipvanish VPN is Using a terminal based text browser Lynx.
<br>If the site is blocked by your ISP's warning message using Lynx we can browse and see the warning message. Once connected to Ipvanish VPN you can browse the blocked website again and see that the warning message is no longer there and you can visit the site.
</p>Lynx is not installed by default so we will have to install this application
 
issue the following command
<br><code> sudo dnf install lynx</code>
<p>Once the application is installed you can browse the web using your shell terminal as follows
 
<br>Issue the following command <code> lynx <nowiki>http://www.google.com</nowiki></code>
<br><br> of course google is not on anyone's blocked list. So please check [https://en.wikipedia.org/wiki/List_of_websites_blocked_in_the_United_Kingdom here] for sites that are blocked by ISP's and confirm that you can browse them without any block message.
 
<br><br> - Alternatively you can always logon to your Amahi control panel <nowiki>https://www.amahi.org/users</nowiki> and under the section Alerts you can see that your Wan IP address of your HDA has changed.
 
== Disconnecting Ipvanish VPN ==
As mentioned before disconnecting the VPN tunnel is a little troublesome as it doesn't disconnect in an easy way.
<br> we need to find the VPN tunnel connection and then using a Kill command stop it
 
<br> Issue the following command in your shell console
<br><code>ifconfig</code>
<br>look out for a connection named tun0 or tun1 that looks like this <POINTOPOINT,NOARP,MULTICAST>.
</p> once we have identified the connection we simply kill it by issuing the following command
<code>sudo ifconfig tun0 down</code>
<br> or
<br><code>sudo ifconfig tun1 down</code>
 
<br> Using the section above 'Confirming your Ipvanish VPN connection' you will be able to check that you are back on your ISP's wan IP.
Trusted, Bots, Bureaucrats, emailconfirmed, Administrators
3,789

edits