mirror of
https://github.com/netbox-community/netbox.git
synced 2026-02-26 02:35:12 +01:00
Enhance VRF export/import RT modeling #7810
Open
opened 2025-12-29 20:28:30 +01:00 by adam
·
16 comments
No Branch/Tag Specified
main
21524-invlaid-paths-exception
21518-cf-decimal-zero
21356-etags
feature
20787-spectacular
21477-extend-graphql-api-filters-for-cables
21331-deprecate-querystring-tag
21304-deprecate-housekeeping-command
21481-facility-id-doesnt-show-in-rack-page
21429-cable-create-add-another-does-not-carry-over-termination
21364-swagger
20442-callable-audit
feature-ip-prefix-link
20923-dcim-templates
20911-dropdown-3
fix_module_substitution
21203-q-attr-denorm
21160-filterset
21118-site
20911-dropdown-2
21102-fix-graphiql-explorer
20044-elevation-stuck-lightmode
v4.5-beta1-release
20068-import-moduletype-attrs
20766-fix-german-translation-code-literals
20378-del-script
7604-filter-modifiers-v3
circuit-swap
12318-case-insensitive-uniqueness
20637-improve-device-q-filter
20660-script-load
19724-graphql
20614-update-ruff
14884-script
02496-max-page
19720-macaddress-interface-generic-relation
19408-circuit-terminations-export-templates
20203-openapi-check
fix-19669-api-image-download
7604-filter-modifiers
19275-fixes-interface-bulk-edit
fix-17794-get_field_value_return_list
11507-show-aggregate-and-rir-on-api
9583-add_column_specific_search_field_to_tables
v4.5.3
v4.5.2
v4.5.1
v4.5.0
v4.4.10
v4.4.9
v4.5.0-beta1
v4.4.8
v4.4.7
v4.4.6
v4.4.5
v4.4.4
v4.4.3
v4.4.2
v4.4.1
v4.4.0
v4.3.7
v4.4.0-beta1
v4.3.6
v4.3.5
v4.3.4
v4.3.3
v4.3.2
v4.3.1
v4.3.0
v4.2.9
v4.3.0-beta2
v4.2.8
v4.3.0-beta1
v4.2.7
v4.2.6
v4.2.5
v4.2.4
v4.2.3
v4.2.2
v4.2.1
v4.2.0
v4.1.11
v4.1.10
v4.1.9
v4.1.8
v4.2-beta1
v4.1.7
v4.1.6
v4.1.5
v4.1.4
v4.1.3
v4.1.2
v4.1.1
v4.1.0
v4.0.11
v4.0.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.2-r1
v1.6.1-r1
1.6.1
v1.6.0
v1.5.2
v1.5.1
v1.5.0
v1.4.2
v1.4.1
v1.4.0
v1.3.2
v1.3.1
v1.3.0
v1.2.2
v1.2.1
v1.2.0
v1.1.0
v1.0.7-r1
v1.0.7
v1.0.6
v1.0.5
v1.0.4
v1.0.3-r1
v1.0.3
1.0.0
Labels
Clear labels
beta
breaking change
complexity: high
complexity: low
complexity: medium
needs milestone
netbox
pending closure
plugin candidate
pull-request
severity: high
severity: low
severity: medium
status: accepted
status: backlog
status: blocked
status: duplicate
status: needs owner
status: needs triage
status: revisions needed
status: under review
topic: GraphQL
topic: Internationalization
topic: OpenAPI
topic: UI/UX
topic: cabling
topic: event rules
topic: htmx navigation
topic: industrialization
topic: migrations
topic: plugins
topic: scripts
topic: templating
topic: testing
type: bug
type: deprecation
type: documentation
type: feature
type: housekeeping
type: translation
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/netbox#7810
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dmulyalin on GitHub (Mar 30, 2023).
NetBox version
v3.4.6
Feature type
New functionality
Proposed functionality
Add support to document Route-Target export and imports for VRF on a per-device basis by adding new VRF Export/Import model
Use case
Documetn route-leaking between different VRF by adding new table that will link RT, VRF and devices together allowing to document which devices in which VRF export and import which RT.
Route leaking using route-targets is a common approach in networking to implement routing between VRF which is known as hard to keep track of. Adding new capability to Netbox will greatly enhance its offering on VRF documentation side.
Current models does not allow to capture information about what devices in which VRF import and export what route-targets. Current capabilities only allow to capture information on what RT imported and exported for given VRF, while in real world this always tied to actual network devices.
Database changes
New model with this fields:
id
vrf - refers to existing VRF record
rt - refers to existing RT record
device - refers to existing device record
action - value of "import" or "export"
External dependencies
Nill
@DanSheps commented on GitHub (Mar 30, 2023):
You can already do this directly on VRF's. You can add additional import targets onto a VRF.
Now, granted this would be difficult to use to properly generate configurations per device as some devices may import that additional route-target and some may not. Perhaps it would make more sense to make the VRF model as a whole assigned per-device but that also introduces a number of difficulties.
@dmulyalin commented on GitHub (Mar 30, 2023):
Adding route targets to vrf is great, but it does not capture which device exports or imports those route targets. Adding new table to hold those dependencies is what i hope could be the simplest way of doing it.
@jeremystretch commented on GitHub (Mar 30, 2023):
VRFs are associated with devices via interface assignment. Each interface can be assigned to a VRF.
@DanSheps commented on GitHub (Mar 30, 2023):
Yeah, I think the issue is here, with the way it is modelled in Netbox vs real life.
Like, you could have 3 devices, device A, device B, device C. Lets say they are all ASR-1001-X's for simplicity.
On A you could have:
On B you could have:
On C you could have:
So like, on C you aren't importing 1:1 but on B you are. It isn't possible to model the state of the vrf itself on each device currently in NetBox and you would have to use config contexts or intuit it currently.
I think this FR is proposing to more or less move the Route Target assignments to a device M2M model. If I was doing this, I would do it this way:
Models:
It would make the model slightly more complex but it would allow proper configuration generation.
@dmulyalin commented on GitHub (Mar 30, 2023):
@DanSheps precisely yes, this is the use case I was trying to document in Netbox but apart from using config contexts or change vrf to per-device by encoding device name in vrf name, was not able to come up with any other workarounds.
@jeremystretch assigning interfaces to VRF is great and very representative of how real networks work. Current VRF and RT modeling approach, however, does not capture the relationship between RT and VRF on a per-device basis, which is how it is done in the networks. In fact, VRF name is having device local significance, and (as you of course aware) RT control the routing between VRFs on different devices.
I was hoping that addint new
vpn_import_exportmodel would be able to serve us to capture RT usage for VRFs on a per-device basis. At the end it would be good to end up with this table that user can interface with:Same
vpn_import_exportcan be used for L2VPN as well, or any other future entities that rely on route-targets for NLRI exchange. Moreover, having dedicatedvpn_import_exportmodel likely would allow to remove relationship between RT and VRF as it is not fully representative of how real networks implemented.@DetunizedGravity commented on GitHub (Jun 16, 2023):
I would go as far as to say that if one wants to truly describe the real world, vrf names need not be unique, since they are local to a device. The actual primary key for VRF should be (device id, name). Dunno if Netbox and its foundations allow that, though.
@github-actions[bot] commented on GitHub (Sep 15, 2023):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.
@davidgwatkins commented on GitHub (Sep 30, 2023):
Stumbled across this issue searching for per-device route distinguisher support. I really like
VRFDefinitionmodel idea! Would propose also moving the VRF RD into that model to allow unique RDs per PE (Type 1 RD per RFC 4364).Another argument for more granular RT control: CSPs often reuse one VRF globally with multiple regional routing domains and associated ASNs / RTs. When I modeled this in the past, I used a Custom Field on the VRF model with an assigned number field and varied the admin fields for both RD and RT using Region-based Config Contexts. The
VRFDefinitionmodel would eliminate the need for that workaround and ambiguity.@DanSheps commented on GitHub (Dec 5, 2023):
I came across this searching for something else. Let me model out the ERD in mermaid I would be willing to take this on in 4.0 or later.
@DanSheps commented on GitHub (Dec 6, 2023):
If we could get some commentns on this proposed model that would be great.
@dmulyalin commented on GitHub (Dec 6, 2023):
Am i reading right that vrfdefinition gonna be tied to device? If so, rd could be moved to vrfdefinition model as well, as rd always of device local significance e.g. ot uncommon rd could encode device loopback ip to be device specific.
@dmulyalin commented on GitHub (Dec 6, 2023):
Also think interface relationship with vrf need to be with vrfdefinition model if vrfdefinition represents an instance of the vrf. In that case the original vrf model does not needed? Could it be rebuild as say l3domain model, representing routing contingency across multiple vrfs?
@DanSheps commented on GitHub (Dec 11, 2023):
While the VRF definition is locally significant, the interface could either tie to VRF or the VRFDefinition. This could be something looked at for future iterations as well.
VRF is tied to other things within netbox beyond those modelled here. This is a simple snippet of the relevant relationships for this specific FR. So, no, we could not rebuild it.
L3 Domain would need to be a separate proposal and has already been investigated and didn't go anywhere.
@ajackson79 commented on GitHub (Sep 6, 2024):
Adding my voice to the list. We use a unique RD per device so routes are unique across the network. We would like to model that in Netbox. Having device specific RD and RTs would be ideal for flexibility.
@DanSheps commented on GitHub (Sep 9, 2024):
I think this might be a good candidate for 4.2
@ajackson79 commented on GitHub (Oct 2, 2024):
Yes I agree this could be a great candidate for 4.2 and the SP focus. We would then not have to use config contexts to rewrite RD and RT per devices.