Skip to content

Commit

Permalink
Merge pull request #99 from citronalco/gateways_batman-fixed-mac
Browse files Browse the repository at this point in the history
gateways_batman: Feste MAC-Adressen für die Batman-Interfaces vergeben
  • Loading branch information
MPW1412 authored Nov 15, 2019
2 parents 84859c8 + 8999338 commit f77a434
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gateways_batman/templates/batman.j2
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# {{ ansible_managed }}

# Batman Interface
# - Erstellt das virtuelle Interface fuer das Batman-Modul und bindet dieses, falls L2TP benutzt wird, an die Netzwerkbruecke
# - Erstellt das virtuelle Interface fuer das Batman-Modul und bindet dieses, falls L2TP oder Fastd benutzt wird, an die Netzwerkbruecke
# - Die unten angelegte Routing-Tabelle wird spaeter fuer das Routing innerhalb von Freifunk (Router/VPN) verwendet

{% for item in domaenenliste|dictsort %}
auto bat{{item[0]}}
iface bat{{item[0]}} inet static
address {{domaenen[item[0]].ffv4_network | ipaddr(item[1].server_id) | ipaddr('address') }}
netmask {{domaenen[item[0]].ffv4_network | ipaddr('netmask')}}
{% if item[0] | length > 2 %}
hwaddress f2:be:ef:{{item[0][0:2]}}:{{item[0][2:]}}:{{item[1].server_id}}
{% else %}
hwaddress f2:be:ef:00:{{item[0]}}:{{item[1].server_id}}
{% endif %}
pre-up modprobe batman-adv
pre-up ip link add bat{{item[0]}} type batadv
post-up ip link set dev bat{{item[0]}} up
Expand Down

0 comments on commit f77a434

Please sign in to comment.