[BUG] Server mode + host networking + read only = stale wg0 iface, deletes host route on failure
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- docker, linux
- 領域
- devops, networking
調査の方向性
まず、wg-quick の失敗経路に沿ってサービス実行スクリプトと終了スクリプトを追跡します。特に、ip route del default によるクリーンアップと、古い wg0 インターフェースを確認します。network_mode: host、サーバーモード、読み取り専用モードで再現し、失敗した再起動によってホストのデフォルトルートが変更されたままにならず、削除されていない wg0 インターフェースも残らないことを確認します。
索引モデルが issue の本文から書いたものです。
説明
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
In server mode with network_mode: host and in read-only mode, if wg-quick up fails to bring a tunnel up, the service run script executes ip route del default. Because the container shares the host network namespace, this delete's the HOST's default route, knocking it (and any LAN it routes for) offline except via v6.
This is furthermore self-fulfilling: for some reason the original wg0 iface is always left behind on restart, so every subsequent start-up fails unless the user intervenes by manually deleting the stale wg0. The finish script does not clean it up.
Expected Behavior
A container should never delete the host's default route. ip route del default is a client leak-guard that should be absent from server mode and/or scoped to routes that the container itself created.
The interface wg0 should be cleaned up automatically.
Steps To Reproduce
- Run the container in server mode with
network_mode: hostandread_only: trueon a host whose default route is externally managed, e.g., via DHCP. - Run
docker restart <container_name>
The default route will be gone, but the wg0 interface left behind.
Environment
- OS: Ubuntu Server 24.04, kernel 6.8
- How docker service was installed: community edition repo added to apt
CPU architecture
x86-64
Docker creation
services:
wireguard:
image: linuxserver/wireguard:latest
container_name: wireguard
read_only: true
network_mode: host
cap_add:
- NET_ADMIN
environment:
- PUID=1000
- PGID=1000
- TZ=America/Los_Angeles
- SERVERURL=<redacted>
- SERVERPORT=51820
- PEERS=2
- USE_COREDNS=false
- INTERNAL_SUBNET=10.14.15.0/24
- ALLOWEDIPS=10.0.0.0/24,10.14.15.0/24
- PERSISTENTKEEPALIVE_PEERS=all
volumes:
- ./config:/config
tmpfs:
- /run:exec
restart: unless-stopped
Container logs
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID: 1000
User GID: 1000
───────────────────────────────────────
Linuxserver.io version: 1.0.20260223-r0-ls118
Build-date: 2026-07-16T12:47:37+00:00
───────────────────────────────────────
Uname info: Linux PacketFucker3000 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:53:05 UTC 2026 x86_64 GNU/Linux
**** Server mode is selected ****
**** PersistentKeepalive will be set for: all ****
**** External server address is set to <redacted> ****
**** External server port is set to 51820. Make sure that port is properly forwarded to port 51820 inside this container ****
**** Internal subnet is set to 10.14.15.0/24 ****
**** AllowedIPs for peers 10.0.0.0/24,10.14.15.0/24 ****
**** PEERDNS var is either not set or is set to "auto", setting peer DNS to 10.14.15.1 to use wireguard docker host's DNS. ****
**** Server mode is selected ****
**** No changes to parameters. Existing configs are used. ****
[custom-init] No custom files found, skipping...
**** Disabling CoreDNS ****
**** Found WG conf /config/wg_confs/wg0.conf, adding to list ****
**** Activating tunnel /config/wg_confs/wg0.conf ****
wg-quick: `wg0' already exists
**** Tunnel /config/wg_confs/wg0.conf failed, will stop all others! ****
RTNETLINK answers: No such process
**** All tunnels are now down. Please fix the tunnel config /config/wg_confs/wg0.conf and restart the container ****
[ls.io-init] done.
- 主要言語
- Dockerfile
- スター
- 3.6k
- フォーク
- 440
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
linuxserver/docker-wireguard のほかの issue
-
Bad peer port config オープンno-issue-activity
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
linuxserver/docker-wireguard#416 · コメント 5 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
linuxserver/docker-wireguard#418 · コメント 2 件 ·
linuxserver/docker-wireguard の issue をすべて見る
似ている issue
-
agent-ready documentation needs-triage
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
-
area-deployment area-integrations triage:bot-seen
難易度 2/5 半日 初心者へのやさしさ 86/100
-
agentic-workflows
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug build
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
facebookincubator/velox#19194 ·