netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Public demo: https://demo.netbox.dev
http://netboxlabs.com/oss/netbox/
Apache License 2.0
15.72k stars 2.53k forks source link

Dual-stack or multiple OOB IP address #16958

Open bluikko opened 1 month ago

bluikko commented 1 month ago

NetBox version

v4.0.7

Feature type

Data model extension

Proposed functionality

Currently only one IP address may be marked as OOB IP address.
We run everything as dual-stack, including OOB. This issue proposes to change the OOB IP address to refer multiple IP addresses instead of just one IP address.

The original issue #8137 only considered IPv4 (obvious from the screenshot and text) and this is a problematic mindset but I digress.
A comment in https://github.com/netbox-community/netbox/issues/8137#issuecomment-999819759 brought up multiple IP addresses and how this is obviously more complex to implement. A latter comment left the door open for additional FR (this one).

Use case

To model dual-stack OOB.
And to a (much) lesser extent multiple OOB IP addresses.

Currently those with dual-stack OOB probably decide to not use this feature at all and instead use different methods.

Database changes

I do not know exactly but I assume the database would need to be able to refer multiple IP addresses instead of a single IP address as OOB in the Device model.

If it is indeed currently implemented as a single foreign key then I would imagine a layer of indirection might be necessary. It looks like some work was done in #13094 for this as a generic solution that could be used for all such references.

A quick & dirty solution would be to have oob_ip4 and oob_ip6 similar to the Primary IP Address fields, where these would be simple foreign keys. I would estimate this solution would cover the vast majority of the use cases, thought there are sure to be at least few users who would prefer more than one IP address per address family.
This would then have implications on displaying the data as there might be 2 separate fields similarly to the Primary IP address; instead of just listing all OOB IP addresses in a single form field.

Further discussion would probably be needed to reach the best implementation details.

External dependencies

None.

bluikko commented 1 month ago

Another much more radical option would be to mark interfaces as OOB instead of IP addresses and then use all IP addresses of that interface as OOB. I'd be fine with this and it looks much more simple to implement.