diff --git a/README.md b/README.md index 6fba97d..2e82042 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,18 @@ The topology used is `net30`, because it works on the widest range of OS. `p2p`, for instance, does not work on Windows. The TCP server uses `192.168.255.0/25` and the UDP server uses -`192.168.255.128/25`. +`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 c7939fe..13f5fad 100755 --- a/bin/run +++ b/bin/run @@ -1,4 +1,8 @@ #!/bin/sh + +# The subnet can be overridden with an environment variable +VPN_SUBNET="${SUBNET:-192.168.255}" + set -e [ -d /dev/net ] || @@ -20,7 +24,7 @@ chmod 600 key.pem openssl x509 -req -in csr.pem -out cert.pem -signkey key.pem -days 24855 [ -f tcp443.conf ] || cat >tcp443.conf <udp1194.conf <> tcp443.log &