AdguardTeam/AdGuardHome · error
range end %v is outside network %v
Error message
range end %v is outside network %v
What it means
Validation found that range_end is not contained within the configured subnet (CIDR). The top of the dynamic lease pool must be inside the interface's network.
Source
Thrown at internal/dhcpd/config.go:236
if c.ipRange.contains(gatewayIP.AsSlice()) {
return fmt.Errorf(
"gateway ip %v in the ip range: %v-%v",
gatewayIP,
c.RangeStart,
c.RangeEnd,
)
}
if !c.subnet.Contains(rangeStart) {
return fmt.Errorf(
"range start %v is outside network %v",
c.RangeStart,
c.subnet,
)
}
if !c.subnet.Contains(rangeEnd) {
return fmt.Errorf(
"range end %v is outside network %v",
c.RangeEnd,
c.subnet,
)
}
return nil
}
// V6ServerConf - server configuration
type V6ServerConf struct {
// Logger is used for logging the operation of the DHCPv6 server. It must
// not be nil.
Logger *slog.Logger `yaml:"-" json:"-"`
Enabled bool `yaml:"-" json:"-"`
InterfaceName string `yaml:"-" json:"-"`
View on GitHub (pinned to b41aefbe51)
Solutions
- Set range_end inside the subnet and below the broadcast address (e.g. .254 for /24)
- Check subnet_mask matches the interface network
- Re-apply config
Example fix
# before subnet_mask: 255.255.255.0 range_end: 192.168.5.254 # after subnet_mask: 255.255.255.0 range_end: 192.168.0.254
Defensive patterns
Strategy: validation
Validate before calling
if !subnet.Contains(rangeEnd) { return fmt.Errorf("range_end %v outside subnet", rangeEnd) } Prevention
- Avoid .255 (broadcast) as range end on /24
- Validate entire range at config-build time
When it happens
Trigger: Setting range_end outside the interface subnet, e.g. using 192.168.1.255 (broadcast) with a /16-unrelated mask or an address in a different subnet, then calling Create.
Common situations: Using .255 as range end with a /24 (also conflicts with broadcast), subnet changes after range was configured, copy-paste errors.
Related errors
- range start %v is outside network %v
- subnet %s does not contain the ip %q
- another client %q uses the same subnet %q
- %v is not an IPv4 %s
- gateway ip %v in the ip range: %v-%v
AI-assisted analysis of AdguardTeam/AdGuardHome@b41aefbe51 (2026-08-27).
Data as JSON: /api/errors/cd935033035d6fc1.
Report an issue: GitHub.