# Now transfer client script raspberrypi.ovpn
# in $HOME/clientside/ to your client PC
# Due to permissions, I had to transfer it to C:\
# Then in windows, copy the file
# to C:\Program Files (x86)\OpenVPN\config

# add new text line into file /etc/rc.local# before ‘exit 0' to ensure the firewall rules are run at reboot or power up.
sudo nano /etc/rc.local

/usr/local/bin/firewall.sh

# reboot the pi
sudo reboot

# Connect VPN client from remote location# does not work when client and server are connected# to same router and you try external IP address.# If you want to do a local test at home# connect to local IP address of server e.g. 192.168.1.4# when you go to your remote location, connect to no-ip address or external static IP

# Now transfer client script raspberrypi.ovpn
# in $HOME/clientside/ to your client PC
# Due to permissions, I had to transfer it to C:\
# Then in windows, copy the file
# to C:\Program Files (x86)\OpenVPN\config

# For someone in China Shadowsocks gives a better VPN speed connection than # either openvpn or ssh.# Shadowsocks is a little known socks5 proxy program, But used quite a bit in China. # Its a socks5 proxy that sets up multiple connection channels.

# The Chinese throttle the speed of encrypted connections, so openvpn, # ssh, stunnel can be setup, but as they use one connection # they are very very slow to the point of being useless, which is the Chinese idea.# Instead of have having one throttled connection, Shadowsocks has many connections, # while each are still throttled slow, the total sum added together gives more bandwidth.

# Using SD card with "2014-01-07-wheezy-raspbian armhf"# Remember you gotta do port forwarding, not covered in this post# TIP: When using Windows Client, must run Openvpn Client as administrator# otherwise it connects but TUN/TAP will not start due to permissions# and you will not have web browsing etc. This is a common mistake.

# Now install openvpn
sudo apt-get install openvpn -y

# Now we create keys and certs using the new easyrsa3# You need to make a passphrase during this process
mkdir $HOME/clientside
cd $HOME/clientside
git clone git://github.com/OpenVPN/easy-rsa
cd easy-rsa/easyrsa3
./easyrsa init-pki
./easyrsa gen-req client1 nopass

# Now transfer client script raspberrypi.ovpn # in $HOME/clientside/ to your client PC # Due to permissions, I had to transfer it to C:\ # Then in windows, copy the file # to C:\Program Files (x86)\OpenVPN\config

# add new text line into file /etc/rc.local # before ‘exit 0′ to ensure the firewall rules are run at reboot or power up.
sudo nano /etc/rc.local

/usr/local/bin/firewall.sh

# reboot the pi
sudo reboot

# Connect VPN client from remote location
# does not work when client and server are connected
# to same router and you try external IP address.
# If you want to do a local test at home
# connect to local IP address of server e.g. 192.168.1.4
# when you go to your remote location, connect to no-ip address or external static IP

# open web page# if your connected to the same router as the Raspberry PI# put in local IP address of PI e.g. 192.168.0.2## As you know, to get to your PHproxy from the outside world # you gotta do port forwarding and get a domain name or use # IP address etc etc