diff options
author | Yuxiang Zhu <vfreex@gmail.com> | 2023-01-12 14:23:03 +0000 |
---|---|---|
committer | Yuxiang Zhu <vfreex@gmail.com> | 2023-01-12 15:21:48 +0000 |
commit | 20f448d16c31088ccdcd76d11d11de5f1ac96ce0 (patch) | |
tree | 367c25f4fc3d842f14dcdf935810632cbcc2644c /data/templates/frr/ospfd.frr.j2 | |
parent | 68a036238522a210dc5c12fabd4ca833ab43d4bf (diff) | |
download | vyos-1x-20f448d16c31088ccdcd76d11d11de5f1ac96ce0.tar.gz vyos-1x-20f448d16c31088ccdcd76d11d11de5f1ac96ce0.zip |
T4934: ospf: Fix inter-area route summarization
Setting something like `protocols ospf area 10 range 10.10.0.0/16` without sub options doesn't work. This is because no range commands are generated when there is no leaf nodes set under the `range` tag node.
```
edit protocols ospf
set area 16 network 10.10.0.0/16
set area 16 range 10.10.0.0/16
commit
```
```
$ vtysh -c 'show run'
!
router ospf
auto-cost reference-bandwidth 100
timers throttle spf 200 1000 10000
network 10.10.0.0/16 area 16
exit
```
The generated FRR commands above is missing something like:
```
area 16 range 10.10.0.0/16
```
Diffstat (limited to 'data/templates/frr/ospfd.frr.j2')
-rw-r--r-- | data/templates/frr/ospfd.frr.j2 | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/data/templates/frr/ospfd.frr.j2 b/data/templates/frr/ospfd.frr.j2 index 0baff2d72..8c4a81c57 100644 --- a/data/templates/frr/ospfd.frr.j2 +++ b/data/templates/frr/ospfd.frr.j2 @@ -84,11 +84,13 @@ router ospf {{ 'vrf ' ~ vrf if vrf is vyos_defined }} {% endfor %} {% if area_config.range is vyos_defined %} {% for range, range_config in area_config.range.items() %} -{% if range_config.cost is vyos_defined %} - area {{ area_id }} range {{ range }} cost {{ range_config.cost }} -{% endif %} {% if range_config.not_advertise is vyos_defined %} area {{ area_id }} range {{ range }} not-advertise +{% else %} + area {{ area_id }} range {{ range }} +{% endif %} +{% if range_config.cost is vyos_defined %} + area {{ area_id }} range {{ range }} cost {{ range_config.cost }} {% endif %} {% if range_config.substitute is vyos_defined %} area {{ area_id }} range {{ range }} substitute {{ range_config.substitute }} |