Skip to content

Commit

Permalink
Fix notation of tunnel outside addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
mraerino committed Sep 9, 2024
1 parent d771818 commit cb5129b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core-router.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down

0 comments on commit cb5129b

Please sign in to comment.