dn42-ansible/ext-peer.netdev.j2

22 lines
739 B
Text
Raw Normal View History

[NetDev]
Name=dn42{{ item['remotename'] }}
Kind=wireguard
2024-12-25 09:43:27 +00:00
Description=DN42 peering with AS{{ item.asn }} @ {% if item.remotehost is defined %}{{ item.remotehost }}[{{ item.remoteip }}]:{{ item.remoteport }}{% else %}[{{ item.remoteip }}]:{{ item.remoteport }}{% endif %}
[WireGuard]
PrivateKeyFile=/etc/systemd/network/wg.key
{% if item['localport'] is defined %}
ListenPort={{ item['localport'] }}
{% endif %}
[WireGuardPeer]
{% if item['remotehost'] is defined %}
# {{ item['remotehost'] }}
{% endif %}
{% if item['remoteip'] is defined %}
Endpoint={{ item['remoteip'] }}:{{ item['remoteport'] }}
{% endif %}
PublicKey={{ item['publickey'] }}
PersistentKeepalive=15
AllowedIPs=fe80::/64 fd00::/8 172.20.0.0/14 172.31.0.0/16 10.0.0.0/8