<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.amahi.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Arthur</id>
	<title>Amahi Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.amahi.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Arthur"/>
	<link rel="alternate" type="text/html" href="https://wiki.amahi.org/index.php/Special:Contributions/Arthur"/>
	<updated>2026-05-02T19:32:43Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://wiki.amahi.org/index.php?title=OpenVPN&amp;diff=89396</id>
		<title>OpenVPN</title>
		<link rel="alternate" type="text/html" href="https://wiki.amahi.org/index.php?title=OpenVPN&amp;diff=89396"/>
		<updated>2014-11-06T20:40:41Z</updated>

		<summary type="html">&lt;p&gt;Arthur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Going forward, you will need to install the Amahi [http://www.amahi.org/apps/openvpn OpenVPN] application.&lt;br /&gt;
&lt;br /&gt;
'''You need to forward one port (1194/UDP) to your HDA's IP''' to enable your OpenVPN service from outside your network.&lt;br /&gt;
&lt;br /&gt;
You will also need client software.&lt;br /&gt;
&lt;br /&gt;
Once connected from outside your network, your computer becomes virtually a computer in your home network. All your files and services are as easily accessible as when you are at home.&lt;br /&gt;
&lt;br /&gt;
'''NEW! You can now use your amahi.org [https://www.amahi.org/user control panel] to test your VPN remotely!'''&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
There are two requirements for Remote Access to work:&lt;br /&gt;
&lt;br /&gt;
* On the client side, you need to be running a client&lt;br /&gt;
** We provide one for Windows, pre-configured for Amahi&lt;br /&gt;
** We recommend one for the Mac, which requires some manual configuration&lt;br /&gt;
** The client for Linux comes with most distros and uses the same settings as the Mac&lt;br /&gt;
* Your router needs to forward '''UDP port 1194''' to the IP address of your HDA. The way to do this is through port forwarding, which varies from router to router. Make sure you forward UDP (not TCP)&lt;br /&gt;
&lt;br /&gt;
= OpenVPN Clients  =&lt;br /&gt;
&lt;br /&gt;
Check the page for [[OpenVPN clients]].&lt;br /&gt;
&lt;br /&gt;
= Port Forwarding References =&lt;br /&gt;
&lt;br /&gt;
* Massive database of [http://www.portforward.com/english/routers/port_forwarding/routerindex.htm port forwarding] information by router.&lt;br /&gt;
* [http://www.youtube.com/watch?v=GWPUdW1kIJA YouTube Video] on Port Forwarding for Linksys Routers.&lt;br /&gt;
&lt;br /&gt;
= Bridging VPN and eth0 =&lt;br /&gt;
&lt;br /&gt;
If you'd like your VPN clients to get IP addresses in the same subnet as your HDA, and not in the 10.8.0.0/24 subnet (default), read this page: [[VPN Bridging]].&lt;br /&gt;
&lt;br /&gt;
= IP Forwarding (Ubuntu) =&lt;br /&gt;
&lt;br /&gt;
Something that is often asked on the forums is how to have access to your remote LAN's resources while connected to your HDA.  One way to accomplish this is through bridging VPN and eth0 on your HDA.  This process may not be necessary for some users and a script has been developed by user olson of the forum to accomplish this task.  Not only with this script allow for a user to browse to their remote LAN's resources, the user will also be able to browse the internet while connected to their VPN.  Below is the script and instructions for how to run it.  Please keep in mind that this is for Ubuntu based HDA's ONLY.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/bin/bash&lt;br /&gt;
log_file=&amp;quot;/tmp/openvpn_extra.log&amp;quot;&lt;br /&gt;
&lt;br /&gt;
function log()&lt;br /&gt;
{&lt;br /&gt;
  echo -e &amp;quot;$(date +%b\ %d\ %H:%M:%S) $(hostname -s) openvpn_extra: $@&amp;quot; &amp;gt;&amp;gt; $log_file&lt;br /&gt;
  echo -e &amp;quot;$(date +%b\ %d\ %H:%M:%S) $(hostname -s) openvpn_extra: $@&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Enable it right now&lt;br /&gt;
if ! echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward; then&lt;br /&gt;
  log &amp;quot;FATAL: could not enable ip_forward for immediate use&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if ! iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE; then&lt;br /&gt;
  log &amp;quot;FATAL: could not set iptables for immediate use&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#set it up so it does it at startup&lt;br /&gt;
if ! sed -i 's/#net.ipv4.ip_forward=.*\+/net.ipv4.ip_forward=1/' /etc/sysctl.conf; then&lt;br /&gt;
  log &amp;quot;FATAL: could not set ip_forward permanantly&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
if ! sh -c &amp;quot;iptables-save &amp;gt; /etc/iptables.rules&amp;quot;; then&lt;br /&gt;
  log &amp;quot;FATAL: could not set iptables permanantly&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
sudo cat &amp;gt; /etc/network/if-pre-up.d/iptablesload &amp;lt;&amp;lt;EOF&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
iptables-restore &amp;lt; /etc/iptables.rules&lt;br /&gt;
exit 0&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
sudo cat &amp;gt; /etc/network/if-post-down.d/iptablessave &amp;lt;&amp;lt;EOF&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
iptables-save -c &amp;gt; /etc/iptables.rules&lt;br /&gt;
if [ -f /etc/iptables.downrules ]; then&lt;br /&gt;
   iptables-restore &amp;lt; /etc/iptables.downrules&lt;br /&gt;
fi&lt;br /&gt;
exit 0&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
if ! chmod +x /etc/network/if-post-down.d/iptablessave; then&lt;br /&gt;
  log &amp;quot;FATAL: Could not chmod the iptablessave script&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
if ! chmod +x /etc/network/if-pre-up.d/iptablesload; then&lt;br /&gt;
  log &amp;quot;FATAL: Could not chmod the iptablesload script&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Done&amp;quot;&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can then run the script with the following command from the CLI:&lt;br /&gt;
&lt;br /&gt;
 sudo bash openvpn_extra.sh&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
Check out the [[OpenVPN troubleshooting]] page for troubleshooting tips.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
The VPN solution is implemented through the very popular [http://openvpn.net/ OpenVPN] software VPN.&lt;br /&gt;
&lt;br /&gt;
[[Category: Services]]&lt;br /&gt;
[[Category: VPN]]&lt;/div&gt;</summary>
		<author><name>Arthur</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.amahi.org/index.php?title=OpenVPN_custom_certificates&amp;diff=89391</id>
		<title>OpenVPN custom certificates</title>
		<link rel="alternate" type="text/html" href="https://wiki.amahi.org/index.php?title=OpenVPN_custom_certificates&amp;diff=89391"/>
		<updated>2014-11-06T20:39:59Z</updated>

		<summary type="html">&lt;p&gt;Arthur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The default OpenVPN install for Amahi will work with the certificates provided on the wiki, however there are a couple of reasons you may not want to use these.  One, you can only have one client connected to the VPN at a time with these certificates and two, security best practices would advise against allowing the same certificate for all devices.  Follow the instructions below to reconfigure your OpenVPN instance for use with multiple certificates.  All commands are issued from the CLI as the root user unless noted otherwise.&lt;br /&gt;
&lt;br /&gt;
Step 1: Copy the necessary easy-rsa files to the openvpn directory in etc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cp –r /usr/share/doc/openvpn/examples/easy-rsa/2.0 /etc/openvpn/easy-rsa&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 2: Navigate to the directory you just copied&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /etc/openvpn/easy-rsa&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 3: Backup, then modify the variables in the vars file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cp vars vars.backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates a backup of the original file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;nano vars&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the command we will use to modify the variables in the vars file&lt;br /&gt;
&lt;br /&gt;
The primary variable we are looking is (ctrl+w to search):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export EASY_RSA = “`pwd`”&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You want to change this variable to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export EASY_RSA=”/etc/openvpn/easy-rsa”&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OPTIONAL&lt;br /&gt;
&lt;br /&gt;
You can also change the cipher strength in this file.  If you wish to do this, the variable you are looking for is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export KEY_SIZE=1024&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can bump this number up to 2048 to increase security, however you may notice a decrease in speeds over the VPN if you do so.    &lt;br /&gt;
&lt;br /&gt;
Step 4: The next step here is to build your new CA on your server.  Issue the commands below:&lt;br /&gt;
&lt;br /&gt;
First, be sure you are still in the /etc/openvpn/easy-rsa directory.  Issuing the pwd command will display the directory you currently working in.  If it is anything other than /etc/openvpn/easy-rsa, issue the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /etc/openvpn/easy-rsa&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now issue the following commands to build the new CA:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;source ./vars&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command loads the vars file you modified in step 3.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./clean-all&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will remove anything in the /keys directory.  There is most likely nothing in the directory at this point (if there is, back it up!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./build-ca&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will build the CA.  You will be asked various questions, note that you do not need to modify any of these values.  You can just hit enter and it will use the default displayed values.&lt;br /&gt;
&lt;br /&gt;
Step 5: We now build the keys for the server with the following commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;./build-key-server [HDA NAME HERE (no brackets)]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will again be asked many questions.  Default values should all be OK.  Ensure that the 'common name' lines up with the HDA name you typed previously.&lt;br /&gt;
&lt;br /&gt;
When asked for a challenge password, leave it blank&lt;br /&gt;
&lt;br /&gt;
When asked to sign the certificate, type y&lt;br /&gt;
&lt;br /&gt;
When asked to commit, type y&lt;br /&gt;
&lt;br /&gt;
Step 6: Create certificates for each of your clients with the commands below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./build-key-pass UserName(or client name, or whatever will identify this for you)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enter a PEM password and confirm.  This can be whatever you want.&lt;br /&gt;
&lt;br /&gt;
You will be asked many questions again.  You can leave these at the default values or modify them if you wish.&lt;br /&gt;
&lt;br /&gt;
When asked for a challenge password, leave this field blank.&lt;br /&gt;
&lt;br /&gt;
When asked to sign the certificate, type y&lt;br /&gt;
&lt;br /&gt;
REPEAT THIS STEP FOR EACH CLIENT&lt;br /&gt;
&lt;br /&gt;
After you have created certs/keys for each of your clients, move on to the next step.&lt;br /&gt;
&lt;br /&gt;
Step 6:  The next step is to change the encryption method of the client keys to be used.  We will be using triple des in this tutorial, but you can use other encryption methods if you wish.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Cd keys&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command moves us to the keys directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Openssl rsa -in KEYNAMEFROMSTEP6.key -des3 -out KEYNAMEFROMSTEP6.3des.key&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command creates an encrypted key.  Keep in mind the original key will not be impacted when doing this.  You will be asked for a pass phrase.  Use whatever you wish here, but do not leave this blank.&lt;br /&gt;
&lt;br /&gt;
REPEAT THIS STEP FOR ALL THE KEYS CREATED IN STEP 6&lt;br /&gt;
&lt;br /&gt;
Once you have created your 3des keys, move on to the next step.&lt;br /&gt;
&lt;br /&gt;
Step 7:  This step will be to build the diffie-hellman key exchange for the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Cd /etc/openvpn/easy-rsa/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This moves us back to the easy-rsa directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./build-dh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Depending on your system specs this can take some time, but it is typically pretty fast.&lt;br /&gt;
&lt;br /&gt;
Step 8:  Now we will generate an HMAC key for DoS protection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Openvpn --genkey --secret keys/ta.key&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that copying and pasting this command may cause formatting issues.  The lines in the command need to be two hyphens back to back without spaces.&lt;br /&gt;
&lt;br /&gt;
OK, now we are getting close to the home stretch.&lt;br /&gt;
&lt;br /&gt;
Step 9: In this step we will backup then modify the openvpn.conf file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Cd /etc/openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change directory to the openvpn directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cp openvpn.conf openvpn.conf.backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This backs up the default config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;nano openvpn.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use this [http://fpaste.org/136131/11574407/ config file] as a template.  You will need to change the indicated fields as necessary.  You will need to setup IP forwarding if you wish to browse LAN devices and the internet while on the VPN.  This information can be found elsewhere in the Amahi wiki.&lt;br /&gt;
&lt;br /&gt;
Step 10: In this step we will create a template file for a script to create ovpn files.&lt;br /&gt;
&lt;br /&gt;
Use [http://fpaste.org/136132/ this file] as a template.  Name the file Default.txt&lt;br /&gt;
&lt;br /&gt;
Step 11:  In this step we will download a script to create your ovpn files for you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Cd /etc/openvpn/easy-rsa/keys&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First we move to the keys directory&lt;br /&gt;
&lt;br /&gt;
Download [https://gist.github.com/laurenorsini/10013430 this script] to the keys directory and call it makeovpn.sh&lt;br /&gt;
&lt;br /&gt;
Now we need to make the script executable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;chmod +x makeovpn.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 12: Run the script created in step 12 for each client you created in step 6.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./makeovpn.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the script runs it will ask you for a client name you created in step 6.  Enter the name and press enter.  You may see some errors, but the file should still be created and be usable.&lt;br /&gt;
&lt;br /&gt;
And that is it.  You have now got everything you need to connect multiple clients to your VPN.  &lt;br /&gt;
&lt;br /&gt;
The following link was used as a primary source for the bulk of this tutorial:&lt;br /&gt;
&lt;br /&gt;
[http://readwrite.com/2014/04/10/raspberry-pi-vpn-tutorial-server-secure-web-browsing Raspberry Pi VPN Tutorial]&lt;/div&gt;</summary>
		<author><name>Arthur</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.amahi.org/index.php?title=OpenVPN&amp;diff=89381</id>
		<title>OpenVPN</title>
		<link rel="alternate" type="text/html" href="https://wiki.amahi.org/index.php?title=OpenVPN&amp;diff=89381"/>
		<updated>2014-11-06T01:21:40Z</updated>

		<summary type="html">&lt;p&gt;Arthur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Going forward, you will need to install the Amahi [http://www.amahi.org/apps/openvpn OpenVPN] application.&lt;br /&gt;
&lt;br /&gt;
'''You need to forward one port (1194/UDP) to your HDA's IP''' to enable your OpenVPN service from outside your network.&lt;br /&gt;
&lt;br /&gt;
You will also need client software.&lt;br /&gt;
&lt;br /&gt;
Once connected from outside your network, your computer becomes virtually a computer in your home network. All your files and services are as easily accessible as when you are at home.&lt;br /&gt;
&lt;br /&gt;
'''NEW! You can now use your amahi.org [https://www.amahi.org/user control panel] to test your VPN remotely!'''&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
There are two requirements for Remote Access to work:&lt;br /&gt;
&lt;br /&gt;
* On the client side, you need to be running a client&lt;br /&gt;
** We provide one for Windows, pre-configured for Amahi&lt;br /&gt;
** We recommend one for the Mac, which requires some manual configuration&lt;br /&gt;
** The client for Linux comes with most distros and uses the same settings as the Mac&lt;br /&gt;
* Your router needs to forward '''UDP port 1194''' to the IP address of your HDA. The way to do this is through port forwarding, which varies from router to router. Make sure you forward UDP (not TCP)&lt;br /&gt;
&lt;br /&gt;
= OpenVPN Clients  =&lt;br /&gt;
&lt;br /&gt;
Check the page for [[OpenVPN clients]].&lt;br /&gt;
&lt;br /&gt;
= Port Forwarding References =&lt;br /&gt;
&lt;br /&gt;
* Massive database of [http://www.portforward.com/english/routers/port_forwarding/routerindex.htm port forwarding] information by router.&lt;br /&gt;
* [http://www.youtube.com/watch?v=GWPUdW1kIJA YouTube Video] on Port Forwarding for Linksys Routers.&lt;br /&gt;
&lt;br /&gt;
= Bridging VPN and eth0 =&lt;br /&gt;
&lt;br /&gt;
If you'd like your VPN clients to get IP addresses in the same subnet as your HDA, and not in the 10.8.0.0/24 subnet (default), read this page: [[VPN Bridging]].&lt;br /&gt;
&lt;br /&gt;
= IP Forwarding (Ubuntu) =&lt;br /&gt;
&lt;br /&gt;
Something that is often asked on the forums is how to have access to your remote LAN's resources while connected to your HDA.  One way to accomplish this is through bridging VPN and eth0 on your HDA.  This process may not be necessary for some users and a script has been developed by user olson of the forum to accomplish this task.  Not only with this script allow for a user to browse to their remote LAN's resources, the user will also be able to browse the internet while connected to their VPN.  Below is the script and instructions for how to run it.  Please keep in mind that this is for Ubuntu based HDA's ONLY.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/bin/bash&lt;br /&gt;
log_file=&amp;quot;/tmp/openvpn_extra.log&amp;quot;&lt;br /&gt;
&lt;br /&gt;
function log()&lt;br /&gt;
{&lt;br /&gt;
  echo -e &amp;quot;$(date +%b\ %d\ %H:%M:%S) $(hostname -s) openvpn_extra: $@&amp;quot; &amp;gt;&amp;gt; $log_file&lt;br /&gt;
  echo -e &amp;quot;$(date +%b\ %d\ %H:%M:%S) $(hostname -s) openvpn_extra: $@&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Enable it right now&lt;br /&gt;
if ! echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward; then&lt;br /&gt;
  log &amp;quot;FATAL: could not enable ip_forward for immediate use&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if ! iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE; then&lt;br /&gt;
  log &amp;quot;FATAL: could not set iptables for immediate use&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#set it up so it does it at startup&lt;br /&gt;
if ! sed -i 's/#net.ipv4.ip_forward=.*\+/net.ipv4.ip_forward=1/' /etc/sysctl.conf; then&lt;br /&gt;
  log &amp;quot;FATAL: could not set ip_forward permanantly&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
if ! sh -c &amp;quot;iptables-save &amp;gt; /etc/iptables.rules&amp;quot;; then&lt;br /&gt;
  log &amp;quot;FATAL: could not set iptables permanantly&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
sudo cat &amp;gt; /etc/network/if-pre-up.d/iptablesload &amp;lt;&amp;lt;EOF&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
iptables-restore &amp;lt; /etc/iptables.rules&lt;br /&gt;
exit 0&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
sudo cat &amp;gt; /etc/network/if-post-down.d/iptablessave &amp;lt;&amp;lt;EOF&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
iptables-save -c &amp;gt; /etc/iptables.rules&lt;br /&gt;
if [ -f /etc/iptables.downrules ]; then&lt;br /&gt;
   iptables-restore &amp;lt; /etc/iptables.downrules&lt;br /&gt;
fi&lt;br /&gt;
exit 0&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
if ! chmod +x /etc/network/if-post-down.d/iptablessave; then&lt;br /&gt;
  log &amp;quot;FATAL: Could not chmod the iptablessave script&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
if ! chmod +x /etc/network/if-pre-up.d/iptablesload; then&lt;br /&gt;
  log &amp;quot;FATAL: Could not chmod the iptablesload script&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Done&amp;quot;&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can then run the script with the following command from the CLI:&lt;br /&gt;
&lt;br /&gt;
 sudo bash openvpn_extra.sh&lt;br /&gt;
&lt;br /&gt;
= Generating your own certificates in OpenVPN for Amahi =&lt;br /&gt;
&lt;br /&gt;
The default OpenVPN install for Amahi will work with the certificates provided on the wiki, however there are a couple of reasons you may not want to use these.  One, you can only have one client connected to the VPN at a time with these certificates and two, security best practices would advise against allowing the same certificate for all devices.  Follow the instructions below to reconfigure your OpenVPN instance for use with multiple certificates.  All commands are issued from the CLI as the root user unless noted otherwise.&lt;br /&gt;
&lt;br /&gt;
Step 1: Copy the necessary easy-rsa files to the openvpn directory in etc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cp –r /usr/share/doc/openvpn/examples/easy-rsa/2.0 /etc/openvpn/easy-rsa&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 2: Navigate to the directory you just copied&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /etc/openvpn/easy-rsa&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 3: Backup, then modify the variables in the vars file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cp vars vars.backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates a backup of the original file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;nano vars&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the command we will use to modify the variables in the vars file&lt;br /&gt;
&lt;br /&gt;
The primary variable we are looking is (ctrl+w to search):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export EASY_RSA = “`pwd`”&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You want to change this variable to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export EASY_RSA=”/etc/openvpn/easy-rsa”&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OPTIONAL&lt;br /&gt;
&lt;br /&gt;
You can also change the cipher strength in this file.  If you wish to do this, the variable you are looking for is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export KEY_SIZE=1024&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can bump this number up to 2048 to increase security, however you may notice a decrease in speeds over the VPN if you do so.    &lt;br /&gt;
&lt;br /&gt;
Step 4: The next step here is to build your new CA on your server.  Issue the commands below:&lt;br /&gt;
&lt;br /&gt;
First, be sure you are still in the /etc/openvpn/easy-rsa directory.  Issuing the pwd command will display the directory you currently working in.  If it is anything other than /etc/openvpn/easy-rsa, issue the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /etc/openvpn/easy-rsa&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now issue the following commands to build the new CA:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;source ./vars&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command loads the vars file you modified in step 3.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./clean-all&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will remove anything in the /keys directory.  There is most likely nothing in the directory at this point (if there is, back it up!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./build-ca&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will build the CA.  You will be asked various questions, note that you do not need to modify any of these values.  You can just hit enter and it will use the default displayed values.&lt;br /&gt;
&lt;br /&gt;
Step 5: We now build the keys for the server with the following commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;./build-key-server [HDA NAME HERE (no brackets)]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will again be asked many questions.  Default values should all be OK.  Ensure that the 'common name' lines up with the HDA name you typed previously.&lt;br /&gt;
&lt;br /&gt;
When asked for a challenge password, leave it blank&lt;br /&gt;
&lt;br /&gt;
When asked to sign the certificate, type y&lt;br /&gt;
&lt;br /&gt;
When asked to commit, type y&lt;br /&gt;
&lt;br /&gt;
Step 6: Create certificates for each of your clients with the commands below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./build-key-pass UserName(or client name, or whatever will identify this for you)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enter a PEM password and confirm.  This can be whatever you want.&lt;br /&gt;
&lt;br /&gt;
You will be asked many questions again.  You can leave these at the default values or modify them if you wish.&lt;br /&gt;
&lt;br /&gt;
When asked for a challenge password, leave this field blank.&lt;br /&gt;
&lt;br /&gt;
When asked to sign the certificate, type y&lt;br /&gt;
&lt;br /&gt;
REPEAT THIS STEP FOR EACH CLIENT&lt;br /&gt;
&lt;br /&gt;
After you have created certs/keys for each of your clients, move on to the next step.&lt;br /&gt;
&lt;br /&gt;
Step 6:  The next step is to change the encryption method of the client keys to be used.  We will be using triple des in this tutorial, but you can use other encryption methods if you wish.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Cd keys&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command moves us to the keys directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Openssl rsa -in KEYNAMEFROMSTEP6.key -des3 -out KEYNAMEFROMSTEP6.3des.key&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command creates an encrypted key.  Keep in mind the original key will not be impacted when doing this.  You will be asked for a pass phrase.  Use whatever you wish here, but do not leave this blank.&lt;br /&gt;
&lt;br /&gt;
REPEAT THIS STEP FOR ALL THE KEYS CREATED IN STEP 6&lt;br /&gt;
&lt;br /&gt;
Once you have created your 3des keys, move on to the next step.&lt;br /&gt;
&lt;br /&gt;
Step 7:  This step will be to build the diffie-hellman key exchange for the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Cd /etc/openvpn/easy-rsa/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This moves us back to the easy-rsa directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./build-dh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Depending on your system specs this can take some time, but it is typically pretty fast.&lt;br /&gt;
&lt;br /&gt;
Step 8:  Now we will generate an HMAC key for DoS protection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Openvpn --genkey --secret keys/ta.key&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that copying and pasting this command may cause formatting issues.  The lines in the command need to be two hyphens back to back without spaces.&lt;br /&gt;
&lt;br /&gt;
OK, now we are getting close to the home stretch.&lt;br /&gt;
&lt;br /&gt;
Step 9: In this step we will backup then modify the openvpn.conf file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Cd /etc/openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change directory to the openvpn directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cp openvpn.conf openvpn.conf.backup&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This backs up the default config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;nano openvpn.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use this [http://fpaste.org/136131/11574407/ config file] as a template.  You will need to change the indicated fields as necessary.  You will need to setup IP forwarding if you wish to browse LAN devices and the internet while on the VPN.  This information can be found elsewhere in the Amahi wiki.&lt;br /&gt;
&lt;br /&gt;
Step 10: In this step we will create a template file for a script to create ovpn files.&lt;br /&gt;
&lt;br /&gt;
Use [http://fpaste.org/136132/ this file] as a template.  Name the file Default.txt&lt;br /&gt;
&lt;br /&gt;
Step 11:  In this step we will download a script to create your ovpn files for you.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Cd /etc/openvpn/easy-rsa/keys&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First we move to the keys directory&lt;br /&gt;
&lt;br /&gt;
Download [https://gist.github.com/laurenorsini/10013430 this script] to the keys directory and call it makeovpn.sh&lt;br /&gt;
&lt;br /&gt;
Now we need to make the script executable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;chmod +x makeovpn.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 12: Run the script created in step 12 for each client you created in step 6.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./makeovpn.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the script runs it will ask you for a client name you created in step 6.  Enter the name and press enter.  You may see some errors, but the file should still be created and be usable.&lt;br /&gt;
&lt;br /&gt;
And that is it.  You have now got everything you need to connect multiple clients to your VPN.  &lt;br /&gt;
&lt;br /&gt;
The following link was used as a primary source for the bulk of this tutorial:&lt;br /&gt;
&lt;br /&gt;
[http://readwrite.com/2014/04/10/raspberry-pi-vpn-tutorial-server-secure-web-browsing Raspberry Pi VPN Tutorial]&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
Check out the [[OpenVPN troubleshooting]] page for troubleshooting tips.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
The VPN solution is implemented through the very popular [http://openvpn.net/ OpenVPN] software VPN.&lt;br /&gt;
&lt;br /&gt;
[[Category: Services]]&lt;br /&gt;
[[Category: VPN]]&lt;/div&gt;</summary>
		<author><name>Arthur</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.amahi.org/index.php?title=OpenVPN_clients&amp;diff=78362</id>
		<title>OpenVPN clients</title>
		<link rel="alternate" type="text/html" href="https://wiki.amahi.org/index.php?title=OpenVPN_clients&amp;diff=78362"/>
		<updated>2014-03-10T22:17:37Z</updated>

		<summary type="html">&lt;p&gt;Arthur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To connect to your network from the outside, you will need an OpenVPN client installed on the computer from which you want to connect to your network.&lt;br /&gt;
&lt;br /&gt;
There are clients For Windows, Mac and Linux:&lt;br /&gt;
&lt;br /&gt;
* [[VPNWindows|Windows Client]]: customized for Amahi to be ultra-easy to use&lt;br /&gt;
* Mac clients: [[VPNMacTunnelBlick|TunnelBlick]] (open source) or [[VPNMacViscosity|Viscosity]] (pay client, very nice)&lt;br /&gt;
* [[VPNLinux|Linux]]: (in general) and [[VPN Ubuntu|Ubuntu via GUI]]&lt;br /&gt;
* [[VPNAndroid|Android]]: VPN access on the Android phones&lt;br /&gt;
* [[OpenVPN_on_iOS|iOS]]: VPN access on the iPhone/iPod/iPad&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE: ''' you cannot really connect to your network and test your VPN from *inside* your network&lt;br /&gt;
&lt;br /&gt;
Also, the network from which you connect to your network '''cannot''' be identical because the VPN cannot route packets in that situation. E.g. if your network at home is 192.168.1.* and the network from which you are connecting is also configured at 192.168.1.*, it will not work.&lt;br /&gt;
&lt;br /&gt;
[[Category: VPN]]&lt;/div&gt;</summary>
		<author><name>Arthur</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.amahi.org/index.php?title=OpenVPN_clients&amp;diff=78356</id>
		<title>OpenVPN clients</title>
		<link rel="alternate" type="text/html" href="https://wiki.amahi.org/index.php?title=OpenVPN_clients&amp;diff=78356"/>
		<updated>2014-03-10T22:15:38Z</updated>

		<summary type="html">&lt;p&gt;Arthur: Undo revision 78350 by Arthur (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To connect to your network from the outside, you will need an OpenVPN client installed on the computer from which you want to connect to your network.&lt;br /&gt;
&lt;br /&gt;
There are clients For Windows, Mac and Linux:&lt;br /&gt;
&lt;br /&gt;
* [[VPNWindows|Windows Client]]: customized for Amahi to be ultra-easy to use&lt;br /&gt;
* Mac clients: [[VPNMacTunnelBlick|TunnelBlick]] (open source) or [[VPNMacViscosity|Viscosity]] (pay client, very nice)&lt;br /&gt;
* [[VPNLinux|Linux]]: (in general) and [[VPN Ubuntu|Ubuntu via GUI]]&lt;br /&gt;
* [[VPNAndroid|Android]]: VPN access on the Android phones&lt;br /&gt;
* [[VPN Iphone|iPhone]]: VPN access on the iPhone/iPod/iPad&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE: ''' you cannot really connect to your network and test your VPN from *inside* your network&lt;br /&gt;
&lt;br /&gt;
Also, the network from which you connect to your network '''cannot''' be identical because the VPN cannot route packets in that situation. E.g. if your network at home is 192.168.1.* and the network from which you are connecting is also configured at 192.168.1.*, it will not work.&lt;br /&gt;
&lt;br /&gt;
[[Category: VPN]]&lt;/div&gt;</summary>
		<author><name>Arthur</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.amahi.org/index.php?title=OpenVPN_clients&amp;diff=78350</id>
		<title>OpenVPN clients</title>
		<link rel="alternate" type="text/html" href="https://wiki.amahi.org/index.php?title=OpenVPN_clients&amp;diff=78350"/>
		<updated>2014-03-10T22:15:02Z</updated>

		<summary type="html">&lt;p&gt;Arthur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To connect to your network from the outside, you will need an OpenVPN client installed on the computer from which you want to connect to your network.&lt;br /&gt;
&lt;br /&gt;
There are clients For Windows, Mac and Linux:&lt;br /&gt;
&lt;br /&gt;
* [[VPNWindows|Windows Client]]: customized for Amahi to be ultra-easy to use&lt;br /&gt;
* Mac clients: [[VPNMacTunnelBlick|TunnelBlick]] (open source) or [[VPNMacViscosity|Viscosity]] (pay client, very nice)&lt;br /&gt;
* [[VPNLinux|Linux]]: (in general) and [[VPN Ubuntu|Ubuntu via GUI]]&lt;br /&gt;
* [[VPNAndroid|Android]]: VPN access on the Android phones&lt;br /&gt;
* [[OpenVPN on iOS|iOS]]: VPN access on the iPhone/iPod/iPad&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE: ''' you cannot really connect to your network and test your VPN from *inside* your network&lt;br /&gt;
&lt;br /&gt;
Also, the network from which you connect to your network '''cannot''' be identical because the VPN cannot route packets in that situation. E.g. if your network at home is 192.168.1.* and the network from which you are connecting is also configured at 192.168.1.*, it will not work.&lt;br /&gt;
&lt;br /&gt;
[[Category: VPN]]&lt;/div&gt;</summary>
		<author><name>Arthur</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.amahi.org/index.php?title=OpenVPN_on_iOS&amp;diff=78344</id>
		<title>OpenVPN on iOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.amahi.org/index.php?title=OpenVPN_on_iOS&amp;diff=78344"/>
		<updated>2014-03-10T22:07:51Z</updated>

		<summary type="html">&lt;p&gt;Arthur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OpenVPN on iOS (not jailbroken)=&lt;br /&gt;
&lt;br /&gt;
There is now an OpenVPN app in the app store that is free.  The iOS app can be downloaded from here:&lt;br /&gt;
&lt;br /&gt;
[https://itunes.apple.com/us/app/openvpn-connect/id590379981?mt=8 iOS OpenVPN app]&lt;br /&gt;
&lt;br /&gt;
To setup your connection to your HDA, perform the following steps:&lt;br /&gt;
&lt;br /&gt;
First create your ovpn file using the following (the order that these items come in is VERY important) configuration:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
client&lt;br /&gt;
dev tun&lt;br /&gt;
proto udp&lt;br /&gt;
remote XXXX.yourhda.com 1194&lt;br /&gt;
resolv-retry infinite&lt;br /&gt;
nobind&lt;br /&gt;
persist-key&lt;br /&gt;
persist-tun&lt;br /&gt;
auth-user-pass&lt;br /&gt;
ca Ca-cert.crt&lt;br /&gt;
cert AmahiHDAClient.crt&lt;br /&gt;
key AmahiHDAClient.key&lt;br /&gt;
comp-lzo&lt;br /&gt;
verb 3&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Be sure to replace the XXXX to whatever your ddns name for your HDA is.  Save this file as whatever you want with the .ovpn file extension.  The next step is to download the certificates.  The certificates can be found below (to download, right click &amp;gt; save as):&lt;br /&gt;
&lt;br /&gt;
* [http://dl.amahi.org/vpn/AmahiHDAClient.crt AmahiHDAClient.crt]&lt;br /&gt;
* [http://dl.amahi.org/vpn/AmahiHDAClient.key AmahiHDAClient.key]&lt;br /&gt;
* [http://dl.amahi.org/vpn/ca-cert.crt ca-cert.crt]&lt;br /&gt;
&lt;br /&gt;
If you rename these certificates you will need to modify the ovpn file with the names that you saved your certs as.  You are now ready to copy your files over to your iOS device.  The steps at the following page will point you in the right direction for importing the ovpn and cert files over to your iOS device.&lt;br /&gt;
&lt;br /&gt;
[https://www.ivpn.net/knowledgebase/90/-iPhone---OpenVPN-Connect-Setup-Guide.html iOS OpenVPN]&lt;br /&gt;
&lt;br /&gt;
=OpenVPN on iOS (jailbroken) **OLD DOCUMENTATION, MAY NO LONGER BE VALID**=&lt;br /&gt;
&lt;br /&gt;
From the original [http://forums.amahi.org/viewtopic.php?f=3&amp;amp;t=1508&amp;amp;start=0 iPhone VPN] thread in the forums:&lt;br /&gt;
&lt;br /&gt;
For all of you out there that have an iPhone or any other mobile &amp;quot;idevice&amp;quot; And want VPN access I have found a way. The catch is, you have to have a jail broken device. If you do have a jail broken device and want the openvpn app on the phone you will want to check out www.guizmovpn.com  it's about 4€. The evaluation period is a full week. But the price is worth it.&lt;br /&gt;
&lt;br /&gt;
To configure the client you will need to follow the guide on www.guizmovpn.com The client info you will need to get from the wiki here http://wiki.amahi.org/index.php/VPNLinux&lt;br /&gt;
&lt;br /&gt;
I have also created a full guide custom tailored to amahi vpn access. &lt;br /&gt;
It might seem like a little to much or a hassle but its really simple. It just takes the time to read. http://home.mchsi.com/~irish-link/GuizmOVPN.pdf&lt;br /&gt;
&lt;br /&gt;
If you go to set it up and have issues please head over to the forum (liked at the top) and let me know if you need help. If you do end up setting it up, let me know how it works for you.&lt;br /&gt;
[[Category: VPN]]&lt;/div&gt;</summary>
		<author><name>Arthur</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.amahi.org/index.php?title=OpenVPN_on_iOS&amp;diff=78320</id>
		<title>OpenVPN on iOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.amahi.org/index.php?title=OpenVPN_on_iOS&amp;diff=78320"/>
		<updated>2014-03-08T05:12:34Z</updated>

		<summary type="html">&lt;p&gt;Arthur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;From the original [http://forums.amahi.org/viewtopic.php?f=3&amp;amp;t=1508&amp;amp;start=0 iPhone VPN] thread in the forums:&lt;br /&gt;
&lt;br /&gt;
For all of you out there that have an iPhone or any other mobile &amp;quot;idevice&amp;quot; And want VPN access I have found a way. The catch is, you have to have a jail broken device. If you do have a jail broken device and want the openvpn app on the phone you will want to check out www.guizmovpn.com  it's about 4€. The evaluation period is a full week. But the price is worth it.&lt;br /&gt;
&lt;br /&gt;
To configure the client you will need to follow the guide on www.guizmovpn.com The client info you will need to get from the wiki here http://wiki.amahi.org/index.php/VPNLinux&lt;br /&gt;
&lt;br /&gt;
I have also created a full guide custom tailored to amahi vpn access. &lt;br /&gt;
It might seem like a little to much or a hassle but its really simple. It just takes the time to read. http://home.mchsi.com/~irish-link/GuizmOVPN.pdf&lt;br /&gt;
&lt;br /&gt;
If you go to set it up and have issues please head over to the forum (liked at the top) and let me know if you need help. If you do end up setting it up, let me know how it works for you.&lt;br /&gt;
[[Category: VPN]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above is no longer true.  There is now an OpenVPN app in the app store that is free.  The iOS app can be downloaded from here:&lt;br /&gt;
&lt;br /&gt;
[https://itunes.apple.com/us/app/openvpn-connect/id590379981?mt=8 iOS OpenVPN app]&lt;br /&gt;
&lt;br /&gt;
To setup your connection to your HDA, perform the following steps:&lt;br /&gt;
&lt;br /&gt;
First create your ovpn file using the following (the order that these items come in is VERY important) configuration:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
client&lt;br /&gt;
dev tun&lt;br /&gt;
proto udp&lt;br /&gt;
remote XXXX.yourhda.com 1194&lt;br /&gt;
resolv-retry infinite&lt;br /&gt;
nobind&lt;br /&gt;
persist-key&lt;br /&gt;
persist-tun&lt;br /&gt;
auth-user-pass&lt;br /&gt;
ca Ca-cert.crt&lt;br /&gt;
cert AmahiHDAClient.crt&lt;br /&gt;
key AmahiHDAClient.key&lt;br /&gt;
comp-lzo&lt;br /&gt;
verb 3&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Be sure to replace the XXXX to whatever your ddns name for your HDA is.  Save this file as whatever you want with the .ovpn file extension.  The next step is to download the certificates.  The certificates can be found below (to download, right click &amp;gt; save as):&lt;br /&gt;
&lt;br /&gt;
* [http://dl.amahi.org/vpn/AmahiHDAClient.crt AmahiHDAClient.crt]&lt;br /&gt;
* [http://dl.amahi.org/vpn/AmahiHDAClient.key AmahiHDAClient.key]&lt;br /&gt;
* [http://dl.amahi.org/vpn/ca-cert.crt ca-cert.crt]&lt;br /&gt;
&lt;br /&gt;
If you rename these certificates you will need to modify the ovpn file with the names that you saved your certs as.  You are now ready to copy your files over to your iOS device.  The steps at the following page will point you in the right direction for importing the ovpn and cert files over to your iOS device.&lt;br /&gt;
&lt;br /&gt;
[https://www.ivpn.net/knowledgebase/90/-iPhone---OpenVPN-Connect-Setup-Guide.html iOS OpenVPN]&lt;/div&gt;</summary>
		<author><name>Arthur</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.amahi.org/index.php?title=OpenVPN_on_iOS&amp;diff=78314</id>
		<title>OpenVPN on iOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.amahi.org/index.php?title=OpenVPN_on_iOS&amp;diff=78314"/>
		<updated>2014-03-08T05:04:19Z</updated>

		<summary type="html">&lt;p&gt;Arthur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;From the original [http://forums.amahi.org/viewtopic.php?f=3&amp;amp;t=1508&amp;amp;start=0 iPhone VPN] thread in the forums:&lt;br /&gt;
&lt;br /&gt;
For all of you out there that have an iPhone or any other mobile &amp;quot;idevice&amp;quot; And want VPN access I have found a way. The catch is, you have to have a jail broken device. If you do have a jail broken device and want the openvpn app on the phone you will want to check out www.guizmovpn.com  it's about 4€. The evaluation period is a full week. But the price is worth it.&lt;br /&gt;
&lt;br /&gt;
To configure the client you will need to follow the guide on www.guizmovpn.com The client info you will need to get from the wiki here http://wiki.amahi.org/index.php/VPNLinux&lt;br /&gt;
&lt;br /&gt;
I have also created a full guide custom tailored to amahi vpn access. &lt;br /&gt;
It might seem like a little to much or a hassle but its really simple. It just takes the time to read. http://home.mchsi.com/~irish-link/GuizmOVPN.pdf&lt;br /&gt;
&lt;br /&gt;
If you go to set it up and have issues please head over to the forum (liked at the top) and let me know if you need help. If you do end up setting it up, let me know how it works for you.&lt;br /&gt;
[[Category: VPN]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above is no longer true.  There is now an OpenVPN app in the app store that is free.  To setup your connection to your HDA do the following:&lt;br /&gt;
&lt;br /&gt;
First create your ovpn file using the following (the order that these items come in is VERY important):&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
client&lt;br /&gt;
dev tun&lt;br /&gt;
proto udp&lt;br /&gt;
remote XXXX.yourhda.com 1194&lt;br /&gt;
resolv-retry infinite&lt;br /&gt;
nobind&lt;br /&gt;
persist-key&lt;br /&gt;
persist-tun&lt;br /&gt;
auth-user-pass&lt;br /&gt;
ca Ca-cert.crt&lt;br /&gt;
cert AmahiHDAClient.crt&lt;br /&gt;
key AmahiHDAClient.key&lt;br /&gt;
comp-lzo&lt;br /&gt;
verb 3&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this file as whatever you want with the .ovpn file extension.  The next step is to download the certificates.  The certificates can be found below (to download, right click &amp;gt; save as):&lt;br /&gt;
&lt;br /&gt;
* [http://dl.amahi.org/vpn/AmahiHDAClient.crt AmahiHDAClient.crt]&lt;br /&gt;
* [http://dl.amahi.org/vpn/AmahiHDAClient.key AmahiHDAClient.key]&lt;br /&gt;
* [http://dl.amahi.org/vpn/ca-cert.crt ca-cert.crt]&lt;br /&gt;
&lt;br /&gt;
You are now ready to copy your files over to your iOS device.  The steps at the following page will point you in the right direction for importing the ovpn and cert files over to your iOS device.&lt;br /&gt;
&lt;br /&gt;
[https://www.ivpn.net/knowledgebase/90/-iPhone---OpenVPN-Connect-Setup-Guide.html iOS OpenVPN]&lt;/div&gt;</summary>
		<author><name>Arthur</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.amahi.org/index.php?title=OpenVPN_on_iOS&amp;diff=78308</id>
		<title>OpenVPN on iOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.amahi.org/index.php?title=OpenVPN_on_iOS&amp;diff=78308"/>
		<updated>2014-03-08T05:01:10Z</updated>

		<summary type="html">&lt;p&gt;Arthur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;From the original [http://forums.amahi.org/viewtopic.php?f=3&amp;amp;t=1508&amp;amp;start=0 iPhone VPN] thread in the forums:&lt;br /&gt;
&lt;br /&gt;
For all of you out there that have an iPhone or any other mobile &amp;quot;idevice&amp;quot; And want VPN access I have found a way. The catch is, you have to have a jail broken device. If you do have a jail broken device and want the openvpn app on the phone you will want to check out www.guizmovpn.com  it's about 4€. The evaluation period is a full week. But the price is worth it.&lt;br /&gt;
&lt;br /&gt;
To configure the client you will need to follow the guide on www.guizmovpn.com The client info you will need to get from the wiki here http://wiki.amahi.org/index.php/VPNLinux&lt;br /&gt;
&lt;br /&gt;
I have also created a full guide custom tailored to amahi vpn access. &lt;br /&gt;
It might seem like a little to much or a hassle but its really simple. It just takes the time to read. http://home.mchsi.com/~irish-link/GuizmOVPN.pdf&lt;br /&gt;
&lt;br /&gt;
If you go to set it up and have issues please head over to the forum (liked at the top) and let me know if you need help. If you do end up setting it up, let me know how it works for you.&lt;br /&gt;
[[Category: VPN]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above is no longer true.  There is now an OpenVPN app in the app store that is free.  To setup your connection to your HDA do the following:&lt;br /&gt;
&lt;br /&gt;
First create your ovpn file using the following (the order that these items come in is VERY important):&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
client&lt;br /&gt;
dev tun&lt;br /&gt;
proto udp&lt;br /&gt;
remote XXXX.yourhda.com 1194&lt;br /&gt;
resolv-retry infinite&lt;br /&gt;
nobind&lt;br /&gt;
persist-key&lt;br /&gt;
persist-tun&lt;br /&gt;
auth-user-pass&lt;br /&gt;
ca Ca-cert.crt&lt;br /&gt;
cert AmahiHDAClient.crt&lt;br /&gt;
key AmahiHDAClient.key&lt;br /&gt;
comp-lzo&lt;br /&gt;
verb 3&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this file as whatever you want with the .ovpn file extension.  The next step is to download the certificates.  The certificates can be found below (to download, right click &amp;gt; save as):&lt;br /&gt;
&lt;br /&gt;
** [http://dl.amahi.org/vpn/AmahiHDAClient.crt AmahiHDAClient.crt]&lt;br /&gt;
** [http://dl.amahi.org/vpn/AmahiHDAClient.key AmahiHDAClient.key]&lt;br /&gt;
** [http://dl.amahi.org/vpn/ca-cert.crt ca-cert.crt]&lt;br /&gt;
&lt;br /&gt;
You are now ready to copy your files over to your iOS device.  The steps at the following page will point you in the right direction for importing the ovpn and cert files over to your iOS device.&lt;br /&gt;
&lt;br /&gt;
[https://www.ivpn.net/knowledgebase/90/-iPhone---OpenVPN-Connect-Setup-Guide.html iOS OpenVPN]&lt;/div&gt;</summary>
		<author><name>Arthur</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.amahi.org/index.php?title=OpenVPN&amp;diff=73574</id>
		<title>OpenVPN</title>
		<link rel="alternate" type="text/html" href="https://wiki.amahi.org/index.php?title=OpenVPN&amp;diff=73574"/>
		<updated>2013-10-29T16:01:48Z</updated>

		<summary type="html">&lt;p&gt;Arthur: /* IP Forwarding for Ubuntu based HDA's */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--'''IMPORTANT: we're transitioning to not having OpenVPN built in, but rather as an app, the [http://www.amahi.org/apps/openvpn OpenVPN one-click app]'''--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going forward, you will need to install the [http://www.amahi.org/apps/openvpn OpenVPN one-click app].&lt;br /&gt;
&lt;br /&gt;
'''You need to forward one port (1194/UDP) to your HDA's IP''' to enable your OpenVPN service from outside.&lt;br /&gt;
&lt;br /&gt;
You will also need client software.&lt;br /&gt;
&lt;br /&gt;
Once connected from outside your network, your computer becomes virtually a computer in your home network. All your files and services are as easily accessible as when you are at home.&lt;br /&gt;
&lt;br /&gt;
'''NEW! You can now use your amahi.org [https://www.amahi.org/user control panel] to test your VPN remotely!'''&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
There are two requirements for Remote Access to work:&lt;br /&gt;
&lt;br /&gt;
* On the client side, you need to be running a client&lt;br /&gt;
** We provide one for Windows, pre-configured for Amahi&lt;br /&gt;
** We recommend one for the Mac, which requires some manual configuration&lt;br /&gt;
** The client for Linux comes with most distros and uses the same settings as the Mac&lt;br /&gt;
* Your router needs to forward '''UDP port 1194''' to the IP address of your HDA. The way to do this is through port forwarding, which varies from router to router. Make sure you forward UDP (not TCP)&lt;br /&gt;
&lt;br /&gt;
= OpenVPN Clients For Windows, Mac, Linux, Android, iPhone, ... =&lt;br /&gt;
&lt;br /&gt;
Check the page for [[OpenVPN clients]].&lt;br /&gt;
&lt;br /&gt;
= Resources on Port Forwarding =&lt;br /&gt;
&lt;br /&gt;
* [http://www.portforward.com/english/routers/port_forwarding/routerindex.htm Massive database of port forwarding information by router]&lt;br /&gt;
* YouTube Video on Port Forwarding for Linksys Routers: http://www.youtube.com/watch?v=GWPUdW1kIJA&lt;br /&gt;
&lt;br /&gt;
= Bridging VPN and eth0 =&lt;br /&gt;
&lt;br /&gt;
If you'd like your VPN clients to get IP addresses in the same subnet as your HDA, and not in the 10.8.0.0/24 subnet (default), read this page: [[VPN Bridging]].&lt;br /&gt;
&lt;br /&gt;
= IP Forwarding for Ubuntu based HDA's =&lt;br /&gt;
&lt;br /&gt;
Something that is often asked on the forums is how to have access to your remote LAN's resources while connected to your HDA.  One way to accomplish this is through bridging VPN and eth0 on your HDA.  This process may not be necessary for some users and a script has been developed by user olson of the forum to accomplish this task.  Not only with this script allow for a user to browse to their remote LAN's resources, the user will also be able to browse the internet while connected to their VPN.  Below is the script and instructions for how to run it.  Please keep in mind that this is for Ubuntu based HDA's ONLY.&lt;br /&gt;
&lt;br /&gt;
{{Code|&lt;br /&gt;
Code = #!/bin/bash&lt;br /&gt;
log_file=&amp;quot;/tmp/openvpn_extra.log&amp;quot;&lt;br /&gt;
&lt;br /&gt;
function log()&lt;br /&gt;
{&lt;br /&gt;
  echo -e &amp;quot;$(date +%b\ %d\ %H:%M:%S) $(hostname -s) openvpn_extra: $@&amp;quot; &amp;gt;&amp;gt; $log_file&lt;br /&gt;
  echo -e &amp;quot;$(date +%b\ %d\ %H:%M:%S) $(hostname -s) openvpn_extra: $@&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Enable it right now&lt;br /&gt;
if ! echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward; then&lt;br /&gt;
  log &amp;quot;FATAL: could not enable ip_forward for immediate use&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if ! iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE; then&lt;br /&gt;
  log &amp;quot;FATAL: could not set iptables for immediate use&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#set it up so it does it at startup&lt;br /&gt;
if ! sed -i 's/#net.ipv4.ip_forward=.*\+/net.ipv4.ip_forward=1/' /etc/sysctl.conf; then&lt;br /&gt;
  log &amp;quot;FATAL: could not set ip_forward permanantly&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
if ! sh -c &amp;quot;iptables-save &amp;gt; /etc/iptables.rules&amp;quot;; then&lt;br /&gt;
  log &amp;quot;FATAL: could not set iptables permanantly&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
sudo cat &amp;gt; /etc/network/if-pre-up.d/iptablesload &amp;lt;&amp;lt;EOF&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
iptables-restore &amp;lt; /etc/iptables.rules&lt;br /&gt;
exit 0&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
sudo cat &amp;gt; /etc/network/if-post-down.d/iptablessave &amp;lt;&amp;lt;EOF&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
iptables-save -c &amp;gt; /etc/iptables.rules&lt;br /&gt;
if [ -f /etc/iptables.downrules ]; then&lt;br /&gt;
   iptables-restore &amp;lt; /etc/iptables.downrules&lt;br /&gt;
fi&lt;br /&gt;
exit 0&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
if ! chmod +x /etc/network/if-post-down.d/iptablessave; then&lt;br /&gt;
  log &amp;quot;FATAL: Could not chmod the iptablessave script&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
if ! chmod +x /etc/network/if-pre-up.d/iptablesload; then&lt;br /&gt;
  log &amp;quot;FATAL: Could not chmod the iptablesload script&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Done&amp;quot;&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can then run the script with the following command from the CLI:&lt;br /&gt;
&lt;br /&gt;
{{Code|&lt;br /&gt;
Code = sudo bash openvpn_extra.sh&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
* Is the [http://www.amahi.org/apps/openvpn OpenVPN app] installed in your HDA? (this is not required if you are on Amahi Fedora 14, but required on all later releases)&lt;br /&gt;
* Make sure your HDA's network IP range is different than that of the remote network. (e.g. if your HDA's IP address is 192.168.1.X, you cannot connect to it on a remote network also using 192.168.1.X)&lt;br /&gt;
&lt;br /&gt;
* If you are running your HDA from a Verizon FiOS connection, you may experience strange disconnections.  This may be due to the Actiontec router's small NAT table.  Please see guides here http://www.verizonfioswiki.com/index.php/Using_Your_Own_Router for instructions on how to use your own router.&lt;br /&gt;
&lt;br /&gt;
* If you have a Vonage V-Portal (or perhaps other voip adapters as well), plug your router into your modem, then the v-portal into your router. Vonage tells you to put the v-portal between the modem and the router, but I was unable to connect to vpn until I moved the adapter behind the router.&lt;br /&gt;
&lt;br /&gt;
* Check out [[VPN_troubleshooting]] for more troubleshooting tips.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
The VPN solution is implemented through the very popular [http://openvpn.net/ OpenVPN] software VPN.&lt;br /&gt;
&lt;br /&gt;
[[Category: Services]]&lt;br /&gt;
[[Category: VPN]]&lt;/div&gt;</summary>
		<author><name>Arthur</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.amahi.org/index.php?title=OpenVPN&amp;diff=73568</id>
		<title>OpenVPN</title>
		<link rel="alternate" type="text/html" href="https://wiki.amahi.org/index.php?title=OpenVPN&amp;diff=73568"/>
		<updated>2013-10-29T16:00:46Z</updated>

		<summary type="html">&lt;p&gt;Arthur: /* IP Forwarding for Ubuntu based HDA's */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--'''IMPORTANT: we're transitioning to not having OpenVPN built in, but rather as an app, the [http://www.amahi.org/apps/openvpn OpenVPN one-click app]'''--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going forward, you will need to install the [http://www.amahi.org/apps/openvpn OpenVPN one-click app].&lt;br /&gt;
&lt;br /&gt;
'''You need to forward one port (1194/UDP) to your HDA's IP''' to enable your OpenVPN service from outside.&lt;br /&gt;
&lt;br /&gt;
You will also need client software.&lt;br /&gt;
&lt;br /&gt;
Once connected from outside your network, your computer becomes virtually a computer in your home network. All your files and services are as easily accessible as when you are at home.&lt;br /&gt;
&lt;br /&gt;
'''NEW! You can now use your amahi.org [https://www.amahi.org/user control panel] to test your VPN remotely!'''&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
There are two requirements for Remote Access to work:&lt;br /&gt;
&lt;br /&gt;
* On the client side, you need to be running a client&lt;br /&gt;
** We provide one for Windows, pre-configured for Amahi&lt;br /&gt;
** We recommend one for the Mac, which requires some manual configuration&lt;br /&gt;
** The client for Linux comes with most distros and uses the same settings as the Mac&lt;br /&gt;
* Your router needs to forward '''UDP port 1194''' to the IP address of your HDA. The way to do this is through port forwarding, which varies from router to router. Make sure you forward UDP (not TCP)&lt;br /&gt;
&lt;br /&gt;
= OpenVPN Clients For Windows, Mac, Linux, Android, iPhone, ... =&lt;br /&gt;
&lt;br /&gt;
Check the page for [[OpenVPN clients]].&lt;br /&gt;
&lt;br /&gt;
= Resources on Port Forwarding =&lt;br /&gt;
&lt;br /&gt;
* [http://www.portforward.com/english/routers/port_forwarding/routerindex.htm Massive database of port forwarding information by router]&lt;br /&gt;
* YouTube Video on Port Forwarding for Linksys Routers: http://www.youtube.com/watch?v=GWPUdW1kIJA&lt;br /&gt;
&lt;br /&gt;
= Bridging VPN and eth0 =&lt;br /&gt;
&lt;br /&gt;
If you'd like your VPN clients to get IP addresses in the same subnet as your HDA, and not in the 10.8.0.0/24 subnet (default), read this page: [[VPN Bridging]].&lt;br /&gt;
&lt;br /&gt;
= IP Forwarding for Ubuntu based HDA's =&lt;br /&gt;
&lt;br /&gt;
Something that is often asked on the forums is how to have access to your remote LAN's resources while connected to your HDA.  One way to accomplish this is through bridging VPN and eth0 on your HDA.  This process may not be necessary for some users and a script has been developed by one of the forum members to accomplish this task.  Not only with this script allow for a user to browse to their remote LAN's resources, the user will also be able to browse the internet while connected to their VPN.  Below is the script and instructions for how to run it.  Please keep in mind that this is for Ubuntu based HDA's ONLY.&lt;br /&gt;
&lt;br /&gt;
{{Code|&lt;br /&gt;
Code = #!/bin/bash&lt;br /&gt;
log_file=&amp;quot;/tmp/openvpn_extra.log&amp;quot;&lt;br /&gt;
&lt;br /&gt;
function log()&lt;br /&gt;
{&lt;br /&gt;
  echo -e &amp;quot;$(date +%b\ %d\ %H:%M:%S) $(hostname -s) openvpn_extra: $@&amp;quot; &amp;gt;&amp;gt; $log_file&lt;br /&gt;
  echo -e &amp;quot;$(date +%b\ %d\ %H:%M:%S) $(hostname -s) openvpn_extra: $@&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Enable it right now&lt;br /&gt;
if ! echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward; then&lt;br /&gt;
  log &amp;quot;FATAL: could not enable ip_forward for immediate use&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if ! iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE; then&lt;br /&gt;
  log &amp;quot;FATAL: could not set iptables for immediate use&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#set it up so it does it at startup&lt;br /&gt;
if ! sed -i 's/#net.ipv4.ip_forward=.*\+/net.ipv4.ip_forward=1/' /etc/sysctl.conf; then&lt;br /&gt;
  log &amp;quot;FATAL: could not set ip_forward permanantly&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
if ! sh -c &amp;quot;iptables-save &amp;gt; /etc/iptables.rules&amp;quot;; then&lt;br /&gt;
  log &amp;quot;FATAL: could not set iptables permanantly&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
sudo cat &amp;gt; /etc/network/if-pre-up.d/iptablesload &amp;lt;&amp;lt;EOF&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
iptables-restore &amp;lt; /etc/iptables.rules&lt;br /&gt;
exit 0&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
sudo cat &amp;gt; /etc/network/if-post-down.d/iptablessave &amp;lt;&amp;lt;EOF&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
iptables-save -c &amp;gt; /etc/iptables.rules&lt;br /&gt;
if [ -f /etc/iptables.downrules ]; then&lt;br /&gt;
   iptables-restore &amp;lt; /etc/iptables.downrules&lt;br /&gt;
fi&lt;br /&gt;
exit 0&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
if ! chmod +x /etc/network/if-post-down.d/iptablessave; then&lt;br /&gt;
  log &amp;quot;FATAL: Could not chmod the iptablessave script&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
if ! chmod +x /etc/network/if-pre-up.d/iptablesload; then&lt;br /&gt;
  log &amp;quot;FATAL: Could not chmod the iptablesload script&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Done&amp;quot;&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can then run the script with the following command from the CLI:&lt;br /&gt;
&lt;br /&gt;
{{Code|&lt;br /&gt;
Code = sudo bash openvpn_extra.sh&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
* Is the [http://www.amahi.org/apps/openvpn OpenVPN app] installed in your HDA? (this is not required if you are on Amahi Fedora 14, but required on all later releases)&lt;br /&gt;
* Make sure your HDA's network IP range is different than that of the remote network. (e.g. if your HDA's IP address is 192.168.1.X, you cannot connect to it on a remote network also using 192.168.1.X)&lt;br /&gt;
&lt;br /&gt;
* If you are running your HDA from a Verizon FiOS connection, you may experience strange disconnections.  This may be due to the Actiontec router's small NAT table.  Please see guides here http://www.verizonfioswiki.com/index.php/Using_Your_Own_Router for instructions on how to use your own router.&lt;br /&gt;
&lt;br /&gt;
* If you have a Vonage V-Portal (or perhaps other voip adapters as well), plug your router into your modem, then the v-portal into your router. Vonage tells you to put the v-portal between the modem and the router, but I was unable to connect to vpn until I moved the adapter behind the router.&lt;br /&gt;
&lt;br /&gt;
* Check out [[VPN_troubleshooting]] for more troubleshooting tips.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
The VPN solution is implemented through the very popular [http://openvpn.net/ OpenVPN] software VPN.&lt;br /&gt;
&lt;br /&gt;
[[Category: Services]]&lt;br /&gt;
[[Category: VPN]]&lt;/div&gt;</summary>
		<author><name>Arthur</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.amahi.org/index.php?title=OpenVPN&amp;diff=73562</id>
		<title>OpenVPN</title>
		<link rel="alternate" type="text/html" href="https://wiki.amahi.org/index.php?title=OpenVPN&amp;diff=73562"/>
		<updated>2013-10-29T16:00:10Z</updated>

		<summary type="html">&lt;p&gt;Arthur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--'''IMPORTANT: we're transitioning to not having OpenVPN built in, but rather as an app, the [http://www.amahi.org/apps/openvpn OpenVPN one-click app]'''--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going forward, you will need to install the [http://www.amahi.org/apps/openvpn OpenVPN one-click app].&lt;br /&gt;
&lt;br /&gt;
'''You need to forward one port (1194/UDP) to your HDA's IP''' to enable your OpenVPN service from outside.&lt;br /&gt;
&lt;br /&gt;
You will also need client software.&lt;br /&gt;
&lt;br /&gt;
Once connected from outside your network, your computer becomes virtually a computer in your home network. All your files and services are as easily accessible as when you are at home.&lt;br /&gt;
&lt;br /&gt;
'''NEW! You can now use your amahi.org [https://www.amahi.org/user control panel] to test your VPN remotely!'''&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
There are two requirements for Remote Access to work:&lt;br /&gt;
&lt;br /&gt;
* On the client side, you need to be running a client&lt;br /&gt;
** We provide one for Windows, pre-configured for Amahi&lt;br /&gt;
** We recommend one for the Mac, which requires some manual configuration&lt;br /&gt;
** The client for Linux comes with most distros and uses the same settings as the Mac&lt;br /&gt;
* Your router needs to forward '''UDP port 1194''' to the IP address of your HDA. The way to do this is through port forwarding, which varies from router to router. Make sure you forward UDP (not TCP)&lt;br /&gt;
&lt;br /&gt;
= OpenVPN Clients For Windows, Mac, Linux, Android, iPhone, ... =&lt;br /&gt;
&lt;br /&gt;
Check the page for [[OpenVPN clients]].&lt;br /&gt;
&lt;br /&gt;
= Resources on Port Forwarding =&lt;br /&gt;
&lt;br /&gt;
* [http://www.portforward.com/english/routers/port_forwarding/routerindex.htm Massive database of port forwarding information by router]&lt;br /&gt;
* YouTube Video on Port Forwarding for Linksys Routers: http://www.youtube.com/watch?v=GWPUdW1kIJA&lt;br /&gt;
&lt;br /&gt;
= Bridging VPN and eth0 =&lt;br /&gt;
&lt;br /&gt;
If you'd like your VPN clients to get IP addresses in the same subnet as your HDA, and not in the 10.8.0.0/24 subnet (default), read this page: [[VPN Bridging]].&lt;br /&gt;
&lt;br /&gt;
= IP Forwarding for Ubuntu based HDA's =&lt;br /&gt;
&lt;br /&gt;
Something that is often asked on the forums is how to have access to your remote LAN's resources while connected to your HDA.  One way to accomplish this is through bridging VPN and eth0 on your HDA.  This process may not be necessary for some users and a script has been developed by one of the forum members to accomplish this task.  Not only with this script allow for a user to browse to their remote LAN's resources, the user will also be able to browse the internet.  Below is the script and instructions for how to run it.  Please keep in mind that this is for Ubuntu based HDA's ONLY.&lt;br /&gt;
&lt;br /&gt;
{{Code|&lt;br /&gt;
Code = #!/bin/bash&lt;br /&gt;
log_file=&amp;quot;/tmp/openvpn_extra.log&amp;quot;&lt;br /&gt;
&lt;br /&gt;
function log()&lt;br /&gt;
{&lt;br /&gt;
  echo -e &amp;quot;$(date +%b\ %d\ %H:%M:%S) $(hostname -s) openvpn_extra: $@&amp;quot; &amp;gt;&amp;gt; $log_file&lt;br /&gt;
  echo -e &amp;quot;$(date +%b\ %d\ %H:%M:%S) $(hostname -s) openvpn_extra: $@&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Enable it right now&lt;br /&gt;
if ! echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward; then&lt;br /&gt;
  log &amp;quot;FATAL: could not enable ip_forward for immediate use&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if ! iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE; then&lt;br /&gt;
  log &amp;quot;FATAL: could not set iptables for immediate use&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#set it up so it does it at startup&lt;br /&gt;
if ! sed -i 's/#net.ipv4.ip_forward=.*\+/net.ipv4.ip_forward=1/' /etc/sysctl.conf; then&lt;br /&gt;
  log &amp;quot;FATAL: could not set ip_forward permanantly&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
if ! sh -c &amp;quot;iptables-save &amp;gt; /etc/iptables.rules&amp;quot;; then&lt;br /&gt;
  log &amp;quot;FATAL: could not set iptables permanantly&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
sudo cat &amp;gt; /etc/network/if-pre-up.d/iptablesload &amp;lt;&amp;lt;EOF&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
iptables-restore &amp;lt; /etc/iptables.rules&lt;br /&gt;
exit 0&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
sudo cat &amp;gt; /etc/network/if-post-down.d/iptablessave &amp;lt;&amp;lt;EOF&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
iptables-save -c &amp;gt; /etc/iptables.rules&lt;br /&gt;
if [ -f /etc/iptables.downrules ]; then&lt;br /&gt;
   iptables-restore &amp;lt; /etc/iptables.downrules&lt;br /&gt;
fi&lt;br /&gt;
exit 0&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
if ! chmod +x /etc/network/if-post-down.d/iptablessave; then&lt;br /&gt;
  log &amp;quot;FATAL: Could not chmod the iptablessave script&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
if ! chmod +x /etc/network/if-pre-up.d/iptablesload; then&lt;br /&gt;
  log &amp;quot;FATAL: Could not chmod the iptablesload script&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Done&amp;quot;&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can then run the script with the following command from the CLI:&lt;br /&gt;
&lt;br /&gt;
{{Code|&lt;br /&gt;
Code = sudo bash openvpn_extra.sh&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
* Is the [http://www.amahi.org/apps/openvpn OpenVPN app] installed in your HDA? (this is not required if you are on Amahi Fedora 14, but required on all later releases)&lt;br /&gt;
* Make sure your HDA's network IP range is different than that of the remote network. (e.g. if your HDA's IP address is 192.168.1.X, you cannot connect to it on a remote network also using 192.168.1.X)&lt;br /&gt;
&lt;br /&gt;
* If you are running your HDA from a Verizon FiOS connection, you may experience strange disconnections.  This may be due to the Actiontec router's small NAT table.  Please see guides here http://www.verizonfioswiki.com/index.php/Using_Your_Own_Router for instructions on how to use your own router.&lt;br /&gt;
&lt;br /&gt;
* If you have a Vonage V-Portal (or perhaps other voip adapters as well), plug your router into your modem, then the v-portal into your router. Vonage tells you to put the v-portal between the modem and the router, but I was unable to connect to vpn until I moved the adapter behind the router.&lt;br /&gt;
&lt;br /&gt;
* Check out [[VPN_troubleshooting]] for more troubleshooting tips.&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
The VPN solution is implemented through the very popular [http://openvpn.net/ OpenVPN] software VPN.&lt;br /&gt;
&lt;br /&gt;
[[Category: Services]]&lt;br /&gt;
[[Category: VPN]]&lt;/div&gt;</summary>
		<author><name>Arthur</name></author>
		
	</entry>
</feed>