2017-10-07 00:57:35 +02:00
|
|
|
{% set ip4hex = item.0.ipv4_network | ipaddr('net') | ipaddr(magic) | ipaddr('address') | ip4_hex() -%}
|
2017-10-25 19:50:06 +02:00
|
|
|
{% set mac = '022' + item.1.id|string + ip4hex -%}
|
2017-09-05 12:01:27 +02:00
|
|
|
#
|
|
|
|
# {{ ansible_managed }}
|
|
|
|
#
|
|
|
|
log level warn;
|
|
|
|
hide ip addresses yes;
|
|
|
|
hide mac addresses yes;
|
|
|
|
|
|
|
|
method "salsa2012+umac";
|
|
|
|
|
2017-11-06 21:24:56 +01:00
|
|
|
interface "{{ item.0.id }}vpn-{{ item.1.mtu }}";
|
2017-09-05 12:01:27 +02:00
|
|
|
|
2017-10-07 00:57:35 +02:00
|
|
|
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 }};
|
2017-09-05 12:01:27 +02:00
|
|
|
|
|
|
|
include "secret.conf";
|
2017-10-07 00:57:35 +02:00
|
|
|
mtu {{ item.1.mtu }};
|
2017-09-05 12:01:27 +02:00
|
|
|
|
|
|
|
peer group "vpn_nodes" {
|
2017-10-06 10:33:38 +02:00
|
|
|
include "peer_limit.conf";
|
2017-09-05 12:01:27 +02:00
|
|
|
include peers from "peers";
|
2017-10-07 00:57:35 +02:00
|
|
|
{% if item.0.id == "mz" %}
|
2017-09-05 12:01:27 +02:00
|
|
|
include peers from "peers_bingen";
|
|
|
|
{% endif %}
|
|
|
|
}
|
|
|
|
|
|
|
|
peer group "servers" {
|
|
|
|
include peers from "peers/servers";
|
|
|
|
}
|
|
|
|
|
2017-10-03 14:37:39 +02:00
|
|
|
on up "
|
|
|
|
ip link set $INTERFACE down
|
2017-10-03 15:13:00 +02:00
|
|
|
ip link set address {{ mac | hwaddr('linux') }} dev $INTERFACE
|
2017-10-03 14:37:39 +02:00
|
|
|
ip link set $INTERFACE up
|
|
|
|
|
2017-11-06 21:24:56 +01:00
|
|
|
batctl -m {{ item.0.id }}bat if add $INTERFACE
|
2017-10-03 14:37:39 +02:00
|
|
|
";
|
|
|
|
|
|
|
|
on down "
|
2017-11-06 21:24:56 +01:00
|
|
|
batctl -m {{ item.0.id }}bat if del $INTERFACE
|
2017-10-03 14:37:39 +02:00
|
|
|
";
|
|
|
|
|
2017-11-06 21:24:56 +01:00
|
|
|
status socket "/var/run/fastd-{{ item.0.id }}vpn-{{ item.1.mtu }}.status";
|