Filter IP addresses by parent prefix in custom scripts #9487
Answered
by
candlerb
JulijusBertasius
asked this question in
Q&A
-
I can't find a easy way to get all IP addresses by parent prefix in custom scripts. There is no option like:
|
Beta Was this translation helpful? Give feedback.
Answered by
candlerb
Jun 6, 2022
Replies: 1 comment 2 replies
-
There's a method the other way round, on Prefix:
If you still want to start with
(you may want to filter on the value of VRF as well) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
JulijusBertasius
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's a method the other way round, on Prefix:
If you still want to start with
IPAddress.objects
and filter downwards, then I suggest you copy the logic from the REST APIIPAddressFilterSet
here and here. The key part is:(you may want to filter on the value of VRF as well)