Skip to content

fix(sr): render SRGB (segment-routing global-block) under router isis on FRR#3652

Open
roc-ops wants to merge 1 commit into
ipspace:devfrom
roc-ops:fix/sr-srgb-isis-frr
Open

fix(sr): render SRGB (segment-routing global-block) under router isis on FRR#3652
roc-ops wants to merge 1 commit into
ipspace:devfrom
roc-ops:fix/sr-srgb-isis-frr

Conversation

@roc-ops

@roc-ops roc-ops commented Jul 17, 2026

Copy link
Copy Markdown

Problem

netsim/ansible/templates/sr/frr.j2 renders the SRGB (segment-routing global-block, derived from sr.srgb.start) only inside the {% if 'ospfv2' in sr.protocol %} block. Under IS-IS SR the SRGB is silently dropped — sr.srgb.start is a no-op for isisd, 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 isis section. FRR isisd accepts segment-routing global-block <lower> <upper> with the same syntax as ospfd.

 {% 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: 16000 to tests/integration/sr/01-isis-ipv4-p.yml so the IS-IS SRGB rendering path is exercised.

Verification

Offline Jinja render of the template:

  • IS-IS case now emits segment-routing global-block 16000 23999 under router isis.
  • OSPF case unchanged (no regression).

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.
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 }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@ipspace

ipspace commented Jul 17, 2026

Copy link
Copy Markdown
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the router isis stanza in netsim/ansible/templates/sr/frr.j2.
  • Update the IS-IS SR integration topology to set sr.srgb.start to 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants