Sign inSign up

slobberbone/docker-openvpn-proxy

By slobberbone

Updated over 8 years ago

A proxy using OpenVPN and force all traffics throw it. If vpn is down, output traffic is blocked.

Image
0

487

slobberbone/docker-openvpn-proxy repository overview

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.

Tag summary

Content type

Image

Digest

Size

109.4 MB

Last updated

over 8 years ago

docker pull slobberbone/docker-openvpn-proxy