Skip to content

[FEATURE] - Automatically allocate interface addresses from configured CIDR prefixes #1417

Description

@zhxycn

Is your feature request related to a problem? Please describe.

Some network or tunnel setups provide clients with a usable IPv4 or IPv6 prefix, rather than a specific interface host address. Users currently need to manually choose and maintain a /32 or /128 address from that prefix.

Describe the solution you'd like

Add an optional interface-level Address prefixes setting that accepts comma-separated IPv4 and IPv6 CIDR prefixes.

Each time a tunnel starts, the app should randomly allocate an interface address from every configured prefix: IPv4 addresses should use a /32 mask, and IPv6 addresses should use a /128 mask. Generated addresses should only be used by the runtime WireGuard configuration and should not be written back to the saved configuration.

If an interface address for the same address family is already configured, the generated address should replace it for that runtime session to avoid conflicting addresses.

Additional context

I have implemented this feature and would be happy to open a PR if it is something the project would be interested in:

1bedaba...zhxycn:wgtunnel:master

Screenshots Image Image Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions