available-ips should return /32 if is_pool flag in prefix is set #2290

Closed
opened 2025-12-29 17:24:33 +01:00 by adam · 4 comments
Owner

Originally created by @christianpinger on GitHub (Jan 14, 2019).

Environment

  • Python version: 3.5.2
  • NetBox version: 2.5.2

Proposed Functionality

When requesting an ip-address via API/available-ips and the is_pool flag is set in the used prefix, netbox should return the ip-address with a /32 mask, instead of the mask of the prefix. The behaviour, if the is_pool flag is not set, should not change.

Use Case

We use netbox to assign ip-addresses to virtual machine interfaces. We are in a completely routed environment. So every ip is independent from each other, the only mask making sense is a /32. This is our understanding of an ip-pool, but I 'd like to read other thoughts on that.

Database Changes

none

External Dependencies

none

Originally created by @christianpinger on GitHub (Jan 14, 2019). <!-- NOTE: This form is only for proposing specific new features or enhancements. If you have a general idea or question, please post to our mailing list instead of opening an issue: https://groups.google.com/forum/#!forum/netbox-discuss NOTE: Due to an excessive backlog of feature requests, we are not currently accepting any proposals which significantly extend NetBox's feature scope. Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.5.2 * NetBox version: 2.5.2 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality When requesting an ip-address via API/available-ips and the is_pool flag is set in the used prefix, netbox should return the ip-address with a /32 mask, instead of the mask of the prefix. The behaviour, if the is_pool flag is not set, should not change. <!-- Convey an example use case for your proposed feature. Write from the perspective of a NetBox user who would benefit from the proposed functionality and describe how. ---> ### Use Case We use netbox to assign ip-addresses to virtual machine interfaces. We are in a completely routed environment. So every ip is independent from each other, the only mask making sense is a /32. This is our understanding of an ip-pool, but I 'd like to read other thoughts on that. <!-- Note any changes to the database schema necessary to support the new feature. For example, does the proposal require adding a new model or field? (Not all new features require database changes.) ---> ### Database Changes none <!-- List any new dependencies on external libraries or services that this new feature would introduce. For example, does the proposal require the installation of a new Python package? (Not all new features introduce new dependencies.) --> ### External Dependencies none
adam closed this issue 2025-12-29 17:24:33 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jan 15, 2019):

This issue has been closed as it does not conform to one of the provided templates as required by the contributing guide. If you'd like to request that your issue be re-opened, please first update the content so that it matches the appropriate template (this may require rewriting your issue entirely).

@jeremystretch commented on GitHub (Jan 15, 2019): This issue has been closed as it does not conform to one of the [provided templates](https://github.com/digitalocean/netbox/issues/new/choose) as required by the [contributing guide](https://github.com/digitalocean/netbox/blob/master/CONTRIBUTING.md). If you'd like to request that your issue be re-opened, please first update the content so that it matches the appropriate template (this may require rewriting your issue entirely).
Author
Owner

@christianpinger commented on GitHub (Jan 16, 2019):

Thats strange, as I have searched for templates, but they did not show up, when creating a new ticket. Your direct link works though, so I've updated the issue.

@christianpinger commented on GitHub (Jan 16, 2019): Thats strange, as I have searched for templates, but they did not show up, when creating a new ticket. Your direct link works though, so I've updated the issue.
Author
Owner

@jeremystretch commented on GitHub (Jan 16, 2019):

When requesting an ip-address via API/available-ips and the is_pool flag is set in the used prefix, netbox should return the ip-address with a /32 mask, instead of the mask of the prefix.

I see no justification for this. There may be instances where you want to retain the prefix mask, so the API provides it. And in cases where you don't, it's trivial to swap out the provided mask for a /32 (or /128).

@jeremystretch commented on GitHub (Jan 16, 2019): > When requesting an ip-address via API/available-ips and the is_pool flag is set in the used prefix, netbox should return the ip-address with a /32 mask, instead of the mask of the prefix. I see no justification for this. There may be instances where you want to retain the prefix mask, so the API provides it. And in cases where you don't, it's trivial to swap out the provided mask for a /32 (or /128).
Author
Owner

@christianpinger commented on GitHub (Jan 16, 2019):

What is the use case of assigning 192.168.1.255/24 to an interface then?

@christianpinger commented on GitHub (Jan 16, 2019): What is the use case of assigning 192.168.1.255/24 to an interface then?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2290