Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make IP Prefix configurable and available ip deterministic #72

Merged
merged 9 commits into from
Aug 3, 2021

Conversation

kradalby
Copy link
Collaborator

@kradalby kradalby commented Aug 2, 2021

Hi

This PR contains two commits were the first (making ip prefix configurable) one can be cherry picked if the second (rework get available ip) is not desirable.

Please see the individual commit messages for details.

The code has some tests, but real world testing help would be appreciated.

If it is not desirable to change the IP allocation, then I can rework it into an alternative to the original, so users can opt in/out.

This commit makes the IP prefix used to generate addresses configurable
to users. This can be useful if you would like to use a smaller range or
if your current setup is overlapping with the current range.

The current range is left as a default
This commit reworks getAvailableIp with a "simpler" version that will
look for the first available IP address in our IP Prefix.

There is a couple of ideas behind this:

* Make the host IPs reasonably predictable and in within similar
  subnets, which should simplify ACLs for subnets
* The code is not random, but deterministic so we can have tests
* The code is a bit more understandable (no bit shift magic)
@kradalby kradalby marked this pull request as draft August 2, 2021 21:30
@kradalby kradalby marked this pull request as ready for review August 3, 2021 09:17
@juanfont juanfont self-requested a review August 3, 2021 18:25
Copy link
Owner

@juanfont juanfont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just fantastic, and a great idea!

Thank you so much!

@juanfont juanfont merged commit 3879120 into juanfont:main Aug 3, 2021
@kradalby kradalby deleted the ip-pool branch August 5, 2021 16:23
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.

2 participants