Skip to content

Commit

Permalink
Tweak README and comments adding the SUBNET env var
Browse files Browse the repository at this point in the history
  • Loading branch information
jpetazzo committed Nov 6, 2023
1 parent 1d71c8a commit 06bef41
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion bin/run
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 06bef41

Please sign in to comment.