From cb5129be3afe6e53e7ef87d6eb726896469688eb Mon Sep 17 00:00:00 2001 From: Marcus Weiner Date: Mon, 9 Sep 2024 02:18:48 +0200 Subject: [PATCH] Fix notation of tunnel outside addresses --- core-router.j2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core-router.j2 b/core-router.j2 index 9ba8f6d..8afa869 100644 --- a/core-router.j2 +++ b/core-router.j2 @@ -16,14 +16,14 @@ set interfaces tunnel {{ intf.name }} description "{{ intf.description }}" {%- endif %} {%- for addr in intf.ip_addresses.all() %} -set interfaces tunnel {{ intf.name }} address {{ addr }} +set interfaces tunnel {{ intf.name }} address {{ addr.address }} {%- endfor %} set interfaces tunnel {{ intf.name }} encapsulation {{ term.tunnel.encapsulation }} set interfaces tunnel {{ intf.name }} multicast disable -set interfaces tunnel {{ intf.name }} local-ip {{ term.outside_ip }} +set interfaces tunnel {{ intf.name }} local-ip {{ term.outside_ip.address | ipaddr('address') }} -{%- with nat_outside = ipam.IPAddress.objects.filter(nat_inside_id=remote.outside_ip.id).first() %} -set interfaces tunnel {{ intf.name }} remote-ip {% if nat_outside %}{{ nat_outside }}{% else %}{{ remote.outside_ip }}{% endif %} +{%- with remote_ip = ipam.IPAddress.objects.filter(nat_inside_id=remote.outside_ip.id).first() or remote.outside_ip %} +set interfaces tunnel {{ intf.name }} remote-ip {{ remote_ip.address | ipaddr('address') }} {%- endwith %} {%- endif %}