dn42-ansible/ext-peer.network.j2

35 lines
1,015 B
Django/Jinja

[Match]
Name={% if item.ifacename is defined %}{{ item.ifacename }}{% else %}dn42{{ item['remotename'] }}{% endif %}
[Network]
DHCP=false
IPv6AcceptRA=false
IPv4Forwarding=true
IPv6Forwarding=true
KeepConfiguration=true
IPv4ReversePathFilter=no
Description=DN42 peering with AS{{ item.asn }}{% if item.wireguard|default(true) %} @ {% if item.remotehost is defined %}{{ item.remotehost }}[{{ item.remoteip }}]:{{ item.remoteport }}{% else %}[{{ item.remoteip }}]:{{ item.remoteport }}{% endif %} {% endif %}
LinkLocalAddressing=false
IPv4AcceptLocal=true
[Address]
{% if item['llv6'] is defined %}
Address={{ item['llv6'] }}/{% if item.remote_llv6 is defined %}128{% else %}64{% endif %}
{% else %}
Address={{ llv6 }}/{% if item.remote_llv6 is defined %}128{% else %}64{% endif %}
{% endif %}
{% if item.remote_llv6 is defined %}
Peer={{ item['remote_llv6'] }}/128
{% endif %}
[Address]
Address={{ unicastv4 }}/32
{% if item['remote_unicastv4'] is defined %}
Peer={{ item['remote_unicastv4'] }}
{% endif %}