Skip to content

SR-OS: Implement OSPFv3 in VRFs #2334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/module/vrf.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ These platforms support routing protocols in VRFs:
| Junos[^Junos] | ✅ | ✅ | ✅ |
| Mikrotik RouterOS 6 | ✅ [❗](caveats-routeros6) | ❌ | ✅ |
| Mikrotik RouterOS 7 | ✅ | ❌ | ✅ |
| SR Linux | ✅ | ❌ | ✅ |
| Nokia SR Linux | ✅ | ✅ | ✅ |
| Nokia SR OS | ✅ | ✅ | ✅ |
| VyOS | ✅ | ✅ | ✅ |

```{note}
Expand Down
6 changes: 6 additions & 0 deletions netsim/ansible/templates/bgp/sros.gnmi.macro.j2
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
name: [ ospf ]
action:
action-type: accept
- entry-id: 50
from:
protocol:
name: [ ospf3 ]
action:
action-type: accept
{% endif %}

{% for af in ['ipv4','ipv6'] if af in vrf_context.af and vrf_context.af[af] %}
Expand Down
13 changes: 5 additions & 8 deletions netsim/ansible/templates/ospf/sros.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
action-type: accept
{% endmacro %}

{% macro ospf_config(af,ospf,vrf_interfaces,include_system) %}
{% macro ospf_config(af,ospf,vrf_interfaces) %}
{% set pid = ospf.process|default(0) %}
{% set ospfv = 'ospf3' if af=='ipv6' else 'ospf' %}

Expand Down Expand Up @@ -51,8 +51,6 @@
{% endif %}
{% endif %}
{% endif %}
# mtu: 1500 # SRL defaults to 1500, now supporting global mtu settings
{# TODO: Add support for multi-area adjacencies and 'secondary' interface-type #}
{% if l.ospf.network_type|default("") in ["broadcast","non-broadcast","point-to-point","point-to-multipoint"] %}
interface-type: "{{ 'p2mp-nbma' if l.ospf.network_type=='point-to-multipoint' else l.ospf.network_type }}"
{% endif %}
Expand All @@ -61,16 +59,15 @@
{% endif %}
{% endmacro %}

{% set system_if = { 'ifname': "system", 'ospf': { 'passive': True, 'area': ospf.area }, af: True } %}
{% for l in vrf_interfaces+([system_if] if include_system else []) if 'ospf' in l and af in l %}
{{ ospf_interface(l)}}
{% for intf in vrf_interfaces if 'ospf' in intf and af in intf %}
{{ ospf_interface(intf) }}
{% endfor %}
{% endmacro %}

updates:
{% if ospf.af.ipv4|default(False) %}
{{ ospf_config('ipv4',ospf,interfaces,'ipv4' in loopback) }}
{{ ospf_config('ipv4',ospf,netlab_interfaces) }}
{% endif %}
{% if ospf.af.ipv6|default(False) %}
{{ ospf_config('ipv6',ospf,interfaces,'ipv6' in loopback) }}
{{ ospf_config('ipv6',ospf,netlab_interfaces) }}
{% endif %}
12 changes: 6 additions & 6 deletions netsim/ansible/templates/vrf/sros.j2
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ updates:
{% endif %}

{% if 'ospf' in vdata and 'af' in vdata %}
{{ ospf_export_policy(vdata.ospf,vname) }}
{% for af in ['ipv4','ipv6'] %}
{% if af in vdata.af and vdata.af[af] %}
{{ ospf_config(af,vdata.ospf,vdata.ospf.interfaces,False) }}
{% endif %}
{% endfor %}
{{ ospf_export_policy(vdata.ospf,vname) }}
{% for rtg_af in ['ipv4','ipv6'] %}
{% if vdata.ospf.af[rtg_af]|default(False) %}
{{ ospf_config(rtg_af,vdata.ospf,vdata.ospf.interfaces) }}
{% endif %}
{% endfor %}
{% endif %}

{% endfor %}