GithubHelp home page GithubHelp logo

dparnell / docker-vpn-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gzm55/docker-vpn-client

0.0 1.0 2.0 18 KB

VPN clients in docker based on alpine.

Home Page: https://hub.docker.com/r/gzm55/vpn-client/

License: MIT License

Shell 94.05% Makefile 5.95%

docker-vpn-client's Introduction

docker-vpn-client

VPN clients in docker. Now support pptp and openconect client. It starts a persist pptp tunnel and adds routing rules.

Run it in bash like this:

# print help message
docker run --rm gzm55/vpn-client --help

# start a pptp tunnel
VPN_ROUTING_IPS="172.0.0.0/8 www.google.com"
VPN_PASSOWRD=xxx
#VPN_DEBUG=y

docker run --net=host \
           --privileged=true \
           --device=/dev/ppp \
           --cap-add=NET_ADMIN \
           --name pptp-tunnel-$VPN_SERVER \
           -e VPN_ROUTING_IPS="$VPN_ROUTING_IPS" \
           -e VPN_DEBUG="$VPN_DEBUG" \
           --env-file <(cat <<-END
		VPN_PASSWORD=$VPN_PASSOWRD
		END
           ) \
           --detach \
           gzm55/vpn-client pptp <server-domain-or-ip> <user> [<pppd-options>]

#view openconnect help
docker run -it --rm gzm55/vpn-client openconect --help

# start a openconnect tunnel

VPN_OPENCONNECT_COOKIE=yyy
docker run --net=host \
           --privileged=true \
           --device=/dev/net/tun \
           --cap-add=NET_ADMIN \
           --name openconnect-tunnel-$VPN_SERVER \
           -e VPN_DEBUG="$VPN_DEBUG" \
           --env-file <(cat <<-END
		VPN_PASSWORD=$VPN_PASSOWRD
		VPN_OPENCONNECT_COOKIE=$VPN_OPENCONNECT_COOKIE
		END
           ) \
           --detach \
           gzm55/vpn-client openconnect [<openconnect-options>] <server-domain-or-ip>

# openvpn
docker run --net=host \
           --privileged=true \
           --device=/dev/net/tun \
           --cap-add=NET_ADMIN \
           --name openvpn-$VPN_SERVER \
           --volume ca.crt:/etc/openvpn/ca.crt \
           --volume client.crt:/etc/openvpn/client.crt \
           --volume client.key:/etc/openvpn/client.key \
           --volume vpn.conf:/etc/openvpn/vpn.conf \
           --detach \
           docker-vpn-client openvpn

Accepted docker environment variables for vpn client:

  • VPN_ROUTING_IPS: [pptp] space seperated string, each like '172.0.0.0/8', 'www.google.com' or 1.2.3.4
  • VPN_DEBUG: [pptp] no empty string will enable debug option for pppd
  • VPN_PASSOWRD: [all] login password
  • VPN_OPENCONNECT_COOKIE: [openconnect] login cookie

docker-vpn-client's People

Contributors

dparnell avatar gzm55 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.