How to create a child prefix with specific starting value and netmask in a custom script? #18249
-
Hello everyone, Is there a built-in function in NetBox that allows creating a prefix starting at a specific value and choosing the netmask? Or do I need to calculate and create it manually? Thank you for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You simply have to create (and save) a Prefix object with the desired parameters. There is no explicit linking of "Parent" and "Child" prefixes; this is inferred from the prefix being contained within a larger prefix, at query time. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the clarification! I understand now that I just need to create and save a Prefix object with the desired parameters, and the parent-child relationship is determined automatically based on containment. I appreciate your help! |
Beta Was this translation helpful? Give feedback.
You simply have to create (and save) a Prefix object with the desired parameters.
There is no explicit linking of "Parent" and "Child" prefixes; this is inferred from the prefix being contained within a larger prefix, at query time.