From d82f8524972086862f64750f325ba067ea993d86 Mon Sep 17 00:00:00 2001 From: Niklas Yann Wettengel Date: Mon, 3 Jul 2017 09:46:42 +0200 Subject: fastd working --- roles/setup_batman/files/ffmyk-iproute.sh | 20 -------------------- roles/setup_batman/tasks/main.yml | 18 ++++-------------- roles/setup_batman/templates/netctl_bat.j2 | 8 ++++++++ roles/setup_batman/templates/netctl_bat0.j2 | 7 ------- 4 files changed, 12 insertions(+), 41 deletions(-) delete mode 100755 roles/setup_batman/files/ffmyk-iproute.sh create mode 100644 roles/setup_batman/templates/netctl_bat.j2 delete mode 100644 roles/setup_batman/templates/netctl_bat0.j2 (limited to 'roles/setup_batman') diff --git a/roles/setup_batman/files/ffmyk-iproute.sh b/roles/setup_batman/files/ffmyk-iproute.sh deleted file mode 100755 index 49fbb16..0000000 --- a/roles/setup_batman/files/ffmyk-iproute.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -#Routingtabelle ffmyk ist per default nicht erreichbar -ip route add unreachable default table ffmyk - -#Alles, was mit 0x1 markiert wird gehört zu Tabelle ffmyk -ip rule add from all fwmark 0x1 table ffmyk - -#Alles mit Freifunk-IP - woher auch immer - gehlrt zu Tabelle ffmyk -ip rule add from 10.222.0.0/16 table ffmyk - -#Tabelle ffmyk routet das Ziel mit Freifunk-IPs über das Device bat0 -ip route replace 10.222.0.0/16 dev bat0 table ffmyk - -ip route replace 0.0.0.0/1 via 10.222.100.1 dev bat0 metric 666 table ffmyk # fastd1 -ip route replace 128.0.0.0/1 via 10.222.100.1 dev bat0 metric 666 table ffmyk # fastd1 -ip route replace 0.0.0.0/1 via 10.222.112.1 dev bat0 metric 667 table ffmyk # fastd2 -ip route replace 128.0.0.0/1 via 10.222.112.1 dev bat0 metric 667 table ffmyk # fastd2 -ip route replace 0.0.0.0/1 via 10.222.120.1 dev bat0 metric 668 table ffmyk # fastd3 -ip route replace 128.0.0.0/1 via 10.222.120.1 dev bat0 metric 668 table ffmyk # fastd3 - diff --git a/roles/setup_batman/tasks/main.yml b/roles/setup_batman/tasks/main.yml index b8f49da..dd03ed1 100644 --- a/roles/setup_batman/tasks/main.yml +++ b/roles/setup_batman/tasks/main.yml @@ -14,18 +14,8 @@ name: batctl state: present -- name: name ffmyk routing table - lineinfile: - path: /etc/iproute2/rt_tables - line: 42 ffmyk - -- name: copy ffmyk iproute config script - copy: - src: ffmyk-iproute.sh - dest: /usr/local/bin/ffmyk-iproute.sh - mode: 0744 - -- name: add netctl config +- name: add batman netctl config for sites template: - src: netctl_bat0.j2 - dest: /etc/netctl/bat0 + src: netctl_bat.j2 + dest: "/etc/netctl/bat{{ item.name }}" + with_items: "{{ sites }}" diff --git a/roles/setup_batman/templates/netctl_bat.j2 b/roles/setup_batman/templates/netctl_bat.j2 new file mode 100644 index 0000000..01ebb6d --- /dev/null +++ b/roles/setup_batman/templates/netctl_bat.j2 @@ -0,0 +1,8 @@ +Connection=ethernet +Interface=bat{{ item.name }} +IP=static +IP6=static +Address6=({{ item.bat_ipv6 }}/64) +Address=({{ item.bat_ipv4 }}/20) +ExecUpPost=/usr/local/bin/ffmyk-iproute{{ item.name }}-up.sh +ExecDownPre=/usr/local/bin/ffmyk-iproute{{ item.name }}-down.sh diff --git a/roles/setup_batman/templates/netctl_bat0.j2 b/roles/setup_batman/templates/netctl_bat0.j2 deleted file mode 100644 index e48c5b8..0000000 --- a/roles/setup_batman/templates/netctl_bat0.j2 +++ /dev/null @@ -1,7 +0,0 @@ -Connection=ethernet -Interface=bat0 -IP=static -IP6=static -Address6=({{ bat0_ipv6 }}/64) -Address=({{ bat0_ipv4 }}/16) -ExecUpPost=/usr/local/bin/ffmyk-iproute.sh -- cgit v1.2.3-54-g00ecf