Giter VIP home page Giter VIP logo

docker-openvpn-client's Introduction

Information

This is a docker container running OpenVPN client. It has the possibility to link other containers to send traffic trough openvpn. You can also specify which ports that should be accessible from vpn to OpenVPN client container.

If the vpn connection is down only ping, dns and the OpenVPN Remote ports will be allowed from OpenVPN client container to outside.

OpenVPN client container also has a built in ping monitor, so if the openvpn interface is up and ping is not possible it will restart the connection.


Environment Variables

Variable Description Example
LOCAL_NETWORKS Comma separated list of subnets that you would like to grant full access to from container 192.168.0.0/24,192.168.1.0/24
OPENVPN_REMOTE_PORTS Comma separated list of ports that your openvpn server is listening on 1194,1195
OPENVPN_FIREWALL_ALLOW_TCP Comma separated list of TCP ports that you want to open to container, if environment variable is empty all TCP ports will be allowed from outside. If not specified, TCP traffic from outside will be blocked. 80,443
OPENVPN_FIREWALL_ALLOW_UDP Comma separated list of UDP ports that you want to open to container, if environment variable is empty all UDP ports will be allowed from outside. If not specified, UDP traffic from outside will be blocked. 53

Start OpenVPN client container:

$ docker run -dt \
    --name openvpn-client \
    --hostname openvpn-client \
    -v /data/vpn:/vpn \
    -e LOCAL_NETWORKS=192.168.0.0/24 \
    -e OPENVPN_REMOTE_PORTS=1194,1195\
    -e OPENVPN_FIREWALL_ALLOW_TCP=80,443 \
    -e OPENVPN_FIREWALL_ALLOW_UDP=80,443 \
    --cap-add=NET_ADMIN \
    --device /dev/net/tun \
    robostlund/openvpn-client:latest

Publish local services to openvpn client container

Lets say you would like to run a webserver that is accessible from the openvpn ip you can link the webserver container to the openvpn client container.

$ docker run -dt \
    --name webserver \
    --hostname webserver \
    --net container:openvpn-client \
    -v /data/web:/data \
    robostlund/nginx-php-mysql-static:latest

docker-openvpn-client's People

Contributors

robinostlund avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dorucioclea msgpo

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.