Netbox Plugin: IP-address created always uses the "largest prefix" in Netbox
-
Let's say I have the prefix 192.168.0.0/16 added in Netbox, and a sub-prefix 192.168.100.0/24. Now, if I have a VM running using IP 192.168.100.69, the Netbox plugin will create this IP as 192.168.100.69/16 instead of 192.168.100.69/24.
Is this intended behavior and if not, should I open an issue about it on GitHub? Thanks!
-
Question for @fohdeesha and/or @pdonias
-
@olivierlambert I vaguely remember @pdonias and I discussing which of these behaviors would be best and we decided on adding it to the smallest matching prefix, I'm not sure why the behavior is the opposite
-
@vilhelm This isn't the intended behavior, it should indeed pick the /24 prefix. I tested it with your values and it properly chooses the /24 prefix. Is the Netbox plugin up-to-date and re-built? It should work since commit
0966efb7f29758a3a179237e97e641f6288b6040
(XO 5.63.1, xo-server-netbox 0.3.1). -
@pdonias Yes, I was running a newer version than that but just to make sure I upgraded to
8068b83ffe58e6caed0cac5816ac2690479a9c41
. Still the same problem, unfortunately.I'm not too sure if it matters, but there are VMs running in the pool that does not have an IP in a "smaller" /24 prefix. So if the prefixes 192.168.0.0/16 and 192.168.100.0/24 are in Netbox, there might be VMs using IPs other than the ones in the 192.168.100.0/24 prefix.