Feature Request: Multiple named `--ifconfig-pool` pools with dynamic group-based selection
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- c
- 領域
- networking
調査の方向性
まず、既存の --ifconfig-pool の処理、CCD 設定、client-auth 設定ブロック、組み込みのプール追跡を確認します。名前付きプール、クライアントごとの選択、フォールバック動作、枯渇、ステータス報告、切断時の解放をどのように連携させるべきかを明確にします。動作が仕様化され、これらの経路全体に実装され、関連するテストでカバーされれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem Statement
Modern OpenVPN deployments increasingly use external authentication — OAuth2/OIDC (openvpn-auth-oauth2), LDAP, RADIUS. Users authenticate and authorize via groups/roles, and each group needs its own IP subnet for:
- Firewall rules (MikroTik, iptables) based on source subnet
- Monitoring and session tracing
- Quality of Service policies
- Access segregation to internal resources
Example use-case:
| Group | Required subnet |
|---|---|
support |
10.8.3.0/24 |
all (regular VPN) |
10.8.0.0/24 |
| Administrators | 10.8.0.0/24 with per-user static IP |
Currently OpenVPN supports only a single pool via --server or --ifconfig-pool. There is no mechanism to define multiple pools and dynamically select which pool to assign an IP from based on the client's group/role.
Current Workarounds and Their Limitations
1. CCD + static IPs (ifconfig-push)
Each profile/group gets a CCD file with ifconfig-push. However:
- This is a static assignment, not a pool — all users in the same group would get the same IP, which doesn't work for concurrent connections.
- Per-user CCD files don't scale (N users = N files to manage).
- No dynamic IP allocation — you must manually manage the address space.
2. client-connect script with external IPAM
A custom script can maintain its own pool DB and issue ifconfig-push via the management interface. Drawbacks:
- OpenVPN is unaware of this external pool — no conflict detection with
--ifconfig-pool. - No integration with OpenVPN's built-in pool tracking.
- Requires external locking and persistence mechanisms.
- Duplicates functionality that should be in the core.
3. client-auth (MDA) + ifconfig-push
When using the management interface (e.g. openvpn-auth-oauth2), the client-auth command can include a config block with ifconfig-push. This works, but:
- There's no way to say "give me any free IP from pool X" — you must hardcode the IP.
- The selected profile/group info is available at auth time but cannot be used to select a pool dynamically.
4. Profile selector + per-profile static IPs (our current setup)
Our current setup:
/etc/openvpn-auth-oauth2/client-config/Access_VPN_all.conf— noifconfig-push, IP from the default pool/etc/openvpn-auth-oauth2/client-config/Access_VPN_support.conf—ifconfig-push 10.8.3.10- Per-user CCD for admins —
ifconfig-push 10.8.3.12
The CEL expression in openvpn-auth-oauth2 v2 correctly selects the config file based on Keycloak groups, but all users from the support group still get the same static IP. This is fine for our current scale, but it doesn't scale to multiple concurrent users per group without IP conflicts.
Proposed Feature: Named --ifconfig-pool pools with dynamic selection
Server configuration
Allow defining multiple named pools in server.conf:
ifconfig-pool support 10.8.3.0 255.255.255.0 10.8.3.10-10.8.3.250
ifconfig-pool all 10.8.0.0 255.255.255.0 10.8.0.10-10.8.0.250
Where the syntax could be:
ifconfig-pool <name> <network> <netmask> [<start-ip>-<end-ip> | <size>]
If no explicit start/end range is given, the pool auto-calculates from the network.
Per-client pool selection
Add a new option for CCD files and client-auth config blocks:
# In CCD file:
ifconfig-pool "support"
# Or in client-auth config block sent via management interface:
ifconfig-pool "all"
When ifconfig-pool "name" is present instead of ifconfig-push, OpenVPN would:
- Look up the named pool
- Allocate the next free IP from that pool
- Track the allocation (including in the status file)
- Release on disconnect (same as the existing pool mechanism)
Priority/fallback behavior
- If a client has both
ifconfig-pool "name"in CCD and the server has a matching pool — use it. - If the named pool doesn't exist or is exhausted — fall back to the default
--ifconfig-pool. - If
ifconfig-pushis also present —ifconfig-pushtakes precedence (backward compatibility).
Integration with client-auth (management interface)
This is especially important for OAuth2 flows. When openvpn-auth-oauth2 calls:
client-auth CID KID\n
ifconfig-pool "support"\n
END\n
OpenVPN would allocate from the support pool instead of the default one.
Benefits
- No code changes needed in auth plugins — the plugin already sends config blocks; it just needs the ability to specify a pool name instead of a hardcoded IP.
- Backward compatible — existing
--ifconfig-poolwithout a name becomes the default pool. - Scales — multiple users in the same group each get a unique IP from their group's subnet.
- Integrates with status file, conflict detection, and pool tracking.
- CCD-friendly — group-level CCD files can use
ifconfig-pool "name"instead of per-userifconfig-push.
Use Cases Beyond OAuth2 Groups
- RADIUS pools — RADIUS server could return a pool attribute (e.g.
Framed-Pool). - Multi-tenant servers — different customers on the same OpenVPN instance get IPs from different subnets.
- Certificate-based — different certificate OUs could map to different pools via CCD.
Related
- openvpn-auth-oauth2 issue #896 — "Different IP pools per group" (feature request in the auth plugin, but the real limitation is in OpenVPN core)
- 主要言語
- C
- スター
- 14.8k
- フォーク
- 3.4k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OpenVPN/openvpn のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 71/100
-
CVE-2026-11604 vs OpenVPN 2.7.x Documentation再び着手できるかも @lstipakov が 35 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンDCO website Windows
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
Document Real Address format change in management/status output (OpenVPN 2.7)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンdocumentation enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Since 2.7.9 "route-method exe" can't set route対応中かも @d12fk が 1 日前に担当しました。 オープンoutdated code Windows
-
enhancement feature
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
OpenVPN/openvpn の issue をすべて見る
似ている issue
-
issue: bug report
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
Stellarium/stellarium#5197 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ChupathingyCE/chupathingyce#1550 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] SWAPDB sends no invalidation to CLIENT TRACKING clients対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
redis/redis#16302 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信