Giter Club home page Giter Club logo

docker-alpine-peervpn's Introduction

Docker image running PeerVPN

Usage

Pull the image from Dockerhub.

docker pull thomasleister/peervpn

Running the image directly

The default ENTRYPOINT will generate a configuration file for PeerVPN (unless one exists already) based on supplied environment variables and then run the peervpn binary.

The following environment variables are supported. Note that some default values are of limited use.

Variable Default
NETWORKNAME PEERVPN$RANDOM
PSK PSK$RANDOM
INITPEERS example.com 7000
ENABLETUNNELING yes
INTERFACE peervpn0
IFCONFIG4 172.16.254.$(expr $RANDOM % 256)/24
IFCONFIG4 fe80::1034:56ff:fe78:$(expr $RANDOM % 10000)/64
LOCAL 0.0.0.0
PORT 7000
ENABLEIPV4 yes
ENABLEIPV6 yes
ENABLERELAY no

The example below will run a VPN between two containers. Both containers must configure different UDP ports (7001 and 7002) as they are on the same host. In the example below the IP address of the host running Docker is 10.0.2.15.

docker run --name=vpn1 -p 7001:7001/udp --cap-add=NET_ADMIN \
    -e NETWORKNAME=mynet -e PSK=mykey -e PORT=7001 \
    -e INITPEERS='10.0.2.15 7002' -e IFCONFIG4='172.16.1.1/24' -d \
    thomasleister/peervpn

docker run --name=vpn2 -p 7002:7002/udp --cap-add=NET_ADMIN \
    -e NETWORKNAME=mynet -e PSK=mykey -e PORT=7002 \
    -e INITPEERS='10.0.2.15 7001' -e IFCONFIG4='172.16.1.2/24' -d \
    thomasleister/peervpn

Running image via docker-compose

version: '3'

services:
    peervpn:
        image: thomasleister/peervpn
        network_mode: "host"
        cap_add:
            - NET_ADMIN
        restart: "always"
        environment:
            NETWORKNAME: srvnet
            INTERFACE: "srvnet0"
            PSK: thisisapresharedkey
            LOCAL: "0.0.0.0"
            PORT: 7000
            INITPEERS: "1.2.3.4 7000"
            IFCONFIG4: "10.8.0.1/24"
            ENABLERELAY: "yes"
            ENABLEIPV6: "no"

Authors

docker-alpine-peervpn's People

Contributors

mjuenema avatar thomasleister avatar

Watchers

 avatar  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.