Skip to content

Conversation

@kvaps
Copy link

@kvaps kvaps commented Jan 19, 2026

Summary

Allow allowed-location-ips CIDRs to fully contain node internal IPs without being rejected.

Problem

Previously, if an allowed-location-ips CIDR contained a node's internal IP or allowed IP, it was rejected with a warning:

overlapping allowed location IPnet with allowed IPnets

For example, setting allowed-location-ips=192.168.100.0/24 on a node with internal IP 192.168.100.11 would fail.

Solution

This was overly restrictive since WireGuard uses longest prefix match for routing. Now, if an allowed-location-ip fully contains a node's IP (e.g., 192.168.100.0/24 contains 192.168.100.11/32), the allowed-location-ip is accepted.

The more specific route to the node's IP will still work correctly due to longest prefix match.

Test plan

  • Build passes
  • Tested with allowed-location-ips containing node IP

Previously, if an allowed-location-ip CIDR contained a node's internal
IP or allowed IP, it was rejected with a warning. This was overly
restrictive since WireGuard uses longest prefix match for routing.

Now, if an allowed-location-ip fully contains a node's IP (e.g.,
192.168.100.0/24 contains 192.168.100.11/32), the allowed-location-ip
is accepted. The more specific route to the node's IP will still work
correctly.

This allows users to advertise entire subnets via allowed-location-ips
even when nodes have IPs within those subnets.

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Andrei Kvapil <[email protected]>
@kvaps kvaps marked this pull request as ready for review January 19, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant