Benutzer-Werkzeuge

Webseiten-Werkzeuge


hswiki:raum:freifunk:batman-auf-debian

B.A.T.M.A.N. advanced

Um das Freifunknetzwerk nicht nur zu nutzen, sondern auch zu erweitern, lernen wir ein Teil davon zu werden. Debian 7.0 kommt bereits mit dem notwendigen batman-adv Kernelmodul. Weiterhin sollten die Pakete batctl, ip, nmap und curl vorhanden sein.

# Kernelmodul laden
modprobe batman-adv


# wlan device in ad-hoc mode schalten
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 essid batman.jena.freifunk.net
batctl if add wlan0

# eine weile warten und andere Teilnehmer des Meshnetzwerks anzeigen
batctl o

# optional kann man andere hosts im batman-adv layer pingen
batctl p fa:1a:67:cb:25:12

# um ins internet zu kommen muss man einen default gateway finden
# alle konten sind von der form 10.17.*.1
ifconfig wlan0 0.0.0.0
ifconfig bat0 10.17.78.1  # besser auf address kollision pruefen!

# finde den schnellsten node
nmap -sP '10.17.*.1'
# nutze den schnellsten als gateway
ip route add default via 10.17.11.1 dev bat0
# akzeptiere den splash screen
curl -d target_url=foo 10.17.11.1/cgi-bin/splash-click.html

Die einzelnen Batman Knoten kann man ueber ihre link-local IPv6 Addresse erreichen:

ssh fe80::fa1a:67ff:fecb:3162%bat0

In order to check the underlying mesh-wide distributed database (hbbp source repository), add the following Lua code to /usr/share/wireshark/init.lua. If you run wireshark as root make sure to comment out the appropriate lines in this file to allow Lua to run.

trivial_proto = Proto("hbbp","Home Brew Broadcast Protocol")
-- create a function to dissect it
function trivial_proto.dissector(buffer,pinfo,tree)
    pinfo.cols.protocol = "HBBP"
    local subtree = tree:add(trivial_proto,buffer(),"HBBP Data")
    
    local i = 0
    local b = buffer():bytes()
    
    while (i<b:len() and b:get_index(i)~=0) do
      i = i + 1
    end
    if i==0 then
       return (nil)
    end
    subtree:add(buffer(0,i),"Task: " .. buffer(0,i):string())   
    if b:get_index(i) == 0 then
       subtree:add(buffer(i+1),"Payload: [Length " .. buffer:len()-i .. "]")   
    end
end
-- load the udp.port table
udp_table = DissectorTable.get("udp.port")
-- register our protocol to handle udp port 4950
udp_table:add(4950,trivial_proto)

Here is screenshot of the dissector in action:

hswiki/raum/freifunk/batman-auf-debian.txt · Zuletzt geändert: 2020/08/01 21:11 von 127.0.0.1