[node] implement everything...

This commit is contained in:
lare 2022-12-21 21:21:57 +01:00
parent 1fda3c11a4
commit 99809e1139
9 changed files with 527 additions and 12 deletions

View file

@ -0,0 +1,36 @@
{% if peering["bgp_mp"] %}
protocol bgp dn42_{{peering["MNT"][:-4].lower()}} from dnpeers {
neighbor {{peering["ipv6ll"]}} as {{peering["ASN"]}};
interface "dn42_{{peering['MNT'][:-4].lower()}}";
passive off;
ipv4 {
{# TODO: implement pinging peer for bgp-communities
#import where dn42_import_filter(x,y,z);
#export where dn42_export_filter(x,y,z);
#}
extended next hop {% if peering["bgp_enh"] %}on{%else%}off{%endif%};
};
ipv6 {
{# TODO: implement pinging peer for bgp-communities
#import where dn42_import_filter(x,y,z);
#export where dn42_export_filter(x,y,z);
#}
extended next hop {% if peering["bgp_enh"] %}on{%else%}off{%endif%};
};
};
{%else%}
protocol bgp dn42_{{peering["MNT"][:-4].lower()}}_4 from dnpeers {
neighbor {{peering["ipv4"]}} as {{peering["ASN"]}};
passive off;
#import where dn42_import_filter(x,y,z);
#export where dn42_export_filter(x,y,z);
};
protocol bgp dn42_{{peering["MNT"][:-4].lower()}}_6 from dnpeers {
neighbor {{peering["ipv6"]}} as {{peering["ASN"]}};
passive off;
#import where dn42_import_filter(x,y,z);
#export where dn42_export_filter(x,y,z);
}
{%endif%}

View file

@ -0,0 +1,13 @@
[Interface]
PostUp = wg set %i private-key /etc/wireguard/dn42.priv
ListenPort = 2{{peering["ASN"][-4:]}}
{% if peering["ipv4"] %}PostUp = /sbin/ip addr add dev %i 172.22.125.130/32 peer {{peering["ipv4"]}}/32
{%endif%}{% if peering["ipv6"] %}PostUp = /sbin/ip addr add dev %i fe63:5d40:47e5::130/128 peer {{peering["ipv6"]}}/128
{%endif%}{% if peering["ipv6ll"] %}PostUp = /sbin/ip addr add dev %i fe80::3035:130/128 peer {{peering["ipv6ll"]}}/128{%endif%}
Table = off
# {{peering["MNT"]}}
[Peer]
PublicKey = {{peering["wg_key"]}}
{% if peering["endpoint"] %}Endpoint = {{peering["endpoint"]}}{%endif%}
AllowedIPs = {% if peering["ipv6ll"] %}{{peering["ipv6ll"]}}/128, {%endif%}fd00::/8, 172.20.0.0/14, 10.0.0.0/8