/docker-openvpn-proxy

Docker OpenVPN Client and Proxy Server

Primary LanguageShellGNU General Public License v3.0GPL-3.0

docker-openvpn-proxy

Docker OpenVPN Client and Squid Proxy Server

Additional - Output traffic only throw VPN connection

Add an environment variable named "OPENVPN_SERVER_ADDRESS=nt.vpnserver.com" to set the dns name or ip of the vpn server. Once done, all output traffic will be blocked if vpn interface or connection down.

A script /root/check_public_ip.sh allow you to check your public ip address. Open two console, on to run the script (loop) and another to kill vpn connection :

Console 1

$ killall openvpn

Console 2

$ sh /root/check_public_ip.sh

You can kill several time and check in another console that the only public ip is the vpn one, if vpn down, you have no external access.

Run container from Docker registry

To run the container use this command:

$ docker run --privileged  -d \
              -e "OPENVPN_PROVIDER=PIA" \
              -e "OPENVPN_CONFIG=Netherlands" \
              -e "OPENVPN_SERVER_ADDRESS=nt.vpnserver.com" \
              -e "OPENVPN_USERNAME=user" \
              -e "OPENVPN_PASSWORD=pass" \
              -p 1022:22 \
              -p 3128:3128 \
              slobberbone/openvpn-proxy

Now you can connect your application to a proxy localhost:3128.

OpenVPN configuration

All OpenVPN configuration are explained at schmas/docker-openvpn-client.