From 9f15b5160c489c18bc9a4840727d3ef957526ed1 Mon Sep 17 00:00:00 2001 From: Jeroen van Bemmel Date: Mon, 5 Sep 2022 08:31:31 -0500 Subject: [PATCH] Add srlinux rfc8950 support --- netsim/ansible/templates/bgp/srlinux.macro.j2 | 4 ++-- netsim/ansible/templates/initial/srlinux.j2 | 2 +- netsim/topology-defaults.yml | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/netsim/ansible/templates/bgp/srlinux.macro.j2 b/netsim/ansible/templates/bgp/srlinux.macro.j2 index 265e18a20..2be330185 100644 --- a/netsim/ansible/templates/bgp/srlinux.macro.j2 +++ b/netsim/ansible/templates/bgp/srlinux.macro.j2 @@ -150,16 +150,16 @@ - as-number: {{ n.local_as }} prepend-global-as: {{ not n.replace_global_as|default(True) }} # Don't include iBGP AS in eBGP advertisements {% endif %} -{% if ('ipv4' in n.activate|default([]) and n.activate[ 'ipv4' ]) or ('ipv6' in n.activate|default([]) and not n.activate[ 'ipv6' ]) %} +{% if n.ipv4_rfc8950|default(False) %} ipv4-unicast: advertise-ipv6-next-hops: true receive-ipv6-next-hops: true -{% endif %} - path: network-instance[name={{vrf}}]/ip-forwarding val: receive-ipv4-check: false _annotate_receive-ipv4-check: "Allow IPv4 on IPv6 unnumbered interfaces" +{% endif %} {% for i in interfaces|default([]) if i.ifindex == n.ifindex %} {% set if_name_index = i.ifname.split('.') %} diff --git a/netsim/ansible/templates/initial/srlinux.j2 b/netsim/ansible/templates/initial/srlinux.j2 index 3b08d04a2..50f6c3aec 100644 --- a/netsim/ansible/templates/initial/srlinux.j2 +++ b/netsim/ansible/templates/initial/srlinux.j2 @@ -1,5 +1,5 @@ {% macro ip_addresses(intf,ipv6_ra,is_system) %} -{% if 'ipv4' in intf %} +{% if 'ipv4' in intf and intf.ipv4 is string %} ipv4: address: - ip-prefix: "{{ intf.ipv4 }}" diff --git a/netsim/topology-defaults.yml b/netsim/topology-defaults.yml index 8edbb0b78..9250645bf 100644 --- a/netsim/topology-defaults.yml +++ b/netsim/topology-defaults.yml @@ -696,7 +696,7 @@ devices: initial: system_mtu: True ipv4: - unnumbered: False + unnumbered: True ipv6: lla: True vlan: @@ -709,6 +709,8 @@ devices: vrf_local_as: True local_as_ibgp: True activate_af: True + ipv6_lla: True + rfc8950: True vxlan: requires: [ evpn, vrf ] ospf: