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

Adding regions to prefixes #5788

Closed
elixdreamer opened this issue Feb 11, 2021 · 10 comments
Closed

Adding regions to prefixes #5788

elixdreamer opened this issue Feb 11, 2021 · 10 comments
Labels
type: feature Introduction of new functionality to the application

Comments

@elixdreamer
Copy link

Environment

  • Python version: unknown
  • NetBox version: v2.10.4

Proposed Functionality

Add a region to a specific prefix and not only a site.

Use Case

In our network design we have many sites(+4k) that will divided in 5 major regions.
Since we will allocating prefixes to specific regions we want to create some automatic IP allocation based on the region where the site is in.
I have tried adding the regions to a specific prefix but this isn't saved. Only sites are stored to the prefix.

Database Changes

Adding the region field to a prefixes

@DanSheps DanSheps added status: under review Further discussion is needed to determine this issue's scope and/or implementation type: feature Introduction of new functionality to the application labels Feb 11, 2021
@sdktr
Copy link
Contributor

sdktr commented Feb 12, 2021

How would this 'region allocation' be used? Where would this user seeking for a new site assignment get the hint that it is prefered to come from this region allocation?

@jeremystretch
Copy link
Member

This directly conflicts with the assignment of a site. IMO it would make more sense to allow the assignment of multiple sites.

@pkomissarov
Copy link

pkomissarov commented Feb 13, 2021

For us it also would be usefull if prefix can be "super-prefix" for region and bound to the whole region, but not bound to any site. Important moment that one region can have several such "super-prefixes".

Use case

We need to build ACL for every site in region. In this ACL "super-prefixes" are used as destinations, to allow traffic within region.

Example

RegionX already owns two "super-prefixes" 10.100.0.0/16 and 10.200.0.0/16, and has a lot of sites.
Site1 and Site2 are two sites from this region but from different super-prefixes.
Site1 owns prefix 10.100.1.0/24.
Site2 owns prefix 10.200.1.0/24.

ACL for Site1:

permit ip 10.100.1.0/24 to 10.100.0.0/16
permit ip 10.100.1.0/24 to 10.200.0.0/16
deny ip any to any

ACL for Site2:

permit ip 10.200.1.0/24 to 10.100.0.0/16
permit ip 10.200.1.0/24 to 10.200.0.0/16
deny ip any to any

Such ACL is short. Another approach is to write "permit" line for every site in region, but ACL becomes much longer if there are a lot of sites in region.

Database Changes

Add region field to prefix. May be prohibit to set site field, if region field is set.

@tbk2
Copy link

tbk2 commented Feb 17, 2021

We'd also need the ability to bind prefixes to regions.

Use case:

We have several regions. There is only one router within a region. A prefix may only be defined on one router. However, the prefix can be present in different sites within a region.

Database changes

Add region field to prefix. May be prohibit to set site field, if region field is set.

@elixdreamer
Copy link
Author

How would this 'region allocation' be used? Where would this user seeking for a new site assignment get the hint that it is prefered to come from this region allocation?

The user will have a custom script where he will add hardware with a possibility to select a region.
If the regions are assigned to prefixes we can assign correct available IP's.

This directly conflicts with the assignment of a site. IMO it would make more sense to allow the assignment of multiple sites.

The problem here is that we will add sites based on implementation plan that is planned over multiple years. So at day one we will not have 4k sites availble in Netbox. They will be added on request. Since we need to add sites we need to know to what subnets they belong based on regions.

I hope we could get such an implementation as i can see some other users are identifying them self with this request.

@aodix
Copy link

aodix commented Feb 26, 2021

How would this 'region allocation' be used? Where would this user seeking for a new site assignment get the hint that it is prefered to come from this region allocation?

There would be a total of 4000 sites, those 4000 sites will have 1 or more device. Those devices needs to have an IP that is in a prefix for that geographical region. That means

  • Every geographical region has his prefix.
  • When a new site/device will be added we know in what geographical region it would be added.
  • The IP will needs to be selected in the prefix for that geographical region

@jeremystretch
Copy link
Member

#5892 (the proposed introduction of a SiteGroup model) is likely relevant to this discussion.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@github-actions github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Apr 14, 2021
@hyudra
Copy link

hyudra commented Apr 27, 2021

Is it possible to assign prefix to Site Group without a Site? @jeremystretch

@jeremystretch jeremystretch added status: blocked Another issue or external requirement is preventing implementation and removed pending closure Requires immediate attention to avoid being closed for inactivity status: under review Further discussion is needed to determine this issue's scope and/or implementation labels May 21, 2021
@jeremystretch
Copy link
Member

Actually, let's fold this into #6414 (prefix assignment to site groups) since it doesn't make sense to do one and not the other.

@jeremystretch jeremystretch removed the status: blocked Another issue or external requirement is preventing implementation label May 21, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

8 participants