Skip to content

Commit

Permalink
CL NVUE: Fix IPv6 LLA-only configuration (#1591)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbemmel authored Dec 1, 2024
1 parent bf20122 commit f3d711f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
16 changes: 10 additions & 6 deletions netsim/ansible/templates/bgp/cumulus_nvue.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@
{% endif %}
{{ af }}-unicast:
enable: on
network:
{% if loopback[af] is defined and bgp.advertise_loopback %}
{{ loopback[af]|ipaddr(0) }}: {}
{% endif %}
{% set _loopback = [ loopback[af] ] if loopback[af] is defined and bgp.advertise_loopback else [] %}
{% set data = namespace(networks=_loopback) %}
{% for l in interfaces|default([]) if l.bgp.advertise|default("") and l[af] is defined and not 'vrf' in l %}
{{ l[af]|ipaddr(0) }}: {}
{% set data.networks = data.networks + [ l[af] ] %}
{% endfor %}
{% for pfx in bgp.originate|default([]) if af == 'ipv4' %}
{{ pfx|ipaddr('0') }}: {}
{% set data.networks = data.networks + [ pfx ] %}
{% endfor %}
{% if data.networks!=[] %}
network:
{% for pfx in data.networks %}
{{ pfx|ipaddr('0') }}: {}
{% endfor %}
{% endif %}
{% endfor %}
autonomous-system: {{ bgp.as }}
neighbor:
Expand Down
4 changes: 3 additions & 1 deletion netsim/ansible/templates/initial/cumulus_nvue.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
{% if i.vrf is defined %}
vrf: {{ i.vrf }}
{% endif %}
{% if i.ipv4 is defined or i.ipv6|default(None) is string %}
address:
{% endif %}
{% if i.ipv4 is defined %}
{% if i.ipv4 == True %}
{{ loopback.ipv4 }}: {}
Expand All @@ -28,6 +30,7 @@
{% if i.ipv6 is defined %}
{% if i.ipv6 is string and i.ipv6|ipv6 %}
{{ i.ipv6 }}: {}
{% endif %}
ipv6:
forward: on
{% if 'ipv6' not in i.dhcp.client|default({}) %}
Expand All @@ -37,7 +40,6 @@
enable: on
interval: 5000
{% endif %}
{% endif %}
{% else %}
ipv6:
enable: off
Expand Down

0 comments on commit f3d711f

Please sign in to comment.