44 lines
1.1 KiB
Django/Jinja
44 lines
1.1 KiB
Django/Jinja
{% set ip4hex = item.0.ipv4_network | ipaddr('net') | ipaddr(magic) | ipaddr('address') | ip4_hex() -%}
|
|
{% set mac = '022' + item.1.id|string + ip4hex -%}
|
|
#
|
|
# {{ ansible_managed }}
|
|
#
|
|
log level warn;
|
|
hide ip addresses yes;
|
|
hide mac addresses yes;
|
|
|
|
method "salsa2012+umac";
|
|
|
|
interface "{{ item.0.id }}vpn-{{ item.1.mtu }}";
|
|
|
|
bind {{ ansible_default_ipv4.address | ipaddr('public') }}:10{{ item.1.id }}{{ item.0.site_number }};
|
|
bind {{ ansible_default_ipv6.address | ipaddr('public') | ipwrap }}:10{{ item.1.id }}{{ item.0.site_number }};
|
|
|
|
include "secret.conf";
|
|
mtu {{ item.1.mtu }};
|
|
|
|
peer group "vpn_nodes" {
|
|
include "peer_limit.conf";
|
|
include peers from "peers";
|
|
{% if item.0.id == "mz" %}
|
|
include peers from "peers_bingen";
|
|
{% endif %}
|
|
}
|
|
|
|
peer group "servers" {
|
|
include peers from "peers/servers";
|
|
}
|
|
|
|
on up "
|
|
ip link set $INTERFACE down
|
|
ip link set address {{ mac | hwaddr('linux') }} dev $INTERFACE
|
|
ip link set $INTERFACE up
|
|
|
|
batctl -m {{ item.0.id }}bat if add $INTERFACE
|
|
";
|
|
|
|
on down "
|
|
batctl -m {{ item.0.id }}bat if del $INTERFACE
|
|
";
|
|
|
|
status socket "/var/run/fastd-{{ item.0.id }}vpn-{{ item.1.mtu }}.status";
|