Skip to content

Instantly share code, notes, and snippets.

@bwindsor
Last active October 9, 2019 22:26
Show Gist options
  • Save bwindsor/37230d75c2d4de02f4376e8ff04c2376 to your computer and use it in GitHub Desktop.
Save bwindsor/37230d75c2d4de02f4376e8ff04c2376 to your computer and use it in GitHub Desktop.
OpenVPN + ObfsProxy Setup
  1. Start an AWS EC2 Instance from the Ubuntu 16.04 Amazon image. t3a.micro will do. Open ports 22 and 2443. Assign an elastic IP so it can't change.
  2. Download the private key for the EC2 instance whilst creating it
  3. SSH into the server
  4. Update to the latest sudo apt-get update then sudo apt-get upgrade -y
  5. Install PiVPN curl -L https://install.pivpn.io | bash. Make sure to select TCP and not UDP when given the option. Set the port as 1194. The rest can be left as defaults. If the screen does a strange flashy thing try ssh from Cygwin instead.
  6. Install obfsproxy sudo apt-get install obfsproxy
  7. Put the attached systemd file at /lib/systemd/system/obfsproxy.service
  8. Start the service sudo systemctl enable obfsproxy then sudo systemctl start obfsproxy
  9. Add users with pivpn add. Then follow the steps it gives you.
  10. Use scp to download the .ovpn files and put them on relevant devices. You'll need to modify 1443 to 2443 as the port number in these client config files.
  11. Load the file into the OpenVPN App on a phone. Change the proxy setting to use obfs3.
  12. Should be able to connect!

To connect from a laptop you'll need to run an obfsproxy client. The obfsproxy docker container. You'll also need to add the lines to the client config file to point it via obfsproxy:

route <SERVER_IP> 255.255.255.255 net_gateway
connect-retry-max 1
socks-proxy 192.168.99.100 4911

and change the port to 2443. And change the socks-proxy destination as appropriate. 192.168.99.100 is the ip address of the docker machine on Windows with the container listening on port 4911.

[Unit]
Description=OBFSProxy3 SErvice
[Service]
ExecStart=/usr/bin/obfsproxy --log-min-severity=info obfs3 --dest=127.0.0.1:1443 server 0.0.0.0:2443
PIDFile=/run/openvpn/obfsproxy.pid
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment