Bulk assign IP addresses to interface #2798

Closed
opened 2025-12-29 18:22:16 +01:00 by adam · 6 comments
Owner

Originally created by @iwfjacob on GitHub (Aug 9, 2019).

Python version: 2.7.15
NetBox version: 2.6.2

Proposed Functionality

Bulk assign IP addresses to an interface from an existing prefix pool

Use Case

At the moment, there is no real way to bulk add IP addresses to a device / interface. An example would be let's say we have the subnet 192.168.1.0/24 as a pool, server A has been assigned 192.168.15-101 while server B has been assigned 192.168.132-168

At the moment, there is no real way to bulk assign an IP range, you have to go one by one adding the IP addresses .15 through .101. It should be very simple of coming from an IP pool (with the IP addresses created) you could add 192.168.[15-101]/24 to the interface

Originally created by @iwfjacob on GitHub (Aug 9, 2019). Python version: 2.7.15 NetBox version: 2.6.2 ### Proposed Functionality Bulk assign IP addresses to an interface from an existing prefix pool ### Use Case At the moment, there is no real way to bulk add IP addresses to a device / interface. An example would be let's say we have the subnet 192.168.1.0/24 as a pool, server A has been assigned 192.168.15-101 while server B has been assigned 192.168.132-168 At the moment, there is no real way to bulk assign an IP range, you have to go one by one adding the IP addresses .15 through .101. It should be very simple of coming from an IP pool (with the IP addresses created) you could add 192.168.[15-101]/24 to the interface
adam closed this issue 2025-12-29 18:22:16 +01:00
Author
Owner

@Bitsky commented on GitHub (Aug 9, 2019):

+1 on this.

I had the case where I needed to add several hundred IP addresses to an interface and ended up writing a script for it because it would have taken hours via the UI.

That also reminds me that IP listings would benefit from pagination (eg display up to 50 IPs and add a "show all" button). If your IP list is in the upper 3-digit count, opening the device page slows down noticeably. Granted it's not an everyday case most users run into.

@Bitsky commented on GitHub (Aug 9, 2019): +1 on this. I had the case where I needed to add several hundred IP addresses to an interface and ended up writing a script for it because it would have taken hours via the UI. That also reminds me that IP listings would benefit from pagination (eg display up to 50 IPs and add a "show all" button). If your IP list is in the upper 3-digit count, opening the device page slows down noticeably. Granted it's not an everyday case most users run into.
Author
Owner

@iwfjacob commented on GitHub (Aug 9, 2019):

pagination

Yes, absolutely. Pagination or grouping, IE showing 192.168.15-101/24 which could then be expanded.

@iwfjacob commented on GitHub (Aug 9, 2019): >pagination Yes, absolutely. Pagination or grouping, IE showing 192.168.15-101/24 which could then be expanded.
Author
Owner

@tyler-8 commented on GitHub (Aug 20, 2019):

@Bitsky - out of curiosity, are these load balancers you're working with? I had questions about how to best approach attaching VIPs to a device interface and given the concerns noted in this thread I've opted to hold off on attaching them to a device.

@tyler-8 commented on GitHub (Aug 20, 2019): @Bitsky - out of curiosity, are these load balancers you're working with? I had questions about how to best approach attaching VIPs to a device interface and given the concerns noted in this thread I've opted to hold off on attaching them to a device.
Author
Owner

@Bitsky commented on GitHub (Aug 25, 2019):

@tyler-8 Not really. Just normal systems where we park parts of unused pools instead of nullrouting.

@Bitsky commented on GitHub (Aug 25, 2019): @tyler-8 Not really. Just normal systems where we park parts of unused pools instead of nullrouting.
Author
Owner

@jeremystretch commented on GitHub (Oct 17, 2019):

An example would be let's say we have the subnet 192.168.1.0/24 as a pool, server A has been assigned 192.168.15-101 while server B has been assigned 192.168.132-168

These would not be interface assignments, but rather IPs designated as belonging to a particular administrative group. NetBox tags can be used for this function.

@jeremystretch commented on GitHub (Oct 17, 2019): > An example would be let's say we have the subnet 192.168.1.0/24 as a pool, server A has been assigned 192.168.15-101 while server B has been assigned 192.168.132-168 These would not be interface assignments, but rather IPs designated as belonging to a particular administrative group. NetBox tags can be used for this function.
Author
Owner

@iwfjacob commented on GitHub (Oct 17, 2019):

@jeremystretch they are interface assignments though. In the physical server, it has ifcfg-range0 for example with all of those IP addresses assigned to it. Are you saying each server would then need a separate administrative group and tag?

@iwfjacob commented on GitHub (Oct 17, 2019): @jeremystretch they are interface assignments though. In the physical server, it has ifcfg-range0 for example with all of those IP addresses assigned to it. Are you saying each server would then need a separate administrative group and tag?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2798