c3d2-wiki/Wireless_mesh_network.mw

120 lines
3.6 KiB
Plaintext

= [[w:de:B.A.T.M.A.N.|B.A.T.M.A.N.]] =
; Mesh-Geräte im HQ
Wir haben ein gemeinsames Ethernet in dem alle Geräte sind. Das bildet eine sogenannte Broadcast-Domäne, weshalb sich alle User und Server direkt finden können, bspw. durch Broadcast.
Für Mesh-Experimente wird mit Batman-adv genau jenes Layer2 zusammenbridged. In der Praxis bedeutet das dass die Mesh-Geräte bei Trennung vom restlichen Kabelethernet weiterhin Routing unser Netz finden. Achtung: die Wireless-Bandbreite halbiert sich für Traffic über diese.
Hardware ist Konkret WR841-nd V8.[1-2]{1}
== [[OpenWRT]] bauen ==
[[w:de:OpenWRT | OpenWRT]] kommt by default nicht mit [https://www.open-mesh.org/projects/batman-adv batman-adv] (B.A.T.M.A.N.). Also folge den [https://wiki.openwrt.org/doc/howto/build Vorbereitungsanweisungen]. Du musst auch Package-Feeds installieren.
Wähle Zielplattform, lade Default-Configs:
: <source lang=bash>make menuconfig</source>
: <source lang=bash>make defconfig</source>
: <source lang=bash>make menuconfig</source>
Nun konfiguriere folgende Pakete (''Y'' damit sie fest im Image sind):
* ''kmov-batman-adv'', ''batctl''
* ''ip-full'', ''tcpdump''
Bauen je nach Kernzahl:
<source lang=bash>make -j5 V=s</source>.
Nun gibts die Images bspw. unter ''bin/ar71xx/''. Übertrage das richtige mit ''-sysupgrade.bin'' nach /tmp auf dem Zielgerät und flashe es mit <source lang=bash>sysupgrade</source>.
== Konfiguration ==
=== /etc/config/batman-adv ===
<pre>config 'mesh' 'bat0'
# Denn es wird von mehreren Geräten mit einem Ethernet zusammenbridged
option 'bridge_loop_avoidance' 'enabled'
# Sonst kein IPv6, http://www.open-mesh.org/projects/batman-adv/wiki/DistributedARPTable-technical
option 'distributed_arp_table' 'disabled'</pre>
=== /etc/config/wireless ===
<pre>
config wifi-device radio0
option type mac80211
option channel 11
option hwmode 11g
option htmode HT20
# Geblubber von `wifi detect`:
option path 'platform/ar934x_wmac'
# Offener AP
config wifi-iface
option device radio0
option network lan
option mode ap
option ssid C3D2.meshed
option encryption none
# Adhoc-Interface
config wifi-iface
option device radio0
option ifname mesh0
option network mesh
option mode adhoc
option ssid batman-adv
option bssid '02:CA:FE:CA:CA:40'
option mcast_rate 18000
option encryption none</pre>
=== /etc/config/network ===
<pre>
# Das ist das Adhoc-Interface direkt (wlan0, aus dem zweiten wifi-iface oben)
# Pakete von lan aus bat0 bekommen noch etwas Overhead.
config interface 'mesh'
option mtu 1532
option proto batadv
option mesh bat0
# Ethernet-Ports (eth1) und das AP-Interface (wlan0-1, aus dem ersten wifi-iface) werden mit bat0 zusammenbridged
config interface 'lan'
option ifname 'eth1 bat0'
option force_link '1'
option type 'bridge'
option proto 'static'
# Schau ins [[DNS]]
option ipaddr '172.22.99.18'
option netmask '255.255.255.0'
option gateway '172.22.99.4'</pre>
== SpaceAPI-Integration ==
Installiere opkg-Pakete ''libnetsnmp'' und ''snmpd''. Mache startbar mit:
: <source lang=bash>cd /etc/rc.d</source>
: <source lang=bash>ln -s ../init.d/snmpd S99snmpd</source>
=== /etc/config/snmpd ===
<pre>
config exec
option name wlan0-stations
option prog /bin/sh
option args '-c "exit `iw dev wlan0-1 station dump|egrep -e ^Station\ |wc -l`"'
</pre>
=== Eintragen in Poller ===
https://github.com/astro/spacemsg/tree/master/spaceapi
== Siehe auch ==
* [[w:de:wireless mesh network]]
== Weblinks ==
* [https://www.open-mesh.org/ Open Mesh]
[[category:Netzwerk]]
[[category:Projekt]]
[[category:HQ]]