allow assigning of prefix network and broadcast ips to devices if prefix is_pool #8229

Closed
opened 2025-12-29 20:34:02 +01:00 by adam · 4 comments
Owner

Originally created by @ITJamie on GitHub (Jun 22, 2023).

NetBox version

v3.5.4

Python version

3.10

Steps to Reproduce

attempt to assign a broadcast ip or network IP to a device. (eg 192.168.0.0/24 or 192.168.0.255/24)

Expected Behavior

if the prefix the ip belongs to has is_pool set to true, it should be possible to assign the network and broadcast ips to an interface

Observed Behavior

error is raised about not being allowed to assign the network or broadcast ips to an interface
currently this is only allowed for /31,/32,/127,/128 network or broadcast ips.

additional info

note this is a follow on from #12687

Originally created by @ITJamie on GitHub (Jun 22, 2023). ### NetBox version v3.5.4 ### Python version 3.10 ### Steps to Reproduce attempt to assign a broadcast ip or network IP to a device. (eg 192.168.0.0/24 or 192.168.0.255/24) ### Expected Behavior if the prefix the ip belongs to has is_pool set to true, it should be possible to assign the network and broadcast ips to an interface ### Observed Behavior error is raised about not being allowed to assign the network or broadcast ips to an interface currently this is only allowed for /31,/32,/127,/128 network or broadcast ips. ### additional info note this is a follow on from #12687
adam added the type: bug label 2025-12-29 20:34:02 +01:00
adam closed this issue 2025-12-29 20:34:02 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jun 23, 2023):

if the prefix the ip belongs to has is_pool set to true, it should be possible to assign the network and broadcast ips to an interface

I disagree. Pool IPs by definition aren't intended to be assigned to an interface, and most operating systems predictably won't permit the assignment of a broadcast address to an interface.

@jeremystretch commented on GitHub (Jun 23, 2023): > if the prefix the ip belongs to has is_pool set to true, it should be possible to assign the network and broadcast ips to an interface I disagree. Pool IPs by definition aren't intended to be assigned to an interface, and most operating systems predictably won't permit the assignment of a broadcast address to an interface.
Author
Owner

@ITJamie commented on GitHub (Jun 27, 2023):

Ill happily close it out if you think this is unwise.
I did it based on a few follow up requests after the initial fix (https://github.com/netbox-community/netbox/issues/12687#issuecomment-1592660176)

@ITJamie commented on GitHub (Jun 27, 2023): Ill happily close it out if you think this is unwise. I did it based on a few follow up requests after the initial fix (https://github.com/netbox-community/netbox/issues/12687#issuecomment-1592660176)
Author
Owner

@ZPrimed commented on GitHub (Jun 28, 2023):

Pool IPs by definition aren't intended to be assigned to an interface, and most operating systems predictably won't permit the assignment of a broadcast address to an interface.

Imagine this scenario:

  • Firewall / router has a small subnet facing an upstream provider
  • A larger subnet is routed to the above device in its entirety (e.g. a /24)
  • I want to assign IPs out of that /24 to the router/firewall so it can perform 1:1 or 1:Many NAT to devices behind it

I should be allowed to assign both the broadcast and subnet address of that subnet (.0 and .255) on the firewall in that scenario, no?

What is the "correct" way to model this in NetBox, if not marking that Prefix as a "Pool"? ("Is a pool = yes" even says next to it "All IP addresses within this prefix are considered usable")

@ZPrimed commented on GitHub (Jun 28, 2023): > Pool IPs by definition aren't intended to be assigned to an interface, and most operating systems predictably won't permit the assignment of a broadcast address to an interface. Imagine this scenario: * Firewall / router has a small subnet facing an upstream provider * A larger subnet is routed to the above device in its entirety (e.g. a /24) * I want to assign IPs out of that /24 to the router/firewall so it can perform 1:1 or 1:Many NAT to devices behind it I *should* be allowed to assign both the broadcast and subnet address of that subnet (.0 and .255) on the firewall in that scenario, no? What is the "correct" way to model this in NetBox, if not marking that Prefix as a "Pool"? ("Is a pool = yes" even says next to it "All IP addresses within this prefix are considered usable")
Author
Owner

@jeremystretch commented on GitHub (Jun 29, 2023):

I want to assign IPs out of that /24 to the router/firewall so it can perform 1:1 or 1:Many NAT to devices behind it

Employing an IP address for NAT does not require that it be assigned to the interface. Only IP addresses which are actually configured for use to send and receive local traffic should be assigned to interfaces.

I'm going to close this out as the behavior described above is intentional.

@jeremystretch commented on GitHub (Jun 29, 2023): > I want to assign IPs out of that /24 to the router/firewall so it can perform 1:1 or 1:Many NAT to devices behind it Employing an IP address for NAT does not require that it be assigned to the interface. Only IP addresses which are actually configured for use to send and receive local traffic should be assigned to interfaces. I'm going to close this out as the behavior described above is intentional.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8229