-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
Problem
Pool definitions only store CIDR, prefix, exclusions, and metadata. Gateway and DNS configuration is missing, forcing each BNG node to be independently configured with --pool-gateway and --pool-dns CLI flags.
In a distributed deployment with multiple BNG nodes sharing a Nexus pool, this means:
- No single source of truth for gateway/DNS per pool
- Misconfiguration risk (different BNGs could serve different gateways for the same pool)
- Breaks the ZTP story — BNG can auto-discover Nexus but still needs manual gateway/DNS config
Raised by @infinitydon in codelaboratoryltd/bng#92.
Proposed Changes
Add gateway and dns fields to the pool model and API:
Pool creation request:
{
"id": "default",
"cidr": "10.0.1.0/24",
"prefix": 32,
"gateway": "10.0.1.1",
"dns": ["8.8.8.8", "8.8.4.4"]
}Files to modify:
internal/store/models.go— AddGatewayandDNSfields toPoolstructinternal/api/pools.go— Add fields toPoolRequestandPoolResponseinternal/validation/— Add validation for gateway (must be valid IP within or adjacent to CIDR) and DNS (valid IP addresses)
Acceptance Criteria
-
POST /api/v1/poolsaccepts optionalgateway(string IP) anddns(array of string IPs) -
GET /api/v1/pools/{id}returns gateway and dns in response - Gateway validated as valid IPv4/IPv6 address
- DNS entries validated as valid IP addresses
- Fields are optional (backwards compatible — existing pools without gateway/dns continue to work)
- Tests updated
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels