Open inetman28 opened 4 years ago
@inetman28 Hello! How would you prefer this is automated? Are you suggesting that all prefixes which exist already inside the NetBox instance would be permitted and anything not created there would be ignored?
@inetman28 Hello! How would you prefer this is automated? Are you suggesting that all prefixes which exist already inside the NetBox instance would be permitted and anything not created there would be ignored?
Yes, you are right. I mean something like this:
import pynetbox
IPV4_ALLOWED = []
IPV6_ALLOWED = []
all_prefixes = nb.ipam.prefixes.all()
for prefix in all_prefixes:
if prefix.family.value == 4:
IPV4_ALLOWED.append(prefix.prefix)
elif prefix.family.value == 6:
IPV6_ALLOWED.append(prefix.prefix)
Is your feature request related to a problem? Please describe. We must manually fill up ip-list IPV4-ALLOWED (IPV6-ALLOWED)
Describe the solution you'd like In some environment like own I already have fill up ip-prefixes in netbox. We can automate it and do not fill up ip-list manually.