From 06bef41f1b24b283b0a0789463d11ee33b7db9fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Mon, 6 Nov 2023 19:47:33 +0100 Subject: [PATCH] Tweak README and comments adding the SUBNET env var --- README.md | 16 +++++++++++++--- bin/run | 3 ++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 495a293..2e82042 100644 --- a/README.md +++ b/README.md @@ -74,9 +74,19 @@ is rooted. The topology used is `net30`, because it works on the widest range of OS. `p2p`, for instance, does not work on Windows. -The TCP by default server uses `192.168.255.0/25` and the UDP server uses -`192.168.255.128/25`. You can override subnet (three octets, for now you can't override mask) by `SUBNET` variable. -For example `docker run -d --privileged -p 1194:1194/udp -p 443:443/tcp -e SUBNET=192.168.13 jpetazzo/dockvpn` +The TCP server uses `192.168.255.0/25` and the UDP server uses +`192.168.255.128/25`. However, you can change these subnets by +setting the `SUBNET` environment variable. Note that at the moment, +you can only specify the first three octets of the subnet, and +the TCP and UDP servers will use the lower /25 and upper /25 +subnets respectively. + +For instance, you can do: + +```bash +docker run -d --privileged -p 1194:1194/udp -p 443:443/tcp \ + -e SUBNET=192.168.13 jpetazzo/dockvpn +``` The client profile specifies `redirect-gateway def1`, meaning that after establishing the VPN connection, all traffic will go through the VPN. diff --git a/bin/run b/bin/run index 9ba1f08..13f5fad 100755 --- a/bin/run +++ b/bin/run @@ -1,6 +1,7 @@ #!/bin/sh -VPN_SUBNET="${SUBNET:-192.168.255}" # You can override subnet of VPN +# The subnet can be overridden with an environment variable +VPN_SUBNET="${SUBNET:-192.168.255}" set -e