fix(sr): render SRGB (segment-routing global-block) under router isis on FRR#3652
Open
roc-ops wants to merge 1 commit into
Open
fix(sr): render SRGB (segment-routing global-block) under router isis on FRR#3652roc-ops wants to merge 1 commit into
roc-ops wants to merge 1 commit into
Conversation
The FRR SR template rendered the SRGB (segment-routing global-block from sr.srgb.start) only under the ospfv2 branch. Under IS-IS SR the SRGB was silently dropped, so sr.srgb.start was a no-op for isisd. Mirror the same guarded block into the router isis section (FRR isisd accepts segment-routing global-block with identical syntax). Exercised by adding sr.srgb.start to the isis P-router integration test.
jbemmel
reviewed
Jul 17, 2026
| router isis {{ isis.instance }} | ||
| segment-routing on | ||
| {% if sr.srgb.start is defined %} | ||
| segment-routing global-block {{ sr.srgb.start }} {{ sr.srgb.start + sr.srgb.size|default(8000) - 1 }} |
Collaborator
There was a problem hiding this comment.
Not directly related to this PR, but I think it would be nice to have the sr module calculate the end label, instead of each template
Owner
|
Thanks a million. I will try to add an SRGB check to the integration test (to check that we're really configuring it) and then merge your PR. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes FRR SR-MPLS configuration generation by ensuring the SRGB (segment-routing global-block) is rendered under router isis (not just under OSPF), so sr.srgb.start is honored for IS-IS SR labs.
Changes:
- Add SRGB rendering guard (
sr.srgb.start is defined) to therouter isisstanza innetsim/ansible/templates/sr/frr.j2. - Update the IS-IS SR integration topology to set
sr.srgb.startto exercise the IS-IS SRGB rendering path.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
netsim/ansible/templates/sr/frr.j2 |
Renders segment-routing global-block <lower> <upper> under router isis when SRGB is configured. |
tests/integration/sr/01-isis-ipv4-p.yml |
Adds a custom sr.srgb.start value intended to exercise the IS-IS SRGB rendering path. |
|
|
||
| bgp.advertise_loopback: false | ||
| isis.instance: Mordor | ||
| sr.srgb.start: 16000 # exercise SRGB rendering under router isis (FRR) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
netsim/ansible/templates/sr/frr.j2renders the SRGB (segment-routing global-block, derived fromsr.srgb.start) only inside the{% if 'ospfv2' in sr.protocol %}block. Under IS-IS SR the SRGB is silently dropped —sr.srgb.startis a no-op forisisd, so a lab that sets a custom SRGB gets FRR default global block instead of the requested one.Fix
Mirror the existing guarded block into the
router isissection. FRRisisdacceptssegment-routing global-block <lower> <upper>with the same syntax asospfd.{% if 'isis' in sr.protocol %} router isis {{ isis.instance }} segment-routing on +{% if sr.srgb.start is defined %} + segment-routing global-block {{ sr.srgb.start }} {{ sr.srgb.start + sr.srgb.size|default(8000) - 1 }} +{% endif %} {% if isis.router_id is defined %}Test
Added
sr.srgb.start: 16000totests/integration/sr/01-isis-ipv4-p.ymlso the IS-IS SRGB rendering path is exercised.Verification
Offline Jinja render of the template:
segment-routing global-block 16000 23999underrouter isis.