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

Next available ASN #8550

Closed
trrunde opened this issue Feb 4, 2022 · 8 comments
Closed

Next available ASN #8550

trrunde opened this issue Feb 4, 2022 · 8 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Milestone

Comments

@trrunde
Copy link

trrunde commented Feb 4, 2022

NetBox version

v3.1.7

Feature type

New functionality

Proposed functionality

rfc6996 reserves a certain list of 16 / 32 bits asn for private asn. Simular as rfc1918 for ip-adresses.
https://datatracker.ietf.org/doc/html/rfc6996

Would it be possible to get a function for "get next available private asn" simular as we have next available ip, and next available prefix.

private asn's:
64512 - 65534
4200000000 - 4294967294

Use case

as an isp you could use this function to get available asn for corporate CE

in datacenter you could use this to get available asn to setup spine / leaf topology

Database changes

No response

External dependencies

No response

@trrunde trrunde added the type: feature Introduction of new functionality to the application label Feb 4, 2022
@jeremystretch
Copy link
Member

With the "next available" functionality for IP address and (in the upcoming v3.2 release) VLANs, NetBox references a parent prefix or group to determine the available range. So I think the first question here is, how would we want to define the available ranges?

Introducing a separate model for this purpose (e.g. ASNRange) seems bit overkill, but maybe not. Another option would be to (IMO reasonably) assume that only private AS numbers can be allocated automatically, and to allow the client to specify a starting and/or ending number.

@jeremystretch jeremystretch added the status: under review Further discussion is needed to determine this issue's scope and/or implementation label Feb 4, 2022
@trrunde
Copy link
Author

trrunde commented Feb 4, 2022

I would assume that only private ASN can be automaticly allocated. If its a public asn that would have to be entered after getting the data from end customer.

@markkuleinio
Copy link
Contributor

I would very much need this in 3.2 👍😉

I'd say something like ASNRange would be needed because the user may have need for several ASN ranges for different purposes. As a user I could then tag different ASNRanges differently for my different uses.

For the reference, my current approach to allocating ASNs is to manually create tags like Metadata:ASNs:65100-65149, and my app would first fetch the tags starting with Metadata:ASNs: to get the desired ranges, then fetch all ASNs, and finally loop through them to find an available ASN to use. (These tags are actually not attached in the objects but used only to save this custom configuration data in NetBox and not in an external configuration file. I guess another option would be creating a plugin to save this and other app-specific configuration data in a custom table in the database, but tags will probably do for now.)

@kerryb48
Copy link

This is definitely one we need and would love to see added in the near future!

@brendanbowden
Copy link

Another +1 to this one :)

I'm following a similar procedure to @markkuleinio using the netbox-bgp-plugin, where I pull all ASNs in a give range and loop through to find the first missing record. Something like @jeremystretch suggested to have the user specify start/end numbers in the API call would be plenty for my use case.

@jeremystretch
Copy link
Member

Ok, so let's move this forward with the idea of introducing a new ASNRange model. Aside from a name and minimum & maximum AS number values, are there any other fields the model needs? How about tenancy assignment?

@markkuleinio
Copy link
Contributor

I'd say tenancy and tags are the ones that I would use.

@jeremystretch jeremystretch added needs milestone Awaiting prioritization for inclusion with a future NetBox release and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Apr 6, 2022
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed needs milestone Awaiting prioritization for inclusion with a future NetBox release labels Jan 5, 2023
@jeremystretch jeremystretch added this to the v3.5 milestone Jan 5, 2023
@ITJamie
Copy link
Contributor

ITJamie commented Jan 12, 2023

This topic came up recently internally.

It would be nice to be able to scope private ASNRanges for particular tenants or uses.
When using the proposed "next available asn" it would be excellent if there was some consideration of the tenant or even site/region asn ranges?

@jeremystretch jeremystretch self-assigned this Feb 25, 2023
jeremystretch added a commit that referenced this issue Feb 27, 2023
* Move ASN to a separate module

* Move ASNField from dcim to ipam

* Introduce ASNRange model

* Add relationship from ASN to ASNRange

* Add an available-asns API endpoint

* Add RIR assignment for ASNRange

* Add standard tests

* Move child ASNs to a tabbed view

* Remove FK on ASN to ASNRange

* Add tests for provisioning available ASNs

* Add docs for ASNRange
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

6 participants