From 124693317def2e63a6cfeafd10c2f07607d6d07e Mon Sep 17 00:00:00 2001 From: Bernd Storath <999999bst@gmail.com> Date: Sat, 15 Jun 2024 12:41:09 +0200 Subject: [PATCH] Update docker and readme Co-authored-by: Peter Lewis Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com> --- Dockerfile | 2 ++ README.md | 2 ++ docker-compose.yml | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/Dockerfile b/Dockerfile index ca427af2..5a4377e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,12 +30,14 @@ COPY --from=build_node_modules /node_modules /node_modules RUN apk add --no-cache \ dpkg \ dumb-init \ + ip6tables \ iptables \ iptables-legacy \ wireguard-tools # Use iptables-legacy RUN update-alternatives --install /sbin/iptables iptables /sbin/iptables-legacy 10 --slave /sbin/iptables-restore iptables-restore /sbin/iptables-legacy-restore --slave /sbin/iptables-save iptables-save /sbin/iptables-legacy-save +RUN update-alternatives --install /sbin/ip6tables ip6tables /sbin/ip6tables-legacy 10 --slave /sbin/ip6tables-restore ip6tables-restore /sbin/ip6tables-legacy-restore --slave /sbin/ip6tables-save ip6tables-save /sbin/ip6tables-legacy-save # Set Environment ENV DEBUG=Server,WireGuard diff --git a/README.md b/README.md index 1b770920..05f999b9 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,9 @@ These options can be configured by setting environment variables using `-e KEY=" | `WG_MTU` | `null` | `1420` | The MTU the clients will use. Server uses default WG MTU. | | `WG_PERSISTENT_KEEPALIVE` | `0` | `25` | Value in seconds to keep the "connection" open. If this value is 0, then connections won't be kept alive. | | `WG_DEFAULT_ADDRESS` | `10.8.0.x` | `10.6.0.x` | Clients IP address range. | +| `WG_DEFAULT_ADDRESS6` | `fdcc:ad94:bacf:61a4::cafe:x` | `fdcc:ad94:bacf:61a4::42:x` | Clients IPv6 address range. Has to be a valid IPv6 ULA address. | | `WG_DEFAULT_DNS` | `1.1.1.1` | `8.8.8.8, 8.8.4.4` | DNS server clients will use. If set to blank value, clients will not use any DNS. | +| `WG_DEFAULT_DNS6` | `2606:4700:4700::1111` | `2606:4700:4700::1001, 2606:4700:4700::1111` | DNSv6 server clients will use. | | `WG_ALLOWED_IPS` | `0.0.0.0/0, ::/0` | `192.168.15.0/24, 10.0.1.0/24` | Allowed IPs clients will use. | | `WG_PRE_UP` | `...` | - | See [config.js](https://github.com/wg-easy/wg-easy/blob/master/src/config.js#L19) for the default value. | | `WG_POST_UP` | `...` | `iptables ...` | See [config.js](https://github.com/wg-easy/wg-easy/blob/master/src/config.js#L20) for the default value. | diff --git a/docker-compose.yml b/docker-compose.yml index daba03f6..65b9bdce 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,9 @@ services: # - WG_PORT=51820 # - WG_CONFIG_PORT=92820 # - WG_DEFAULT_ADDRESS=10.8.0.x + # - WG_DEFAULT_ADDRESS6=fd00::cafe:x # - WG_DEFAULT_DNS=1.1.1.1 + # - WG_DEFAULT_ADDRESS6=fdcc:ad94:bacf:61a4::cafe:x # - WG_MTU=1420 # - WG_ALLOWED_IPS=192.168.15.0/24, 10.0.1.0/24 # - WG_PERSISTENT_KEEPALIVE=25 @@ -30,6 +32,10 @@ services: image: ghcr.io/wg-easy/wg-easy container_name: wg-easy + networks: + wg: + ipv4_address: 10.42.42.42 + ipv6_address: fdcc:ad94:bacf:61a3::2a volumes: - etc_wireguard:/etc/wireguard ports: @@ -43,3 +49,16 @@ services: sysctls: - net.ipv4.ip_forward=1 - net.ipv4.conf.all.src_valid_mark=1 + - net.ipv6.conf.all.disable_ipv6=0 + - net.ipv6.conf.all.forwarding=1 + - net.ipv6.conf.default.forwarding=1 + +networks: + wg: + driver: bridge + enable_ipv6: true + ipam: + driver: default + config: + - subnet: 10.42.42.0/24 + - subnet: fdcc:ad94:bacf:61a3::/64