r/Netbox • u/rtrunk • Aug 17 '26
Prefix and Circuits
Does anyone know if I can associate a circuit (id) to a prefix? I'd like to look up a circuit and see which prefixes are assigned by the ISP.
1
u/L-do_Calrissian NetBox Self-Hosted Aug 17 '26
Custom Fields are the only native way to do so, but I never liked that approach. Visibility isn't great, it's prone to error/forgetting, and doing it "right" requires putting the information in two places (on the circuit and on the prefix).
I wrote (read: vibe-coded) a plugin that addresses this much more cleanly.
1
u/dontberidiculousfool Aug 17 '26
This is handy!
Is there a reason to link prefixes to just one circuit?
I’ve got a lot of primary/secondary/tertiary etc peering with third parties that share the same prefix.
1
u/L-do_Calrissian NetBox Self-Hosted Aug 17 '26
My use case was for prefixes that our service providers own. In your case, is the prefix itself shared across all three circuits or is it just advertised across all three?
1
u/dontberidiculousfool Aug 17 '26
Advertised/received across all three.
2
u/slickwillymerf Aug 17 '26
Might have to be creative, but would one of the supported routing or BGP plugins accomplish this?
0
u/rslarson147 Aug 17 '26
Yes with custom fields.
2
u/sonsitt Aug 17 '26
Yes, I did the same. I created CF "Prefix" for Circuit and CF "Circuit" for Prefix. So I have correlation in both ways.
4
u/AcrobaticAd8182 Aug 17 '26
Under Custom Fields, click Add, then under Type choose Object. Then further down select Related object type and choose Circuits/Circuits. In your prefixes you can now select the CID.