All Projects → kizzx2 → docker-openvpn-client-socks

kizzx2 / docker-openvpn-client-socks

Licence: other
Expose an OpenVPN tunnel as a SOCKS proxy

Programming Languages

Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to docker-openvpn-client-socks

terraform-aws-pritunl-vpn-server
Pritunl VPN Server for your public/private like VPC on AWS
Stars: ✭ 40 (-55.06%)
Mutual labels:  openvpn
droidovpn
An unofficial VPN Gate client for Android.
Stars: ✭ 65 (-26.97%)
Mutual labels:  openvpn
books-and-articles
Books written from me to my own language
Stars: ✭ 15 (-83.15%)
Mutual labels:  openvpn
terraform-openvpn
A sample terraform setup for OpenVPN using Let's Encrypt and Certbot to generate certificates
Stars: ✭ 43 (-51.69%)
Mutual labels:  openvpn
ancistrus
Netgear's D7000 Nighthawk Router Experience Distributed Project
Stars: ✭ 61 (-31.46%)
Mutual labels:  openvpn
iit-kgp-network
Information repository and Solutions on IIT KGP Internet Problems.
Stars: ✭ 28 (-68.54%)
Mutual labels:  openvpn
Cybernet-VPN
Android Cybernet VPN App
Stars: ✭ 28 (-68.54%)
Mutual labels:  openvpn
desktop-app-ui2
IVPN Desktop app
Stars: ✭ 19 (-78.65%)
Mutual labels:  openvpn
desktop-app-cli
Official IVPN command-line interface (CLI)
Stars: ✭ 18 (-79.78%)
Mutual labels:  openvpn
pritunl-http-api
Pritunl OpenVPN HTTP API
Stars: ✭ 26 (-70.79%)
Mutual labels:  openvpn
openvpn-aws-tf-ansible
OpenVPN with Terraform and Ansible on AWS
Stars: ✭ 17 (-80.9%)
Mutual labels:  openvpn
securitytalks
No description or website provided.
Stars: ✭ 29 (-67.42%)
Mutual labels:  opsec
openvpn
Build your own private VPN server. OpenVPN, Scramblesuit and DNS up in less then 5 minutes
Stars: ✭ 78 (-12.36%)
Mutual labels:  openvpn
ShadowOVPN
ShadowOVPN bridges shadowsocks and OpenVPN based on Docker. You can now connect to OpenVPN servers with any shadowsocks compatible client.
Stars: ✭ 17 (-80.9%)
Mutual labels:  openvpn
desktop-app
Official IVPN Desktop app
Stars: ✭ 141 (+58.43%)
Mutual labels:  openvpn
vpnman
A web-based frontend for OpenVPN server management
Stars: ✭ 32 (-64.04%)
Mutual labels:  openvpn
arch-privoxyvpn
Docker build script for Arch Linux base with Privoxy and OpenVPN
Stars: ✭ 55 (-38.2%)
Mutual labels:  openvpn
k8s-ovpn
OpenVPN on a Kubernetes cluster. Roll your own secure VPN cluster!
Stars: ✭ 72 (-19.1%)
Mutual labels:  openvpn
Raspberry-Pi-VPN-Gateway
Raspberry Pi VPN gateway installer for Private Internet Access
Stars: ✭ 44 (-50.56%)
Mutual labels:  openvpn
ConsolePi
Raspberry Pi Based Serial Console Server, with PushBullet Notification of IP changes, Automatic VPN termination, custom menu, Power Outlet Control, and a lot more
Stars: ✭ 109 (+22.47%)
Mutual labels:  openvpn

OpenVPN-client

This is a docker image of an OpenVPN client tied to a SOCKS proxy server. It is useful to isolate network changes (so the host is not affected by the modified routing).

This supports directory style (where the certificates are not bundled together in one .ovpn file) and those that contains update-resolv-conf

(For the same thing in WireGuard, see kizzx2/docker-wireguard-socks-proxy)

Why?

This is arguably the easiest way to achieve "app based" routing. For example, you may only want certain applications to go through your WireGuard tunnel while the rest of your system should go through the default gateway. You can also achieve "domain name based" routing by using a PAC file that most browsers support.

Usage

Preferably, using start in this repository:

start /your/openvpn/directory

/your/openvpn/directory should contain one OpenVPN .conf file. It can reference other certificate files or key files in the same directory.

Alternatively, using docker run directly:

docker run -it --rm --device=/dev/net/tun --cap-add=NET_ADMIN \
    --name openvpn-client \
    --volume /your/openvpn/directory/:/etc/openvpn/:ro -p 1080:1080 \
    kizzx2/openvpn-client-socks

Then connect to SOCKS proxy through through localhost:1080 / local.docker:1080. For example:

curl --proxy socks5h://local.docker:1080 ipinfo.io

Solutions to Common Problems

I'm getting RTNETLINK answers: Permission denied

Try adding --sysctl net.ipv6.conf.all.disable_ipv6=0 to your docker command

DNS doesn't work

You can put a update-resolv-conf as your up script. One simple way is to put this file as up.sh inside your OpenVPN configuration directory.

HTTP Proxy

You can easily convert this to an HTTP proxy using http-proxy-to-socks, e.g.

hpts -s 127.0.0.1:1080 -p 8080
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].