# Tested on# Raspbian Jessie Lite version date: March 2017# # This post builds a scrambled openvpn server on a Raspberry PI# from source code for openvpn 2.4.1 plus patch to add scramble functionality# To get it working, you need both sides patched, the server and the client# plus you need to add a scramble key to server and client scripts.# Below we will use the following password scramble key "test"# This password key must be the same in server and client openvpn scripts# i.e. scramble obfuscate test

# 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

# TIP: Check server can start ok
sudo /etc/init.d/openvpn restart

# TIP:Check tun0 interface started
ifconfig

# 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

Moreover, kindly I could request your help about configuration I have in mind and tell me if it could be feasible:

– I have used your detailed guide for setup openvpn with obfuscated in my VPS and access mainly using android client. It works quite well.

– Now I have configured my home raspberry to be used as openvpnclient and connecting to VPS server creating link between both and be able provide me open gateway for my LAN devices. It also works quite well.

– Lastly, I will like to be able access from wherever place (basically use my 4G data) using either ssh tunnel or openvpn client running openvpn server also in raspberry since my inet connection at home is much better than whatever connection I find out of home besides give me access to my local devices.

I have been playing with iptables but I am not able to make it working. Do you have idea how I could manage such setup using external device (4G) –> raspberry (home) –> VPS?

yes, I have set similar up, the easiest and quickest is shadowsocks and kcptun
provided you are able to open ports on your home router, i.e. you have admin password.
Note, the speed you get is your home upload speed, when you access it from outside.

on your VPS, you set up shadowsocks server and kcptun server
on raspberry pi at home, you set up kcptun client
on phone you set up shadowsocks client

its similar idea to obfsproxy, which can also work, in fact any envelope can work, also stunnel etc etc and no messing with iptables.

From what I can see, openvpn does not work as a two stage proxy
i.e openvpn client to openvpn server to openvpn client to openvpn server.

For sure in china it is (I suffer it directly :-() but in this case, I have tested that if ssh tunnel is done inside mailand using either 3G/4G or wifi hotspot, there is not throttling at all. Of course if ssh tunnel is against overseas VPS then it is.