Skip to content

Commit 6b6f3e5

Browse files
authored
SR-OS: Implement OSPFv3 in VRFs (#2334)
1 parent c7c60b1 commit 6b6f3e5

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

docs/module/vrf.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ These platforms support routing protocols in VRFs:
5252
| Junos[^Junos] ||||
5353
| Mikrotik RouterOS 6 |[](caveats-routeros6) |||
5454
| Mikrotik RouterOS 7 ||||
55-
| SR Linux ||||
55+
| Nokia SR Linux ||||
56+
| Nokia SR OS ||||
5657
| VyOS ||||
5758

5859
```{note}

netsim/ansible/templates/bgp/sros.gnmi.macro.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@
4242
name: [ ospf ]
4343
action:
4444
action-type: accept
45+
- entry-id: 50
46+
from:
47+
protocol:
48+
name: [ ospf3 ]
49+
action:
50+
action-type: accept
4551
{% endif %}
4652

4753
{% for af in ['ipv4','ipv6'] if af in vrf_context.af and vrf_context.af[af] %}

netsim/ansible/templates/ospf/sros.j2

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
action-type: accept
2121
{% endmacro %}
2222

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

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

64-
{% set system_if = { 'ifname': "system", 'ospf': { 'passive': True, 'area': ospf.area }, af: True } %}
65-
{% for l in vrf_interfaces+([system_if] if include_system else []) if 'ospf' in l and af in l %}
66-
{{ ospf_interface(l)}}
62+
{% for intf in vrf_interfaces if 'ospf' in intf and af in intf %}
63+
{{ ospf_interface(intf) }}
6764
{% endfor %}
6865
{% endmacro %}
6966

7067
updates:
7168
{% if ospf.af.ipv4|default(False) %}
72-
{{ ospf_config('ipv4',ospf,interfaces,'ipv4' in loopback) }}
69+
{{ ospf_config('ipv4',ospf,netlab_interfaces) }}
7370
{% endif %}
7471
{% if ospf.af.ipv6|default(False) %}
75-
{{ ospf_config('ipv6',ospf,interfaces,'ipv6' in loopback) }}
72+
{{ ospf_config('ipv6',ospf,netlab_interfaces) }}
7673
{% endif %}

netsim/ansible/templates/vrf/sros.j2

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ updates:
3131
{% endif %}
3232

3333
{% if 'ospf' in vdata and 'af' in vdata %}
34-
{{ ospf_export_policy(vdata.ospf,vname) }}
35-
{% for af in ['ipv4','ipv6'] %}
36-
{% if af in vdata.af and vdata.af[af] %}
37-
{{ ospf_config(af,vdata.ospf,vdata.ospf.interfaces,False) }}
38-
{% endif %}
39-
{% endfor %}
34+
{{ ospf_export_policy(vdata.ospf,vname) }}
35+
{% for rtg_af in ['ipv4','ipv6'] %}
36+
{% if vdata.ospf.af[rtg_af]|default(False) %}
37+
{{ ospf_config(rtg_af,vdata.ospf,vdata.ospf.interfaces) }}
38+
{% endif %}
39+
{% endfor %}
4040
{% endif %}
4141

4242
{% endfor %}

0 commit comments

Comments
 (0)