Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
centos:ansible:ffmuc-rpb4-ol [31.08.2020 11:28. ] – django | centos:ansible:ffmuc-rpb4-ol [14.09.2022 14:49. ] (aktuell) – gelöscht django | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ====== Bau eines Freifunk-Offloaders auf Basis eines Raspberry 4B ====== | ||
- | {{: | ||
- | Bei größeren Installationen, | ||
- | \\ | ||
- | In diesem Konfigurationsbeispiel wollen wir möglichst einfach und schnell einen Offloader für **[[https:// | ||
- | |||
- | <WRAP center round tip 90%> | ||
- | Als Basis für die Konfiguration setzen wir beim sehr gut dokumentierten Artikel von **// | ||
- | </ | ||
- | |||
- | ====== Inhalt ====== | ||
- | <WRAP center round tip 90%> | ||
- | Das Kapitel hier ist in folgende Abschnitte strukturiert. | ||
- | <WRAP center round important 100%> | ||
- | Wer also z.B. bereits einen SSH-Schlüssel sein eigen nennt oder Grundlagen zu Ansible bereits kennt und installiert hat, kann natürlich sofort beim Playbook bzw. dessen Ausführung einsteigen und die nachfolgenden Informationen überspringen. | ||
- | </ | ||
- | </ | ||
- | |||
- | * **[[# | ||
- | * **[[# | ||
- | * **[[# | ||
- | * **[[# | ||
- | * **[[# | ||
- | |||
- | Folgende Abschnitte beschreiben den eigentlichen Bau des Freifunk-Offloaders mit Ansible-Unterstützung und ist somit der ideale Einsprungpunkt für den versierten LINUX-Admin mit entsprechenden Ansible-Kenntnissen.: | ||
- | * **[[# | ||
- | * **[[# | ||
- | * **[[# | ||
- | * **[[# | ||
- | * **[[# | ||
- | |||
- | ==== Grundlagen zu SSH ==== | ||
- | Grundlegende Informationen rund um die **[[https:// | ||
- | |||
- | ==== Erstellen eines SSH-Schlüsselpaares ==== | ||
- | Damit wir selbst für spätere Administrationsaufgaben und auch unser Ansible-Admin-Host Verbindungen mit Hilfe der **SSH**((**S**ecure** SH**ell)) zu unserem Offloader aufbauen kann, benötigen wir natürlich entsprechendes Schlüsselmaterial, | ||
- | |||
- | Bei der Erstellung wollen wir statt eines**[[https:// | ||
- | |||
- | Wir erstellen uns nun einen **ED25519**-Schlüssel (**'' | ||
- | $ ssh-keygen -t ed25519 -a 100 -C 'FFMUC Remote-User' | ||
- | |||
- | < | ||
- | Enter passphrase (empty for no passphrase): | ||
- | Enter same passphrase again: | ||
- | Your identification has been saved in ~/ | ||
- | Your public key has been saved in ~/ | ||
- | The key fingerprint is: | ||
- | SHA256: | ||
- | The key's randomart image is: | ||
- | +--[ED25519 256]--+ | ||
- | | | ||
- | | .E+ +.+. | | ||
- | | ++.. = * | | ||
- | | +..+ + O . | | ||
- | | | ||
- | | ... E * . | | ||
- | | .oo o + + .| | ||
- | | .... . =E | | ||
- | | .. + ooo | | ||
- | +----[SHA256]-----</ | ||
- | |||
- | ==== Grundlagen zu Ansible ==== | ||
- | {{: | ||
- | Grundlegende Informationen zu **[[https:// | ||
- | |||
- | ==== Installation von Ansible ==== | ||
- | Je nach verwendeter Systemumgebung installieren wir nun das vom Paketmaintainer zur Verfügung gestellte | ||
- | * RPM basierende Systeme: < | ||
- | * DEB basierende Systeme: < | ||
- | |||
- | ==== Einrichten der eigenen Ansible-Umgebung ==== | ||
- | === Verzeichnis-Struktur === | ||
- | Für unseren Admininstrationsuser legen wir uns zu erst einmal die passende Orderstruktur im Homeverzeichnis an. | ||
- | $ mkdir -p ~/ | ||
- | |||
- | Hieraus ergibt sich folgende Struktur: | ||
- | < | ||
- | ├── inventory | ||
- | └── playbooks | ||
- | └── templates | ||
- | └── Raspbian</ | ||
- | |||
- | === Ansible-Konfigurationsdatei === | ||
- | Als nächstes kopieren wir uns die Vorlage-Konfiguratinsdatei aus dem Verzeichnis **''/ | ||
- | $ cp / | ||
- | |||
- | Unter dem Konfigurationsgruppe **[ defaults ]** setzen wir den Parameter **'' | ||
- | $ vim ~/ | ||
- | |||
- | Im Ganzen ergibt sich dann hier die doch überschaubare Konfigurationsdatei zu Ansible. | ||
- | $ egrep -v ' | ||
- | < | ||
- | inventory | ||
- | interpreter_python = auto_silent | ||
- | [inventory] | ||
- | [privilege_escalation] | ||
- | [paramiko_connection] | ||
- | [ssh_connection] | ||
- | [persistent_connection] | ||
- | connect_timeout = 30 | ||
- | [accelerate] | ||
- | [selinux] | ||
- | [colors] | ||
- | [diff] | ||
- | </ | ||
- | |||
- | === Host-Definitionsdatei === | ||
- | Ähnlich wie bereits auch schon die Konfigurationsdatei zu Ansible wird auch die Datei zur Hostdefinition sehr überschaubar bleiben. | ||
- | Auch hier kopieren wir uns die Vorlagedatei in unser Homeverzeichnis an Ort und Stelle. | ||
- | $ cp / | ||
- | |||
- | Dort tragen wir den Namen ein, wie wir unseren Host später im Playbook ansprechen wollen. In diesem Konfigurationsbeispiel nutzen wir hier den Namen **'' | ||
- | $ vim ~/ | ||
- | |||
- | Somit ergibt sich auch hier eine sehr üersichtliche Konfigurationsdatei. | ||
- | $ egrep -v ' | ||
- | |||
- | raspberry-ansible | ||
- | |||
- | === SSH Konfigurationsdatei === | ||
- | Damit wir unseren Raspberry auch direkt über den zuvor definierten Namen ansprechen können, definieren wir nun noch in unserer **SSH**-Konfigurationsdatei **'' | ||
- | $ vim ~/ | ||
- | |||
- | < | ||
- | | ||
- | Port 22 | ||
- | User pi | ||
- | | ||
- | | ||
- | | ||
- | |||
- | Beim Parameter **'' | ||
- | |||
- | ==== Kopieren des Ansible-Playbooks ==== | ||
- | Nun können wir uns " | ||
- | * {{: | ||
- | * {{: | ||
- | |||
- | $ wget \ | ||
- | | ||
- | -O ansible-playbook-ffmuc-offloader-auf_basis_raspberry-4b.tar.gz | ||
- | |||
- | Anschließend entpacken wir es an Ort und Stelle. | ||
- | $ tar -xvf ansible-playbook-ffmuc-offloader-auf_basis_raspberry-4b.tar.gz | ||
- | |||
- | Somit ergibt sich folgende Verzeichnis- und Dateistruktur: | ||
- | < | ||
- | ├── inventory | ||
- | │ └── hosts | ||
- | └── playbooks | ||
- | ├── raspi_offloader_file.yml | ||
- | ├── raspi_offloader_menu.yml | ||
- | └── templates | ||
- | └── Raspbian | ||
- | ├── bandwidth.j2 | ||
- | ├── batman-adv.module.j2 | ||
- | ├── config.j2 | ||
- | ├── dkms.j2 | ||
- | ├── ext-respondd_alias.json.j2 | ||
- | ├── ext-respondd_config.json.j2 | ||
- | ├── fastd.j2 | ||
- | ├── hostapd.j2 | ||
- | ├── hosts.j2 | ||
- | ├── interfaces.j2 | ||
- | ├── interfaces_client_ohne_mesh.j2 | ||
- | ├── interfaces_mesh_mit_client.j2 | ||
- | ├── interfaces_mesh_ohne_client.j2 | ||
- | ├── oled-bandwidth.j2 | ||
- | ├── rclocal_both.j2 | ||
- | ├── rclocal_vxlan.j2 | ||
- | └── rclocal_wifi.j2</ | ||
- | |||
- | Nachfolgend finden wir die Inhalte der einzelnen Dateien die im ansible-playbook enthalten sind: | ||
- | === raspi_offloader_file.yml === | ||
- | <file java raspi_offloader_file.yml> | ||
- | - name: | ||
- | hosts: | ||
- | become: | ||
- | become_user: | ||
- | |||
- | vars: | ||
- | fastd_ports: | ||
- | muc_cty: | ||
- | muc_nord: 30003 | ||
- | muc_ost: | ||
- | muc_sued: 30005 | ||
- | muc_west: 30006 | ||
- | uml_nord: 30007 | ||
- | uml_ost: | ||
- | uml_sued: 30009 | ||
- | uml_west: 30010 | ||
- | gauting: | ||
- | freising: 30013 | ||
- | welt: | ||
- | vxlan_ids: | ||
- | muc_cty: | ||
- | muc_nord: 15521492 | ||
- | muc_ost: | ||
- | muc_sued: 8599288 | ||
- | muc_west: 7318933 | ||
- | uml_nord: 5705961 | ||
- | uml_ost: | ||
- | uml_sued: 16544703 | ||
- | uml_west: 16677749 | ||
- | gauting: | ||
- | freising: 12937858 | ||
- | welt: | ||
- | batman_adv_version: | ||
- | ffmuc_segment: | ||
- | raspberry_hostname: | ||
- | node_contact_address: | ||
- | raspberry_latitude: | ||
- | raspberry_longitude: | ||
- | raspberry_wifi: | ||
- | raspberry_clientvlan: | ||
- | raspberry_meshvlan: | ||
- | raspberry_oled: | ||
- | dtparam: | ||
- | |||
- | tasks: | ||
- | - name: Hostname ändern | ||
- | shell: hostnamectl set-hostname {{ raspberry_hostname }} | ||
- | |||
- | - name: Anpassung /etc/hosts | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: /etc/hosts | ||
- | |||
- | - name: Beschreibung des User ' | ||
- | user: | ||
- | name: pi | ||
- | comment: " | ||
- | state: present | ||
- | |||
- | - name: Service rfkill am Raspberry deaktivieren | ||
- | shell: rfkill unblock wifi | ||
- | |||
- | - name: Update und Upgrade der APT-Pakete | ||
- | apt: | ||
- | upgrade: dist | ||
- | update_cache: | ||
- | |||
- | - name: Reboot nach update | ||
- | reboot: | ||
- | |||
- | - name: Download des aktuellen BATMAN Archives | ||
- | get_url: | ||
- | url: https:// | ||
- | dest: / | ||
- | mode: ' | ||
- | |||
- | - name: BATMAN-Archiv entpacken | ||
- | unarchive: | ||
- | src: / | ||
- | dest: /usr/src | ||
- | remote_src: yes | ||
- | |||
- | - name: Installation des Dynamic Kernel Module Support Framework und der Header Files für den Raspberry Pi Linux Kernel | ||
- | apt: | ||
- | update_cache: | ||
- | pkg: | ||
- | - dkms | ||
- | - raspberrypi-kernel-headers | ||
- | state: present | ||
- | |||
- | - name: Rebuild BATMAN Kernel Header Dateien | ||
- | make: | ||
- | chdir: / | ||
- | target: scripts | ||
- | ignore_errors: | ||
- | |||
- | - name: Anlegen der dkms.conf für Dynamic Kernel Module Support | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | |||
- | - name: Dynamic Kernel Module Support hinzufügen | ||
- | #become: yes | ||
- | command: dkms add -m batman-adv -v {{ batman_adv_version }} | ||
- | register: ret | ||
- | failed_when: | ||
- | changed_when: | ||
- | |||
- | - name: Dynamic Kernel Module Support bauen | ||
- | #become: yes | ||
- | command: dkms build -m batman-adv -v {{ batman_adv_version }} | ||
- | |||
- | - name: Dynamic Kernel Module Support installieren | ||
- | #become: yes | ||
- | command: dkms install -m batman-adv -v {{batman_adv_version }} | ||
- | |||
- | - name: Laden des Kernelmodul beim Booten veranlassen | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | |||
- | - name: Laden des BATMAN Moduls | ||
- | #become: yes | ||
- | modprobe: | ||
- | name: batman_adv | ||
- | state: present | ||
- | |||
- | - name: Laden des dummy Moduls | ||
- | #become: yes | ||
- | modprobe: | ||
- | name: dummy | ||
- | state: present | ||
- | |||
- | - name: Installation der bridge-utils | ||
- | apt: | ||
- | update_cache: | ||
- | pkg: | ||
- | - batctl | ||
- | - bridge-utils | ||
- | state: present | ||
- | |||
- | - name: Aktivierung von BATMAN_V | ||
- | shell: batctl ra BATMAN_V | ||
- | |||
- | - name: Konfiguration des Interfaces | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | |||
- | - name: Installation von FASTD | ||
- | #become: yes | ||
- | apt: | ||
- | name: fastd | ||
- | state: present | ||
- | |||
- | - name: Verzeichnis für fastd- Konfigurationsdatei anlegen | ||
- | file: | ||
- | path: / | ||
- | state: directory | ||
- | |||
- | - name: Schlüssel für fastd erstellen | ||
- | shell: fastd --generate-key > / | ||
- | |||
- | - name: FASTD Secret Key aus / | ||
- | shell: grep Secret / | ||
- | register: secretkey_var | ||
- | |||
- | - name: FASTD Socket ermitteln | ||
- | set_fact: | ||
- | ffmuc_fast_port: | ||
- | loop: "{{ lookup(' | ||
- | when: " | ||
- | |||
- | - name: Erstellen der fastd Konfigurationsdatei | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | |||
- | - name: Service fastd beim Booten starten | ||
- | systemd: | ||
- | name: fastd@{{ ffmuc_segment }} | ||
- | state: started | ||
- | enabled: yes | ||
- | |||
- | - name: Installation der Pakete git und python3-netifaces | ||
- | apt: | ||
- | update_cache: | ||
- | pkg: | ||
- | - git | ||
- | - python3-netifaces | ||
- | state: present | ||
- | |||
- | - name: Repo ext-respondd klonen | ||
- | git: | ||
- | repo: https:// | ||
- | dest: / | ||
- | |||
- | - name: Systemd Startdatei für respondd kopieren | ||
- | shell: cp / | ||
- | |||
- | - name: Erstellen der resondd Konfigurationsdatei alias.json | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | |||
- | - name: Erstellen der resondd Konfigurationsdatei config.json | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | |||
- | - name: Service ext-respondd beim Booten starten | ||
- | systemd: | ||
- | name: ext-respondd | ||
- | daemon_reload: | ||
- | state: started | ||
- | enabled: yes | ||
- | |||
- | - name: Paket hostapd für WLAN installieren | ||
- | apt: | ||
- | update_cache: | ||
- | pkg: | ||
- | - hostapd | ||
- | state: present | ||
- | when: ( raspberry_wifi == " | ||
- | |||
- | - name: hostapd konfigurieren | ||
- | shell: echo ' | ||
- | when: ( raspberry_wifi == " | ||
- | |||
- | - name: hostapd Konfigurationsdatei anlegen | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_wifi == " | ||
- | |||
- | - name: wlan0 in Bridge packen | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_wifi == " | ||
- | |||
- | - name: Service hostapd beim Booten und jetzt starten und das Laden der Unit Datei vom Service hostapd ermöglichen | ||
- | systemd: | ||
- | name: hostapd | ||
- | enabled: yes | ||
- | masked: no | ||
- | state: started | ||
- | when: ( raspberry_wifi == " | ||
- | |||
- | - name: Konfiguration des Client-VLAN ohne Mesh-Netz | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_clientvlan|length > 0 ) and ( raspberry_meshvlan|length == 0 ) | ||
- | |||
- | - name: vxlan_id für ausgewähltes Segment ermitteln | ||
- | set_fact: | ||
- | ffmuc_vxlan_id: | ||
- | loop: "{{ lookup(' | ||
- | when: " | ||
- | |||
- | - name: Konfiguration des Mesh-VLAN ohne Client-VLAN | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_clientvlan|length == 0 ) and ( raspberry_meshvlan|length > 0 ) | ||
- | |||
- | - name: Konfiguration von Mesh- und Client-VLAN | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_clientvlan|length > 0 ) and ( raspberry_meshvlan|length > 0 ) | ||
- | |||
- | - name: Konfiguration des bevorzugte Meshingpoint in BATMAN_V ohne Wifi-Nutzung | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_meshvlan|length > 0 ) and ( raspberry_wifi != " | ||
- | |||
- | - name: Konfiguration des bevorzugte Meshingpoint in BATMAN_V mit Wifi-Nutzung | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_meshvlan|length > 0 ) and ( raspberry_wifi == " | ||
- | |||
- | - name: Für OLED-Konfiguration i2c-bcm2708 in / | ||
- | shell: echo i2c-bcm2708 >> / | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Für OLED-Konfiguration i2c-dev in / | ||
- | shell: echo i2c-dev >> / | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Installation der für das OLED benötigten Pakete | ||
- | apt: | ||
- | update_cache: | ||
- | pkg: | ||
- | - python3-dev | ||
- | - python3-smbus | ||
- | - i2c-tools | ||
- | - python3-pil | ||
- | - python3-pip | ||
- | - python3-setuptools | ||
- | - python3-rpi.gpio | ||
- | - git | ||
- | - fonts-freefont-ttf | ||
- | state: present | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Laden des Kernelmodul i2c_arm beim Booten veranlassen | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Reboot nach Konfigurationsänderung | ||
- | reboot: | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Repo Adafruit_Python_SSD1306 klonen | ||
- | git: | ||
- | repo: https:// | ||
- | dest: / | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Für OLED-Konfiguration Adafruit_Python_SSD1306 installieren | ||
- | shell: cd / | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Script zur Anzeige klonen | ||
- | git: | ||
- | repo: https:// | ||
- | dest: / | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Script zur Bandbreitenauslastung anpassen | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Startscript für das OLED anlegen | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Service oled-bandwidth beim Booten starten | ||
- | systemd: | ||
- | name: oled-bandwidth | ||
- | daemon_reload: | ||
- | state: started | ||
- | enabled: yes | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Reboot nach Abschluss der Konfiguration unseres Offloaders | ||
- | reboot: | ||
- | |||
- | |||
- | ... #YAML Ende Syntax</ | ||
- | |||
- | === raspi_offloader_menu.yml === | ||
- | <file java raspi_offloader_menu.yml> | ||
- | - name: | ||
- | hosts: | ||
- | become: | ||
- | become_user: | ||
- | |||
- | vars: | ||
- | fastd_ports: | ||
- | muc_cty: | ||
- | muc_nord: 30003 | ||
- | muc_ost: | ||
- | muc_sued: 30005 | ||
- | muc_west: 30006 | ||
- | uml_nord: 30007 | ||
- | uml_ost: | ||
- | uml_sued: 30009 | ||
- | uml_west: 30010 | ||
- | gauting: | ||
- | freising: 30013 | ||
- | welt: | ||
- | vxlan_ids: | ||
- | muc_cty: | ||
- | muc_nord: 15521492 | ||
- | muc_ost: | ||
- | muc_sued: 8599288 | ||
- | muc_west: 7318933 | ||
- | uml_nord: 5705961 | ||
- | uml_ost: | ||
- | uml_sued: 16544703 | ||
- | uml_west: 16677749 | ||
- | gauting: | ||
- | freising: 12937858 | ||
- | welt: | ||
- | dtparam: | ||
- | |||
- | vars_prompt: | ||
- | - name: batman_adv_version | ||
- | prompt: "\nWas ist die aktuelle BATMAN Version, die hier\nhttps:// | ||
- | private: no | ||
- | |||
- | - name: ffmuc_segment | ||
- | prompt: "\nIn welchem der Segmente hier soll der Offloader betrieben werden: \n muc_cty \n muc_nord \n muc_ost \n muc_sued \n muc_west \n uml_nord \n uml_ost \n uml_sued \n uml_west \n gauting \n freising \n welt " | ||
- | private: no | ||
- | |||
- | - name: raspberry_hostname | ||
- | prompt: "\nWie lautet der Hostname des Raspberry Offloaders? | ||
- | private: no | ||
- | |||
- | - name: node_contact_address | ||
- | prompt: "\nWie lautet die Kontakt-Adresse des Node-Betreibers? | ||
- | private: no | ||
- | |||
- | - name: raspberry_latitude | ||
- | prompt: "\nWie lautet der Geographische Breitengrad des Raspberry Offloaders? | ||
- | private: no | ||
- | |||
- | - name: raspberry_longitude | ||
- | prompt: "\nWie lautet der Geographische Längengrad des Raspberry Offloaders? | ||
- | private: no | ||
- | |||
- | - name: raspberry_wifi | ||
- | prompt: " | ||
- | private: no | ||
- | |||
- | - name: raspberry_clientvlan | ||
- | prompt: " | ||
- | private: no | ||
- | |||
- | - name: raspberry_meshvlan | ||
- | prompt: " | ||
- | private: no | ||
- | |||
- | - name: raspberry_oled | ||
- | prompt: "\nIst ein OLE-Display an dem Raspberry Offloader angeschlossen? | ||
- | private: no | ||
- | |||
- | tasks: | ||
- | - name: Hostname ändern | ||
- | shell: hostnamectl set-hostname {{ raspberry_hostname }} | ||
- | |||
- | - name: Anpassung /etc/hosts | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: /etc/hosts | ||
- | |||
- | - name: Beschreibung des User ' | ||
- | user: | ||
- | name: pi | ||
- | comment: " | ||
- | state: present | ||
- | |||
- | - name: Service rfkill am Raspberry deaktivieren | ||
- | shell: rfkill unblock wifi | ||
- | |||
- | - name: Update und Upgrade der APT-Pakete | ||
- | apt: | ||
- | upgrade: dist | ||
- | update_cache: | ||
- | |||
- | - name: Reboot nach update | ||
- | reboot: | ||
- | |||
- | - name: Download des aktuellen BATMAN Archives | ||
- | get_url: | ||
- | url: https:// | ||
- | dest: / | ||
- | mode: ' | ||
- | |||
- | - name: BATMAN-Archiv entpacken | ||
- | unarchive: | ||
- | src: / | ||
- | dest: /usr/src | ||
- | remote_src: yes | ||
- | |||
- | - name: Installation des Dynamic Kernel Module Support Framework und der Header Files für den Raspberry Pi Linux Kernel | ||
- | apt: | ||
- | update_cache: | ||
- | pkg: | ||
- | - dkms | ||
- | - raspberrypi-kernel-headers | ||
- | state: present | ||
- | |||
- | - name: Rebuild BATMAN Kernel Header Dateien | ||
- | make: | ||
- | chdir: / | ||
- | target: scripts | ||
- | ignore_errors: | ||
- | |||
- | - name: Anlegen der dkms.conf für Dynamic Kernel Module Support | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | |||
- | - name: Dynamic Kernel Module Support hinzufügen | ||
- | #become: yes | ||
- | command: dkms add -m batman-adv -v {{ batman_adv_version }} | ||
- | register: ret | ||
- | failed_when: | ||
- | changed_when: | ||
- | |||
- | - name: Dynamic Kernel Module Support bauen | ||
- | #become: yes | ||
- | command: dkms build -m batman-adv -v {{ batman_adv_version }} | ||
- | |||
- | - name: Dynamic Kernel Module Support installieren | ||
- | #become: yes | ||
- | command: dkms install -m batman-adv -v {{batman_adv_version }} | ||
- | |||
- | - name: Laden des Kernelmodul beim Booten veranlassen | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | |||
- | - name: Laden des BATMAN Moduls | ||
- | #become: yes | ||
- | modprobe: | ||
- | name: batman_adv | ||
- | state: present | ||
- | |||
- | - name: Laden des dummy Moduls | ||
- | #become: yes | ||
- | modprobe: | ||
- | name: dummy | ||
- | state: present | ||
- | |||
- | - name: Installation der bridge-utils | ||
- | apt: | ||
- | update_cache: | ||
- | pkg: | ||
- | - batctl | ||
- | - bridge-utils | ||
- | state: present | ||
- | |||
- | - name: Aktivierung von BATMAN_V | ||
- | shell: batctl ra BATMAN_V | ||
- | |||
- | - name: Konfiguration des Interfaces | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | |||
- | - name: Installation von FASTD | ||
- | #become: yes | ||
- | apt: | ||
- | name: fastd | ||
- | state: present | ||
- | |||
- | - name: Verzeichnis für fastd- Konfigurationsdatei anlegen | ||
- | file: | ||
- | path: / | ||
- | state: directory | ||
- | |||
- | - name: Schlüssel für fastd erstellen | ||
- | shell: fastd --generate-key > / | ||
- | |||
- | - name: FASTD Secret Key aus / | ||
- | shell: grep Secret / | ||
- | register: secretkey_var | ||
- | |||
- | - name: FASTD Socket ermitteln | ||
- | set_fact: | ||
- | ffmuc_fast_port: | ||
- | loop: "{{ lookup(' | ||
- | when: " | ||
- | |||
- | - name: Erstellen der fastd Konfigurationsdatei | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | |||
- | - name: Service fastd beim Booten starten | ||
- | systemd: | ||
- | name: fastd@{{ ffmuc_segment }} | ||
- | state: started | ||
- | enabled: yes | ||
- | |||
- | - name: Installation der Pakete git und python3-netifaces | ||
- | apt: | ||
- | update_cache: | ||
- | pkg: | ||
- | - git | ||
- | - python3-netifaces | ||
- | state: present | ||
- | |||
- | - name: Repo ext-respondd klonen | ||
- | git: | ||
- | repo: https:// | ||
- | dest: / | ||
- | |||
- | - name: Systemd Startdatei für respondd kopieren | ||
- | shell: cp / | ||
- | |||
- | - name: Erstellen der resondd Konfigurationsdatei alias.json | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | |||
- | - name: Erstellen der resondd Konfigurationsdatei config.json | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | |||
- | - name: Service ext-respondd beim Booten starten | ||
- | systemd: | ||
- | name: ext-respondd | ||
- | daemon_reload: | ||
- | state: started | ||
- | enabled: yes | ||
- | |||
- | - name: Paket hostapd für WLAN installieren | ||
- | apt: | ||
- | update_cache: | ||
- | pkg: | ||
- | - hostapd | ||
- | state: present | ||
- | when: ( raspberry_wifi == " | ||
- | |||
- | - name: hostapd konfigurieren | ||
- | shell: echo ' | ||
- | when: ( raspberry_wifi == " | ||
- | |||
- | - name: hostapd Konfigurationsdatei anlegen | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_wifi == " | ||
- | |||
- | - name: wlan0 in Bridge packen | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_wifi == " | ||
- | |||
- | - name: Service hostapd beim Booten und jetzt starten und das Laden der Unit Datei vom Service hostapd ermöglichen | ||
- | systemd: | ||
- | name: hostapd | ||
- | enabled: yes | ||
- | masked: no | ||
- | state: started | ||
- | when: ( raspberry_wifi == " | ||
- | |||
- | - name: Konfiguration des Client-VLAN ohne Mesh-Netz | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_clientvlan|length > 0 ) and ( raspberry_meshvlan|length == 0 ) | ||
- | |||
- | - name: vxlan_id für ausgewähltes Segment ermitteln | ||
- | set_fact: | ||
- | ffmuc_vxlan_id: | ||
- | loop: "{{ lookup(' | ||
- | when: " | ||
- | |||
- | - name: Konfiguration des Mesh-VLAN ohne Client-VLAN | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_clientvlan|length == 0 ) and ( raspberry_meshvlan|length > 0 ) | ||
- | |||
- | - name: Konfiguration von Mesh- und Client-VLAN | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_clientvlan|length > 0 ) and ( raspberry_meshvlan|length > 0 ) | ||
- | |||
- | - name: Konfiguration des bevorzugte Meshingpoint in BATMAN_V ohne Wifi-Nutzung | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_meshvlan|length > 0 ) and ( raspberry_wifi != " | ||
- | |||
- | - name: Konfiguration des bevorzugte Meshingpoint in BATMAN_V mit Wifi-Nutzung | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_meshvlan|length > 0 ) and ( raspberry_wifi == " | ||
- | |||
- | - name: Für OLED-Konfiguration i2c-bcm2708 in / | ||
- | shell: echo i2c-bcm2708 >> / | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Für OLED-Konfiguration i2c-dev in / | ||
- | shell: echo i2c-dev >> / | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Installation der für das OLED benötigten Pakete | ||
- | apt: | ||
- | update_cache: | ||
- | pkg: | ||
- | - python3-dev | ||
- | - python3-smbus | ||
- | - i2c-tools | ||
- | - python3-pil | ||
- | - python3-pip | ||
- | - python3-setuptools | ||
- | - python3-rpi.gpio | ||
- | - git | ||
- | - fonts-freefont-ttf | ||
- | state: present | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Laden des Kernelmodul i2c_arm beim Booten veranlassen | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Reboot nach Konfigurationsänderung | ||
- | reboot: | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Repo Adafruit_Python_SSD1306 klonen | ||
- | git: | ||
- | repo: https:// | ||
- | dest: / | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Für OLED-Konfiguration Adafruit_Python_SSD1306 installieren | ||
- | shell: cd / | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Script zur Anzeige klonen | ||
- | git: | ||
- | repo: https:// | ||
- | dest: / | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Script zur Bandbreitenauslastung anpassen | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Startscript für das OLED anlegen | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Service oled-bandwidth beim Booten starten | ||
- | systemd: | ||
- | name: oled-bandwidth | ||
- | daemon_reload: | ||
- | state: started | ||
- | enabled: yes | ||
- | when: ( raspberry_oled == " | ||
- | |||
- | - name: Reboot nach Abschluss der Konfiguration unseres Offloaders | ||
- | reboot: | ||
- | |||
- | ... #YAML Ende Syntax</ | ||
- | |||
- | === bandwith.j2 === | ||
- | <file java bandwith.j2># | ||
- | # Inspired by https:// | ||
- | # | ||
- | # Maintained by awlnx - aw@awlnx.space | ||
- | # | ||
- | |||
- | import subprocess | ||
- | import time | ||
- | import re | ||
- | import Adafruit_GPIO.SPI as SPI | ||
- | import Adafruit_SSD1306 | ||
- | from PIL import Image | ||
- | from PIL import ImageDraw | ||
- | from PIL import ImageFont | ||
- | import math | ||
- | |||
- | # Adjust to your needs | ||
- | wifi = ' | ||
- | vpn = ' | ||
- | batman = ' | ||
- | primary_mac = '{{ ansible_eth0.macaddress }}' | ||
- | |||
- | # We assume 100mbit/s max bandwidth | ||
- | maxRateIn = 10000000 | ||
- | maxRateOut = 10000000 | ||
- | PImaxRateIn = 10000000 | ||
- | PImaxRateOut = 10000000 | ||
- | |||
- | ### DO NOT EDIT BELOW THIS POINT ### | ||
- | |||
- | # Raspberry Pi pin configuration: | ||
- | RST = 24 | ||
- | |||
- | # 128x64 display with hardware I2C: | ||
- | disp = Adafruit_SSD1306.SSD1306_128_64(rst=RST) | ||
- | |||
- | # Initialize library. | ||
- | disp.begin() | ||
- | |||
- | # Clear display. | ||
- | disp.clear() | ||
- | disp.display() | ||
- | |||
- | # Create blank image for drawing. | ||
- | # Make sure to create image with mode ' | ||
- | width = disp.width | ||
- | height = disp.height | ||
- | image = Image.new(' | ||
- | |||
- | # Get drawing object to draw on image. | ||
- | draw = ImageDraw.Draw(image) | ||
- | |||
- | font = ImageFont.truetype('/ | ||
- | fontsmall = ImageFont.truetype('/ | ||
- | fontverysmall = ImageFont.truetype('/ | ||
- | fontmedium = ImageFont.truetype('/ | ||
- | |||
- | #Display Image | ||
- | disp.image(image) | ||
- | disp.display() | ||
- | |||
- | #Functions | ||
- | |||
- | def get_network_bytes(interface): | ||
- | for line in open('/ | ||
- | if interface in line: | ||
- | data = line.split(' | ||
- | rx_bytes, tx_bytes = (data[0], data[8]) | ||
- | return (int(rx_bytes), | ||
- | |||
- | def drawBar (x, barHeight): | ||
- | # parameters are x, y, end x, end y | ||
- | # draw.rectangle ((x, height - barHeight, x + 10, height -1), outline=255, | ||
- | draw.rectangle ((x, 32 - barHeight, x + 8, height - 32), outline=255, | ||
- | |||
- | def drawBarLOW (x, barLOWHeight): | ||
- | # parameters are x, y, end x, end y | ||
- | draw.rectangle ((x, 32 + barLOWHeight, | ||
- | |||
- | def textRate(rate): | ||
- | # rate -> raw bitrate | ||
- | # Returns: SI formatted bitrate | ||
- | if rate == 0: | ||
- | return " | ||
- | rate = rate * 8 | ||
- | size_name = ( | ||
- | " | ||
- | i = int(math.floor(math.log(rate , 1024))) | ||
- | p = math.pow(1024, | ||
- | s = round(rate / p, 1) | ||
- | return "%s %s" % (s, size_name[i]) | ||
- | |||
- | lastInBytes = get_network_bytes(vpn)[0]; | ||
- | lastOutBytes = get_network_bytes(vpn)[1]; | ||
- | lastPIInBytes = get_network_bytes(wifi)[0]; | ||
- | lastPIOutBytes = get_network_bytes(wifi)[1]; | ||
- | lastTime = time.time() | ||
- | |||
- | #timed array vars | ||
- | timerTime = time.time() | ||
- | highestSpeedIn = 0 | ||
- | highestSpeedOut = 0 | ||
- | PIhighestSpeedIn = 0 | ||
- | PIhighestSpeedOut = 0 | ||
- | speedArrayIn = [] | ||
- | speedArrayOut = [] | ||
- | PIspeedArrayIn = [] | ||
- | PIspeedArrayOut = [] | ||
- | inMax = 0 | ||
- | outMax = 0 | ||
- | PIinMax = 0 | ||
- | PIoutMax = 0 | ||
- | |||
- | while (1): | ||
- | time.sleep(2) | ||
- | draw.rectangle((0, | ||
- | |||
- | now = time.time() | ||
- | elapsed = now - lastTime | ||
- | lastTime = now | ||
- | |||
- | #calculate rates in and out | ||
- | inBytes = get_network_bytes(vpn)[0] | ||
- | currInBytes = (inBytes - lastInBytes) / elapsed | ||
- | lastInBytes = inBytes | ||
- | |||
- | outBytes = get_network_bytes(vpn)[1] | ||
- | currOutBytes = (outBytes - lastOutBytes) / elapsed | ||
- | lastOutBytes = outBytes | ||
- | |||
- | PIinBytes = get_network_bytes(wifi)[0] | ||
- | currPIInBytes = (PIinBytes - lastPIInBytes) / elapsed | ||
- | lastPIInBytes = PIinBytes | ||
- | |||
- | PIoutBytes = get_network_bytes(wifi)[1] | ||
- | currPIOutBytes = (PIoutBytes - lastPIOutBytes) / elapsed | ||
- | lastPIOutBytes = PIoutBytes | ||
- | |||
- | |||
- | #max rate last 24 hours calculations | ||
- | |||
- | if currInBytes > highestSpeedIn: | ||
- | highestSpeedIn = currInBytes | ||
- | if currOutBytes > highestSpeedOut: | ||
- | highestSpeedOut = currOutBytes | ||
- | if currPIInBytes > PIhighestSpeedIn: | ||
- | PIhighestSpeedIn = currPIInBytes | ||
- | if currPIOutBytes > PIhighestSpeedOut: | ||
- | PIhighestSpeedOut = currPIOutBytes | ||
- | |||
- | if now > timerTime + 3600: | ||
- | print(' | ||
- | timerTime = now | ||
- | |||
- | speedArrayIn.append (highestSpeedIn) | ||
- | if len (speedArrayIn) > 23: | ||
- | del speedArrayIn[0] | ||
- | inMax = max(speedArrayIn) | ||
- | |||
- | speedArrayOut.append (highestSpeedOut) | ||
- | if len (speedArrayOut) > 23: | ||
- | del speedArrayOut[0] | ||
- | outMax = max(speedArrayOut) | ||
- | |||
- | highestSpeedIn = 0 | ||
- | highestSpeedOut = 0 | ||
- | |||
- | PIspeedArrayIn.append (PIhighestSpeedIn) | ||
- | if len (PIspeedArrayIn) > 23: | ||
- | del PIspeedArrayIn[0] | ||
- | PIinMax = max(PIspeedArrayIn) | ||
- | |||
- | PIspeedArrayOut.append (PIhighestSpeedOut) | ||
- | if len (PIspeedArrayOut) > 23: | ||
- | del PIspeedArrayOut[0] | ||
- | PIoutMax = max(PIspeedArrayOut) | ||
- | |||
- | PIhighestSpeedIn = 0 | ||
- | PIhighestSpeedOut = 0 | ||
- | |||
- | #adjust these in each loop in case we find a faster speed | ||
- | inMax = max(inMax, highestSpeedIn) | ||
- | outMax = max(outMax, highestSpeedOut) | ||
- | PIinMax = max(PIinMax, | ||
- | PIoutMax = max(PIoutMax, | ||
- | |||
- | #draw graph | ||
- | inHeight = 0.0 | ||
- | outHeight = 0.0 | ||
- | PIinHeight = 0.0 | ||
- | PIoutHeight = 0.0 | ||
- | |||
- | if currInBytes > 0: | ||
- | inHeight = float(currInBytes / maxRateIn) * 32 | ||
- | |||
- | if currOutBytes > 0: | ||
- | outHeight = float(currOutBytes / maxRateOut) * 32 | ||
- | |||
- | if currPIInBytes > 0: | ||
- | PIinHeight = float(currPIInBytes / PImaxRateIn) * 32 | ||
- | |||
- | if currPIOutBytes > 0: | ||
- | PIoutHeight = float(currPIOutBytes / PImaxRateOut) * 32 | ||
- | |||
- | drawBar (0, inHeight) | ||
- | drawBar (10, PIinHeight) | ||
- | drawBarLOW (0, outHeight) | ||
- | drawBarLOW (10, PIoutHeight) | ||
- | #write rates | ||
- | draw.text((26, | ||
- | draw.text((26, | ||
- | |||
- | draw.text((81, | ||
- | draw.text((81, | ||
- | |||
- | # Batman Clients | ||
- | clients = subprocess.check_output(" | ||
- | draw.text((0, | ||
- | draw.text((10, | ||
- | |||
- | #max rates | ||
- | draw.text((36, | ||
- | draw.text((26, | ||
- | draw.text((26, | ||
- | |||
- | draw.text((90, | ||
- | draw.text((81, | ||
- | draw.text((81, | ||
- | |||
- | disp.image(image) | ||
- | disp.display()</ | ||
- | |||
- | |||
- | === batman-adv.module.j2 === | ||
- | <file java batman-adv.module.j2># | ||
- | # Load batman-adv module on system boot | ||
- | # | ||
- | batman-adv | ||
- | dummy</ | ||
- | |||
- | === config.j2 === | ||
- | <file java config.j2># | ||
- | # http:// | ||
- | # Some settings may impact device functionality. See link above for details | ||
- | |||
- | # uncomment if you get no picture on HDMI for a default " | ||
- | # | ||
- | |||
- | # uncomment this if your display has a black border of unused pixels visible | ||
- | # and your display can output without overscan | ||
- | # | ||
- | |||
- | # uncomment the following to adjust overscan. Use positive numbers if console | ||
- | # goes off screen, and negative if there is too much border | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | |||
- | # uncomment to force a console size. By default it will be display' | ||
- | # overscan. | ||
- | # | ||
- | # | ||
- | |||
- | # uncomment if hdmi display is not detected and composite is being output | ||
- | # | ||
- | |||
- | # uncomment to force a specific HDMI mode (this will force VGA) | ||
- | # | ||
- | # | ||
- | |||
- | # uncomment to force a HDMI mode rather than DVI. This can make audio work in | ||
- | # DMT (computer monitor) modes | ||
- | # | ||
- | |||
- | # uncomment to increase signal to HDMI, if you have interference, | ||
- | # no display | ||
- | # | ||
- | |||
- | # uncomment for composite PAL | ||
- | # | ||
- | |||
- | #uncomment to overclock the arm. 700 MHz is the default. | ||
- | # | ||
- | |||
- | # Uncomment some or all of these to enable the optional hardware interfaces | ||
- | # Django : 2019-09-11 | ||
- | # default: # dtparam=i2c_arm=on | ||
- | dtparam=i2c_arm=on | ||
- | # | ||
- | # | ||
- | |||
- | # Uncomment this to enable the lirc-rpi module | ||
- | # | ||
- | |||
- | # Additional overlays and parameters are documented / | ||
- | |||
- | # Enable audio (loads snd_bcm2835) | ||
- | dtparam=audio=on | ||
- | |||
- | [pi4] | ||
- | # Enable DRM VC4 V3D driver on top of the dispmanx display stack | ||
- | dtoverlay=vc4-fkms-v3d | ||
- | max_framebuffers=2 | ||
- | |||
- | [all] | ||
- | # | ||
- | === dkms.j2 === | ||
- | <file j2 dkms.j2> | ||
- | PACKAGE_VERSION={{ batman_adv_version }} | ||
- | |||
- | DEST_MODULE_LOCATION=/ | ||
- | BUILT_MODULE_NAME=batman-adv | ||
- | BUILT_MODULE_LOCATION=net/ | ||
- | |||
- | MAKE="' | ||
- | CLEAN="' | ||
- | |||
- | AUTOINSTALL=" | ||
- | [django@T410 Raspbian]$ | ||
- | [django@T410 Raspbian]$ | ||
- | [django@T410 Raspbian]$ | ||
- | [django@T410 Raspbian]$ | ||
- | [django@T410 Raspbian]$ cat dkms.j2 | ||
- | PACKAGE_NAME=batman-adv | ||
- | PACKAGE_VERSION={{ batman_adv_version }} | ||
- | |||
- | DEST_MODULE_LOCATION=/ | ||
- | BUILT_MODULE_NAME=batman-adv | ||
- | BUILT_MODULE_LOCATION=net/ | ||
- | |||
- | MAKE="' | ||
- | CLEAN="' | ||
- | |||
- | AUTOINSTALL=" | ||
- | |||
- | === ext-respondd_alias.json.j2 === | ||
- | <file j2 ext-respondd_alias.json.j2> | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | }, | ||
- | " | ||
- | }</ | ||
- | |||
- | === ext-respondd_config.json.j2 === | ||
- | <file j2 ext-respondd_config.json.j2> | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }</ | ||
- | |||
- | === fastd.j2 === | ||
- | <file j2 fastd.j2># | ||
- | # welt FASTd configuration | ||
- | # | ||
- | |||
- | log to syslog level info; | ||
- | |||
- | interface " | ||
- | |||
- | method " | ||
- | method " | ||
- | |||
- | secret "{{ secretkey_var.stdout }}"; | ||
- | |||
- | mtu 1406; | ||
- | |||
- | status socket "/ | ||
- | |||
- | on up " | ||
- | batctl ra BATMAN_V | ||
- | ip link set $INTERFACE down | ||
- | ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
- | ip link set $INTERFACE up | ||
- | batctl -m bat-{{ ffmuc_segment }} if add $INTERFACE | ||
- | |||
- | "; | ||
- | |||
- | on down " | ||
- | batctl -m bat-{{ ffmuc_segment }} if del $INTERFACE | ||
- | "; | ||
- | peer group " | ||
- | peer limit 1; | ||
- | | ||
- | peer " | ||
- | key " | ||
- | remote " | ||
- | } | ||
- | |||
- | peer " | ||
- | key " | ||
- | remote " | ||
- | } | ||
- | |||
- | peer " | ||
- | key " | ||
- | remote " | ||
- | } | ||
- | }</ | ||
- | |||
- | === hostapd.j2 === | ||
- | <file j2 hostapd.j2> | ||
- | |||
- | country_code=US | ||
- | |||
- | interface=wlan0 | ||
- | driver=nl80211 | ||
- | |||
- | macaddr_acl=0 | ||
- | |||
- | logger_syslog=0 | ||
- | logger_syslog_level=4 | ||
- | logger_stdout=-1 | ||
- | logger_stdout_level=0 | ||
- | |||
- | hw_mode=a | ||
- | wmm_enabled=1 | ||
- | |||
- | # N | ||
- | ieee80211n=1 | ||
- | require_ht=1 | ||
- | ht_capab=[MAX-AMSDU-3839][HT40+][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40] | ||
- | |||
- | # AC | ||
- | ieee80211ac=1 | ||
- | require_vht=1 | ||
- | ieee80211d=0 | ||
- | ieee80211h=0 | ||
- | vht_capab=[MAX-AMSDU-3839][SHORT-GI-80] | ||
- | vht_oper_chwidth=1 | ||
- | channel=36 | ||
- | vht_oper_centr_freq_seg0_idx=42</ | ||
- | |||
- | === hosts.j2 === | ||
- | <file j2 hosts.j2> | ||
- | :: | ||
- | ff02:: | ||
- | ff02:: | ||
- | |||
- | === interfaces_client_ohne_mesh.j2 === | ||
- | <file j2 interfaces_client_ohne_mesh.j2># | ||
- | |||
- | # Please note that this file is written to be used with dhcpcd | ||
- | # For static IP, consult / | ||
- | |||
- | # Include files from / | ||
- | # source-directory / | ||
- | |||
- | auto eth0 | ||
- | iface eth0 inet dhcp | ||
- | |||
- | auto eth0.{{ raspberry_clientvlan }} | ||
- | iface eth0.{{ raspberry_clientvlan }} inet manual | ||
- | |||
- | auto br-{{ ffmuc_segment }} | ||
- | iface br-{{ ffmuc_segment }} inet dhcp | ||
- | bridge-ports bat-{{ ffmuc_segment }} eth0.{{ raspberry_clientvlan }} | ||
- | pre-up / | ||
- | pre-up /sbin/ip link add dummy-{{ ffmuc_segment }} type dummy | ||
- | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
- | pre-up /sbin/ip link set dummy-{{ ffmuc_segment }} up | ||
- | pre-up / | ||
- | pre-up /sbin/ip link set bat-{{ ffmuc_segment }} up | ||
- | pre-up / | ||
- | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
- | post-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
- | |||
- | === interfaces.j2 === | ||
- | <file j2 interfaces.j2># | ||
- | |||
- | # Please note that this file is written to be used with dhcpcd | ||
- | # For static IP, consult / | ||
- | |||
- | # Include files from / | ||
- | # source-directory / | ||
- | |||
- | auto eth0 | ||
- | iface eth0 inet dhcp | ||
- | |||
- | auto br-{{ ffmuc_segment }} | ||
- | iface br-{{ ffmuc_segment }} inet dhcp | ||
- | bridge-ports bat-{{ ffmuc_segment }} | ||
- | pre-up / | ||
- | pre-up /sbin/ip link add dummy-{{ ffmuc_segment }} type dummy | ||
- | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
- | pre-up /sbin/ip link set dummy-{{ ffmuc_segment }} up | ||
- | pre-up / | ||
- | pre-up /sbin/ip link set bat-{{ ffmuc_segment }} up | ||
- | pre-up / | ||
- | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
- | post-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
- | </ | ||
- | |||
- | === interfaces_mesh_mit_client.j2 === | ||
- | <file j2 interfaces_mesh_mit_client.j2># | ||
- | |||
- | # Please note that this file is written to be used with dhcpcd | ||
- | # For static IP, consult / | ||
- | |||
- | # Include files from / | ||
- | # source-directory / | ||
- | |||
- | auto eth0 | ||
- | iface eth0 inet dhcp | ||
- | |||
- | auto eth0.{{ raspberry_meshvlan }} | ||
- | iface eth0.{{ raspberry_meshvlan }} inet manual | ||
- | pre-up /sbin/ip link add vxlan-mesh type vxlan id {{ ffmuc_vxlan_id }} group ff02::15c dstport 4789 port 32768 61000 no udpcsum udp6zerocsumtx udp6zerocsumrx dev eth0.{{ raspberry_meshvlan }} || true | ||
- | up /sbin/ip link set vxlan-mesh up | ||
- | post-up / | ||
- | post-up / | ||
- | down ip link set vxlan-mesh down | ||
- | post-down ip link del vxlan-mesh || true | ||
- | |||
- | auto eth0.{{ raspberry_clientvlan }} | ||
- | iface eth0.{{ raspberry_clientvlan }} inet manual | ||
- | |||
- | auto br-{{ ffmuc_segment }} | ||
- | iface br-{{ ffmuc_segment }} inet dhcp | ||
- | bridge-ports bat-{{ ffmuc_segment }} eth0.{{ raspberry_clientvlan }} | ||
- | pre-up / | ||
- | pre-up /sbin/ip link add dummy-{{ ffmuc_segment }} type dummy | ||
- | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
- | pre-up /sbin/ip link set dummy-{{ ffmuc_segment }} up | ||
- | pre-up / | ||
- | pre-up /sbin/ip link set bat-{{ ffmuc_segment }} up | ||
- | pre-up / | ||
- | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
- | post-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
- | </ | ||
- | |||
- | === interfaces_mesh_ohne_client.j2 === | ||
- | <file j2 interfaces_mesh_ohne_client.j2># | ||
- | |||
- | # Please note that this file is written to be used with dhcpcd | ||
- | # For static IP, consult / | ||
- | |||
- | # Include files from / | ||
- | # source-directory / | ||
- | |||
- | auto eth0 | ||
- | iface eth0 inet dhcp | ||
- | |||
- | auto eth0.{{ raspberry_meshvlan }} | ||
- | iface eth0.{{ raspberry_meshvlan }} inet manual | ||
- | pre-up /sbin/ip link add vxlan-mesh type vxlan id {{ ffmuc_vxlan_id }} group ff02::15c dstport 4789 port 32768 61000 no udpcsum udp6zerocsumtx udp6zerocsumrx dev eth0.{{ raspberry_meshvlan }} || true | ||
- | up /sbin/ip link set vxlan-mesh up | ||
- | post-up / | ||
- | post-up / | ||
- | down ip link set vxlan-mesh down | ||
- | post-down ip link del vxlan-mesh || true | ||
- | |||
- | auto br-{{ ffmuc_segment }} | ||
- | iface br-{{ ffmuc_segment }} inet dhcp | ||
- | bridge-ports bat-{{ ffmuc_segment }} | ||
- | pre-up / | ||
- | pre-up /sbin/ip link add dummy-{{ ffmuc_segment }} type dummy | ||
- | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
- | pre-up /sbin/ip link set dummy-{{ ffmuc_segment }} up | ||
- | pre-up / | ||
- | pre-up /sbin/ip link set bat-{{ ffmuc_segment }} up | ||
- | pre-up / | ||
- | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
- | post-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
- | </ | ||
- | === oled-bandwidth.j2 === | ||
- | <file bash oled-bandwidth.j2># | ||
- | [Unit] | ||
- | After=network.target | ||
- | |||
- | [Service] | ||
- | ExecStart=/ | ||
- | |||
- | [Install] | ||
- | WantedBy=default.target</ | ||
- | |||
- | === rclocal_both.j2 === | ||
- | <file java rclocal_both.j2># | ||
- | # | ||
- | # rc.local | ||
- | # | ||
- | # This script is executed at the end of each multiuser runlevel. | ||
- | # Make sure that the script will "exit 0" on success or any other | ||
- | # value on error. | ||
- | # | ||
- | # In order to enable or disable this script just change the execution | ||
- | # bits. | ||
- | # | ||
- | # By default this script does nothing. | ||
- | |||
- | # Print the IP address | ||
- | _IP=$(hostname -I) || true | ||
- | if [ " | ||
- | printf "My IP address is %s\n" " | ||
- | fi | ||
- | sleep 10; /sbin/brctl addif br-{{ ffmuc_segment }} wlan0 | ||
- | echo 1000000 > / | ||
- | exit 0</ | ||
- | |||
- | === rclocal_vxlan.j2 === | ||
- | <file java rclocal_vxlan.j2># | ||
- | # | ||
- | # rc.local | ||
- | # | ||
- | # This script is executed at the end of each multiuser runlevel. | ||
- | # Make sure that the script will "exit 0" on success or any other | ||
- | # value on error. | ||
- | # | ||
- | # In order to enable or disable this script just change the execution | ||
- | # bits. | ||
- | # | ||
- | # By default this script does nothing. | ||
- | |||
- | # Print the IP address | ||
- | _IP=$(hostname -I) || true | ||
- | if [ " | ||
- | printf "My IP address is %s\n" " | ||
- | fi | ||
- | echo 1000000 > / | ||
- | exit 0</ | ||
- | |||
- | === rclocal_wifi.j2 === | ||
- | <file java rclocal_both.j2># | ||
- | # | ||
- | # rc.local | ||
- | # | ||
- | # This script is executed at the end of each multiuser runlevel. | ||
- | # Make sure that the script will "exit 0" on success or any other | ||
- | # value on error. | ||
- | # | ||
- | # In order to enable or disable this script just change the execution | ||
- | # bits. | ||
- | # | ||
- | # By default this script does nothing. | ||
- | |||
- | # Print the IP address | ||
- | _IP=$(hostname -I) || true | ||
- | if [ " | ||
- | printf "My IP address is %s\n" " | ||
- | fi | ||
- | sleep 10; /sbin/brctl addif br-{{ ffmuc_segment }} wlan0 | ||
- | echo 1000000 > / | ||
- | exit 0</ | ||
- | |||
- | ==== Download des auf Debian Buster basierenden Raspbian ==== | ||
- | Nachdem es aktuell((Stand: | ||
- | |||
- | Eine Anleitung zur manuellen Installation findet man auf der **[[https:// | ||
- | |||
- | $ wget https:// | ||
- | |||
- | Bevor wir nun das Archiv entpacken überprüfen wir noch die Integrität der heruntergeladenen Datei. Heirzu berechnen wir erst einmal die **SHA256**-Prüfsumme der Datei **raspbian_lite_latest**. | ||
- | $ sha256sum raspbian_lite_latest | ||
- | |||
- | 12ae6e17bf95b6ba83beca61e7394e7411b45eba7e6a520f434b0748ea7370e8 | ||
- | |||
- | Die Zeichenfolge überprüfen wir nun mit den Angaben auf der Seite: https:// | ||
- | {{ : | ||
- | |||
- | Da sich beide SHA-Werte **__nicht__** unterscheiden können wir das herunter geladene ZIP-Archiv nun entpacken. | ||
- | $ unzip raspbian_lite_latest | ||
- | |||
- | < | ||
- | inflating: 2020-02-13-raspbian-buster-lite.img | ||
- | </ | ||
- | |||
- | ==== Kopieren des Raspbian Images auf die microSD-Karte ==== | ||
- | Nun können wir das Image auf die MicroSD Karte, die wir später in den Raspberry 4B stecken kopieren. Wir werfen also am besten einmal einen Blick in das syslog unseres Arbeitsrechners und erkennen so das Device unserer Speicherkarte. | ||
- | # tail -f / | ||
- | |||
- | < | ||
- | Feb 16 21:47:29 T410 kernel: usb 1-1.2: New USB device found, idVendor=1908, | ||
- | Feb 16 21:47:29 T410 kernel: usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0 | ||
- | Feb 16 21:47:29 T410 kernel: usb-storage 1-1.2:1.0: USB Mass Storage device detected | ||
- | Feb 16 21:47:29 T410 kernel: scsi host4: usb-storage 1-1.2:1.0 | ||
- | Feb 16 21:47:29 T410 mtp-probe[38884]: | ||
- | Feb 16 21:47:29 T410 mtp-probe[38884]: | ||
- | Feb 16 21:47:29 T410 mtp-probe[38887]: | ||
- | Feb 16 21:47:29 T410 mtp-probe[38887]: | ||
- | Feb 16 21:47:30 T410 kernel: scsi 4:0:0:0: Direct-Access | ||
- | Feb 16 21:47:30 T410 kernel: sd 4:0:0:0: Attached scsi generic sg2 type 0 | ||
- | Feb 16 21:47:30 T410 kernel: sd 4:0:0:0: [sdb] 62333952 512-byte logical blocks: (31.9 GB/29.7 GiB) | ||
- | Feb 16 21:47:30 T410 kernel: sd 4:0:0:0: [sdb] Write Protect is off | ||
- | Feb 16 21:47:30 T410 kernel: sd 4:0:0:0: [sdb] No Caching mode page found | ||
- | Feb 16 21:47:30 T410 kernel: sd 4:0:0:0: [sdb] Assuming drive cache: write through | ||
- | Feb 16 21:47:30 T410 kernel: sdb: sdb1 sdb2 < sdb5 > | ||
- | Feb 16 21:47:30 T410 kernel: sd 4:0:0:0: [sdb] Attached SCSI removable disk | ||
- | Feb 16 21:47:31 T410 kernel: EXT4-fs (sdb5): recovery complete | ||
- | Feb 16 21:47:31 T410 kernel: EXT4-fs (sdb5): mounted filesystem with ordered data mode. Opts: (null) | ||
- | Feb 16 21:47:31 T410 kernel: ext4 filesystem being mounted at / | ||
- | Feb 16 21:47:31 T410 journal[1042]: | ||
- | |||
- | In dem gezeigtem Fall handelt es sich also um die Gerätedatei **''/ | ||
- | |||
- | # dd if=~/ | ||
- | |||
- | Da wir später weder Tastatur noch Monitor an unseren Raspberry 4B anstecken wollen, diesen demnach im **headless**-Mode betreiben wollen und werden, legen wir noch eine Datei **''/ | ||
- | # touch / | ||
- | |||
- | Anschließend könne wir nach einem unmounten des Gerätes **''/ | ||
- | |||
- | ==== Ändern des Default-Passwortes und kopieren des SSH-Public-Keys auf den Raspberry 4 ==== | ||
- | <WRAP center round important 80%> | ||
- | Der Benutzername lautet **'' | ||
- | </ | ||
- | |||
- | Wir ändern also das Default-Passwort gleich mal ab und packen auch unseren SSH-Public-key auf den Raspberry 4B. Da wir die IP-Adresse, die unser Raspberry vom DHCP-Server zugewiesen bekommt in unserer SSH-Client-Konfigurationsdatei bereits hinterlegt haben, können wir nun den RaspBerry 4B direkt über den definierten Namen **'' | ||
- | $ ssh -l pi raspberry-ansible -o IdentitiesOnly=yes " | ||
- | | ||
- | |||
- | Alternativ dazu müssten wir den Raspberry 4B über die IP-Adresse ansprechen, die dieser zugewiesen bekommt. In dem folgenden Beispiel wäre das die IP-Adresse: **10.0.10.29**: | ||
- | $ ssh -l pi 10.0.10.29 -o IdentitiesOnly=yes " | ||
- | | ||
- | |||
- | In dem folgenden Konfigurationsbeispiel vergeben wir für den Benutzer **'' | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | < | ||
- | ECDSA key fingerprint is SHA256: | ||
- | Are you sure you want to continue connecting (yes/ | ||
- | Warning: Permanently added ' | ||
- | pi@raspberry-ansible' | ||
- | Current password: raspberry | ||
- | New password: gECzebzn7GYSLvXueECAxeGm7l7 | ||
- | Retype new password: gECzebzn7GYSLvXueECAxeGm7l7 | ||
- | passwd: password updated successfully | ||
- | Changing password for pi. | ||
- | |||
- | / | ||
- | / | ||
- | / | ||
- | pi@raspberry-ansible' | ||
- | |||
- | Number of key(s) added: 1 | ||
- | |||
- | Now try logging into the machine, with: " | ||
- | and check to make sure that only the key(s) you wanted were added. | ||
- | </ | ||
- | |||
- | |||
- | |||
- | |||
- | $ ssh raspberry-ansible | ||
- | |||
- | < | ||
- | <font style=" | ||
- | |||
- | The programs included with the Debian GNU/Linux system are free software; | ||
- | the exact distribution terms for each program are described in the | ||
- | individual files in / | ||
- | |||
- | Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent | ||
- | permitted by applicable law. | ||
- | |||
- | Wi-Fi is currently blocked by rfkill. | ||
- | Use raspi-config to set the country before use. | ||
- | |||
- | <font style=" | ||
- | </ | ||
- | </ | ||
- | |||
- | ==== Starten des Ansible-Playbooks ==== | ||
- | Beim Abarbeiten des ansible-playbook werden zur Konfiguration des Offloaders und dessen Komponenten/ | ||
- | * Batman-Relase ([[https:// | ||
- | * [[https:// | ||
- | * Angaben zur [[https:// | ||
- | * Hostname des Offloaders | ||
- | * Kontakt-Adresse des Node-Betreibers | ||
- | * Geographische Breitengrad des Raspberry Offloaders | ||
- | * Geographische Längengrad des Raspberry Offloaders | ||
- | * Funktionen, die der Raspberry Offloader noch ausführen soll: | ||
- | * Soll der Raspberry Offloader ein WLAN ausstrahlen (SSID leitet sich vom Segment-Namen ab)? | ||
- | * Soll der Raspberry Offloader ein Client-VLAN zur Verfügung stellen, wenn ja wie lautet die VLAN-ID? | ||
- | * Soll der Raspberry Offloader ein Mesh-VLAN zur Verfügung stellen, wenn ja wie lautet die VLAN-ID? | ||
- | * Ist an dem Raspberry ein OLE-Display von [[https:// | ||
- | |||
- | Bei der Ausführung sind seit Version v2 ((Version v2 vom 09.03.2020)) zwei ansible-playbooks enthalten: | ||
- | - **raspi_offloader_menu.yml** \\ Hier werden die benötigten Parameter bei der Ausführung des ansible-playbooks interaktiv abgefragt. Somit ist eine Änderung/ | ||
- | - **raspi_offloader_file.yml** \\ Hier werden die zur Konfiguration benötigten Parameter nicht beim Aufruf des Playbooks abgefragt, sondern im playbook selbst hinterlegt. Das ist im ersten Schritt für den ungeübten Ansible-Nutzer zwar augenscheinlich aufwändiger, | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | |||
- | === Bsp. 1 : raspi_offloader_menu.yml === | ||
- | Am besten besorgen wir uns die entsprechenden Daten vorab und halten diese parat, da diese nach dem Start des ansible-playbooks abgefragt werden. | ||
- | |||
- | Haben wir die Informationen vorrätig, bleibt uns zum Schluss nur noch der Aufruf des Ansible-Scriptes. | ||
- | $ ansible-playbook ~/ | ||
- | |||
- | < | ||
- | <font style=" | ||
- | Was ist die aktuelle BATMAN Version, die hier | ||
- | https:// | ||
- | |||
- | In welchem der Segmente hier soll der Offloader betrieben werden: | ||
- | muc_cty | ||
- | muc_nord | ||
- | muc_ost | ||
- | muc_sued | ||
- | muc_west | ||
- | uml_nord | ||
- | uml_ost | ||
- | uml_sued | ||
- | uml_west | ||
- | gauting | ||
- | freising | ||
- | welt : welt | ||
- | |||
- | Wie lautet der Hostname des Raspberry Offloaders? | ||
- | |||
- | Wie lautet die Kontakt-Adresse des Node-Betreibers? | ||
- | |||
- | Wie lautet der Geographische Breitengrad des Raspberry Offloaders? | ||
- | |||
- | Wie lautet der Geographische Längengrad des Raspberry Offloaders? | ||
- | |||
- | Soll der Raspberry Offloader auch ein WLAN ausstrahlen, | ||
- | |||
- | Soll der Raspberry Offloader ein Client-VLAN zur Verfügung stellen? | ||
- | Wenn ja, wie lautet die VLAN-ID? | ||
- | |||
- | Soll der Raspberry Offloader ein Mesh-VLAN zur Verfügung stellen? | ||
- | Wenn ja, wie lautet die VLAN-ID? | ||
- | |||
- | Ist ein OLE-Display an dem Raspberry Offloader angeschlossen? | ||
- | |||
- | PLAY [raspi_offloader.yml] ************************************************************************************************************* | ||
- | |||
- | TASK [Gathering Facts] ***************************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Hostname ändern] ***************************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Anpassung /etc/hosts] ************************************************************************************************************ | ||
- | <font style=" | ||
- | |||
- | TASK [Beschreibung des User ' | ||
- | <font style=" | ||
- | |||
- | TASK [Service rfkill am Raspberry deaktivieren] **************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Update und Upgrade der APT-Pakete] *********************************************************************************************** | ||
- | <font style=" | ||
- | <font style=" | ||
- | |||
- | TASK [Reboot nach update] ************************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Download des aktuellen BATMAN Archives] ****************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [BATMAN-Archiv entpacken] ********************************************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Installation des Dynamic Kernel Module Support Framework und der Header Files für den Raspberry Pi Linux Kernel] ***************** | ||
- | <font style=" | ||
- | |||
- | TASK [Rebuild BATMAN Kernel Header Dateien] ******************************************************************************************** | ||
- | |||
- | <font style=" | ||
- | <font style=" | ||
- | |||
- | TASK [Anlegen der dkms.conf für Dynamic Kernel Module Support] ************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Dynamic Kernel Module Support hinzufügen] **************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Dynamic Kernel Module Support bauen] ********************************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Dynamic Kernel Module Support installieren] ************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Laden des Kernelmodul beim Booten veranlassen] *********************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Laden des BATMAN Moduls] ********************************************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Laden des dummy Moduls] ********************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Installation der bridge-utils] ************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Aktivierung von BATMAN_V] ******************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Konfiguration des Interfaces] **************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Installation von FASTD] ********************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Verzeichnis für fastd- Konfigurationsdatei anlegen] ****************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Schlüssel für fastd erstellen] *************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [FASTD Secret Key aus / | ||
- | <font style=" | ||
- | |||
- | TASK [FASTD Socket ermitteln] ********************************************************************************************************** | ||
- | <font style=" | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | <font style=" | ||
- | |||
- | TASK [Erstellen der fastd Konfigurationsdatei] ***************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Service fastd beim Booten starten] *********************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Installation der Pakete git und python3-netifaces] ******************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Repo ext-respondd klonen] ******************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Systemd Startdatei für respondd kopieren] **************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Erstellen der resondd Konfigurationsdatei alias.json] **************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Erstellen der resondd Konfigurationsdatei config.json] *************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Service ext-respondd beim Booten starten] **************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Paket hostapd für WLAN installieren] ********************************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [hostapd konfigurieren] *********************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [hostapd Konfigurationsdatei anlegen] ********************************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [wlan0 in Bridge packen] ********************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Service hostapd beim Booten und jetzt starten und das Laden der Unit Datei vom Service hostapd ermöglichen] ********************** | ||
- | <font style=" | ||
- | |||
- | TASK [Konfiguration des Client-VLAN ohne Mesh-Netz] ************************************************************************************ | ||
- | <font style=" | ||
- | |||
- | TASK [vxlan_id für ausgewähltes Segment ermitteln] ************************************************************************************* | ||
- | <font style=" | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | skipping: [raspi_offloader_menu] => (item={' | ||
- | <font style=" | ||
- | |||
- | TASK [Konfiguration des Mesh-VLAN ohne Client-VLAN] ************************************************************************************ | ||
- | <font style=" | ||
- | |||
- | TASK [Konfiguration von Mesh- und Client-VLAN] ***************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Konfiguration des bevorzugte Meshingpoint in BATMAN_V ohne Wifi-Nutzung] ********************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Konfiguration des bevorzugte Meshingpoint in BATMAN_V mit Wifi-Nutzung] ********************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Für OLED-Konfiguration i2c-bcm2708 in / | ||
- | <font style=" | ||
- | |||
- | TASK [Für OLED-Konfiguration i2c-dev in / | ||
- | <font style=" | ||
- | |||
- | TASK [Installation der für das OLED benötigten Pakete] ********************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Laden des Kernelmodul i2c_arm beim Booten veranlassen] *************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Reboot nach Konfigurationsänderung] ********************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Repo Adafruit_Python_SSD1306 klonen] ********************************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Für OLED-Konfiguration Adafruit_Python_SSD1306 installieren] ********************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Script zur Anzeige klonen] ******************************************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Script zur Bandbreitenauslastung anpassen] *************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Startscript für das OLED anlegen] ************************************************************************************************ | ||
- | <font style=" | ||
- | |||
- | TASK [Service oled-bandwidth beim Booten starten] ************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Reboot nach Abschluss der Konfiguration unseres Offloaders] ********************************************************************** | ||
- | <font style=" | ||
- | |||
- | PLAY RECAP ***************************************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | </ | ||
- | </ | ||
- | |||
- | Nach dem letzten Reboot, der automatisch ausgeführt wird, finden wir unseren Offloader auf der Freifunkkarte: | ||
- | |||
- | {{ : | ||
- | |||
- | === Bsp. 2 : raspi_offloader_file.yml === | ||
- | Falls noch nicht geschehen, ist es vor dem Aufruf des ansible-Playbooks notwendig, die Konfigurationsparameter in den Zeilen **'' | ||
- | $ vim raspi_offloader_file.yml +34 | ||
- | |||
- | < | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | |||
- | Haben wir die Informationen in dem Ansible-Playbook hinterlegt, können wir wie geohnt das Ansible-Scriptes ausführen. | ||
- | $ ansible-playbook ~/ | ||
- | |||
- | < | ||
- | <font style=" | ||
- | PLAY [raspi_offloader.yml] ************************************************************************************************************* | ||
- | |||
- | TASK [Gathering Facts] ***************************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Hostname ändern] ***************************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Anpassung /etc/hosts] ************************************************************************************************************ | ||
- | <font style=" | ||
- | |||
- | TASK [Beschreibung des User ' | ||
- | <font style=" | ||
- | |||
- | TASK [Service rfkill am Raspberry deaktivieren] **************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Update und Upgrade der APT-Pakete] *********************************************************************************************** | ||
- | <font style=" | ||
- | <font style=" | ||
- | |||
- | TASK [Reboot nach update] ************************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Download des aktuellen BATMAN Archives] ****************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [BATMAN-Archiv entpacken] ********************************************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Installation des Dynamic Kernel Module Support Framework und der Header Files für den Raspberry Pi Linux Kernel] ***************** | ||
- | <font style=" | ||
- | |||
- | TASK [Rebuild BATMAN Kernel Header Dateien] ******************************************************************************************** | ||
- | |||
- | <font style=" | ||
- | <font style=" | ||
- | |||
- | TASK [Anlegen der dkms.conf für Dynamic Kernel Module Support] ************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Dynamic Kernel Module Support hinzufügen] **************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Dynamic Kernel Module Support bauen] ********************************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Dynamic Kernel Module Support installieren] ************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Laden des Kernelmodul beim Booten veranlassen] *********************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Laden des BATMAN Moduls] ********************************************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Laden des dummy Moduls] ********************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Installation der bridge-utils] ************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Aktivierung von BATMAN_V] ******************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Konfiguration des Interfaces] **************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Installation von FASTD] ********************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Verzeichnis für fastd- Konfigurationsdatei anlegen] ****************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Schlüssel für fastd erstellen] *************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [FASTD Secret Key aus / | ||
- | <font style=" | ||
- | |||
- | TASK [FASTD Socket ermitteln] ********************************************************************************************************** | ||
- | <font style=" | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | <font style=" | ||
- | |||
- | TASK [Erstellen der fastd Konfigurationsdatei] ***************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Service fastd beim Booten starten] *********************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Installation der Pakete git und python3-netifaces] ******************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Repo ext-respondd klonen] ******************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Systemd Startdatei für respondd kopieren] **************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Erstellen der resondd Konfigurationsdatei alias.json] **************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Erstellen der resondd Konfigurationsdatei config.json] *************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Service ext-respondd beim Booten starten] **************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Paket hostapd für WLAN installieren] ********************************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [hostapd konfigurieren] *********************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [hostapd Konfigurationsdatei anlegen] ********************************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [wlan0 in Bridge packen] ********************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Service hostapd beim Booten und jetzt starten und das Laden der Unit Datei vom Service hostapd ermöglichen] ********************** | ||
- | <font style=" | ||
- | |||
- | TASK [Konfiguration des Client-VLAN ohne Mesh-Netz] ************************************************************************************ | ||
- | <font style=" | ||
- | |||
- | TASK [vxlan_id für ausgewähltes Segment ermitteln] ************************************************************************************* | ||
- | <font style=" | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | skipping: [raspi_offloader_file] => (item={' | ||
- | <font style=" | ||
- | |||
- | TASK [Konfiguration des Mesh-VLAN ohne Client-VLAN] ************************************************************************************ | ||
- | <font style=" | ||
- | |||
- | TASK [Konfiguration von Mesh- und Client-VLAN] ***************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Konfiguration des bevorzugte Meshingpoint in BATMAN_V ohne Wifi-Nutzung] ********************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Konfiguration des bevorzugte Meshingpoint in BATMAN_V mit Wifi-Nutzung] ********************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Für OLED-Konfiguration i2c-bcm2708 in / | ||
- | <font style=" | ||
- | |||
- | TASK [Für OLED-Konfiguration i2c-dev in / | ||
- | <font style=" | ||
- | |||
- | TASK [Installation der für das OLED benötigten Pakete] ********************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Laden des Kernelmodul i2c_arm beim Booten veranlassen] *************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Reboot nach Konfigurationsänderung] ********************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Repo Adafruit_Python_SSD1306 klonen] ********************************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Für OLED-Konfiguration Adafruit_Python_SSD1306 installieren] ********************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Script zur Anzeige klonen] ******************************************************************************************************* | ||
- | <font style=" | ||
- | |||
- | TASK [Script zur Bandbreitenauslastung anpassen] *************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Startscript für das OLED anlegen] ************************************************************************************************ | ||
- | <font style=" | ||
- | |||
- | TASK [Service oled-bandwidth beim Booten starten] ************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | TASK [Reboot nach Abschluss der Konfiguration unseres Offloaders] ********************************************************************** | ||
- | <font style=" | ||
- | |||
- | PLAY RECAP ***************************************************************************************************************************** | ||
- | <font style=" | ||
- | |||
- | </ | ||
- | </ | ||
- | |||
- | Auch hier wird nach Beendigung des Ansible-Laufs der Knoten auf der Freifunkkarte an der gewünschten Stelle auftauchen. | ||
- | |||
- | |||
- | ====== Links ====== | ||
- | * ** [[centos: | ||
- | * ** [[centos: | ||
- | * ** [[centos: | ||
- | * **[[wiki: | ||
- | * **[[http:// |