Config fix for #2208 : Document network interface fix for multi-network configuations (#2555)
Some checks failed
Mark stale issues and pull requests / stale (push) Has been cancelled
Lint / Check Docs (push) Has been cancelled
Edge / Build Docker (map[os:ubuntu-24.04-arm platform:linux/arm64]) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Edge / Build Docker (map[os:ubuntu-latest platform:linux/amd64]) (push) Has been cancelled
Edge / Merge & Deploy Docker (push) Has been cancelled
Lint / Lint (format:check) (push) Has been cancelled
Lint / Lint (lint) (push) Has been cancelled
Lint / Lint (typecheck) (push) Has been cancelled
Edge / Build & Deploy Docs (push) Has been cancelled

* document fix for #2208

* typo fix

* prettier

* fix code block format

* fix indentation

---------

Co-authored-by: Timothy Pillow <timothy.pillow@swisscom.com>
Co-authored-by: Bernd Storath <999999bst@gmail.com>
Co-authored-by: Bernd Storath <32197462+kaaax0815@users.noreply.github.com>
This commit is contained in:
Timothy Pillow
2026-03-23 09:59:17 +01:00
committed by GitHub
parent 9a843087c3
commit 2a78b30aeb

View File

@@ -109,3 +109,31 @@ To resolve this issue, you can try the following steps:
```shell
echo "ip6table_filter" | sudo tee -a /etc/modules
```
## Clients lose connectivity after restarting the container when using multiple networks?
When you attach multiple Docker networks (e.g., `wg` and a reverse proxy network like `traefik` or `nginx`) to the `wg-easy` container, Docker might assign the network interfaces randomly (e.g., swapping `eth0` and `eth1`). Since `wg-easy` expects the wireguard interface to act as `eth0` and configures `POSTROUTING` rules for it, connectivity will break if the interfaces are swapped upon container restart.
To solve this, specify the `interface_name` and `gw_priority` explicitly in your `docker-compose.yml` file to guarantee that the `wg` network always binds to `eth0` and acts as the default gateway.
**Example `docker-compose.yml`:**
```yaml
services:
wg-easy:
# ... other configuration ...
networks:
wg:
interface_name: eth0
gw_priority: 1
ipv4_address: 10.42.42.42
nginx:
interface_name: eth1
gw_priority: 0
networks:
wg:
# ... wg network config ...
nginx:
external: true
```