c3d2-wiki/Freifunk_Dresden.mw

244 lines
8.3 KiB
Plaintext
Raw Normal View History

[[Datei:1406FreifunkDresden-Logo.svg|rechts]]
[[Freifunk Dresden]] ist das Projekt in Dresden zu [[wikipedia:de:Freifunk]].
== Entstehung ==
[[Freifunk Dresden]] wurde ursprünglich unter dem Namen ''ddmesh'' von [[Stephan Enderlein]] gestartet und existiert bereits seit einigen Jahren.
Seit 2014 sind stabil mehr als 50 Knoten in Dresden erreichbar und auch Geschäfte in Dresden nehmen die Vorteile von Freifunk für sich und ihre Kunden wahr.
== Original-Firmware ==
Die Firmware basiert auf [[w:de:OpenWrt|OpenWrt]] mit BMX (Vorläufer von batman-adv) und einer custom Weboberfläche.
Nutzung der wenig dokumentierten Original-Firmware hat folgende Vorteile:
* Konsistente Konfiguration mit fast allen anderen Teilnehmern
* Anschluß ans Backbone-VPN (vtun)
* Offenes WLAN, welches über das Backbone ins Internet kommt
* Webserver der die Knotenmetadaten ausliefert
=== Links ===
* [http://download.ddmesh.de/firmware/ Firmware]
** [http://download.ddmesh.de/firmware/testing_2.1.2/ar71xx/changelog.txt Changelog Testing-Version 2.1.2]
* [http://bt.freifunk-dresden.de/projects/freifunk-firmware Projekt ''Freifunk Firmware'' beim Bugtracker (Redime) von] [[Freifunk Dresden]]
== WLAN-Einstellungen ==
Wird [[Intern:Freifunk_Dresden|derzeit Intern]] beschrieben.
== Adressvergabe ==
==== IP-Adressberechnungs mit Shell- und Lua Script ====
Die Scripte deren Algorithmus formalisiert werden soll:
'''usr/bin/ddmesh-ipcalc.sh'''
<pre>
#!/bin/sh
if [ "$1" = "" ]
then
echo ""
echo "ddmesh-ipcalc.sh (lua) Stephan Enderlein (c) 2013 V1.7"
echo ""
echo "Calculates all the addresses for the ddmesh freifunk node"
echo "usage: ddmesh-ipcalc.sh [-n node] | [ip]"
echo ""
exit 1
fi
if [ "$1" = "-n" ]; then
node=`echo "$2" | sed 's/[\$\`\(\)]/0/g'`
lua -lddmesh -e "ipcalc.print($node)"
else
ip=`echo "$1" | sed 's/[\$\`\(\)]/0/g'`
lua -lddmesh -e "print(iplookup(\"$ip\"))"
fi
</pre>
'''usr/lib/lua/ddmesh.lua'''
<pre>
--[[----------------------------------------------------------------------------------------
ddmesh.lua
library for different freifunk functions
version: 6
-------------------------------------------------------------------------------------------]]
----------------- ipcalc ---------------
ipcalc={}
ipcalc.data={}
ipcalc.data.max=2048
function split(str, delim, maxNb)
-- Eliminate bad cases...
if string.find(str, delim) == nil then
return { str }
end
if maxNb == nil or maxNb < 1 then
maxNb = 0 -- No limit
end
local result = {}
local pat = "(.-)" .. delim .. "()"
local nb = 0
local lastPos
for part, pos in string.gfind(str, pat) do
nb = nb + 1
result[nb] = part
lastPos = pos
if nb == maxNb then break end
end
-- Handle the last field
if nb ~= maxNb then
result[nb + 1] = string.sub(str, lastPos)
end
return result
end
function ipcalc.rCalcIp(ip)
if ip==nil or ip=="" then return -1 end
a = split(ip, "[.]")
if #a ~= 4 then return -1 end
if a[1]==nil or a[1]=="" or tonumber(a[1]) ~= 10 then return -1 end
if a[2]==nil or a[2]=="" or tonumber(a[2]) ~= 200 and tonumber(a[2]) ~= 201 then return -1 end
if a[3]==nil or a[3]=="" or tonumber(a[3]) < 0 or tonumber(a[3]) > 255 then return -1 end
if a[4]==nil or a[4]=="" or tonumber(a[4]) < 0 or tonumber(a[4]) > 255 then return -1 end
middle = a[3]
if a[2]=="201" then middle = middle + 256 end
minor = math.floor(a[4]/64) --x>>6
node = middle*4+minor --x<<2
if node < 0 or node > ipcalc.data.max then return -1 end
return node
end
function ipcalc.calc(node)
if node==nil or node=="" then return -1 end
node=tonumber(node)
if node==nil or node=="" then return -1 end
if node < 0 or node > ipcalc.data.max then return -1 end
local domain = "freifunk-dresden.de"
local major = node >= 1024 and 201 or 200 --a[2]
local middle = node >= 1024 and math.floor((node-1024) / 4) or math.floor(node / 4) --a[3]
local minor = (node % 4) * 64
local meshnet = "10"
local nodeip = meshnet .. "." .. major .. "." .. middle .. "." .. minor + 1
local meshnetmask = "255.0.0.0"
local meshpre = 15
local meshbroadcast = "10.255.255.255"
local meshnetwork = "10.200.0.0"
local dhcpstart = meshnet .. "." .. major .. "." .. middle .. "." .. minor + 2
local dhcpend = meshnet .. "." .. major .. "." .. middle .. "." .. minor + 63
local dhcpoffset = 1 --used by config/dhcp
local dhcplimit = 62 --used by config/dhcp
local dhcprangepre = 26
local dhcprangemask = "255.255.255.192"
local dhcpnetmask = "255.255.255.255"
local dhcpbroadcast = "10.255.255.255" -- needed, else dnsmasq will not start
local dhcpnetwork = meshnet .. "." .. major .. "." .. middle .. "." .. minor
local hna = meshnet .. "." .. major .. "." .. middle .. "." .. minor .. "/" .. dhcprangepre
local mesh6pre = "48"
local mesh6net = "fd11:11ae:7466::"
-- client range
local mesh6nodenet= "fd11:11ae:7466:" .. string.format("%x", node) .. "::"
local mesh6ip = mesh6nodenet .. "1"
local mesh6nodepre= "64"
ipcalc.data.node = node
ipcalc.data.domain = domain
ipcalc.data.hostname = "r" .. node
ipcalc.data.ip = nodeip
ipcalc.data.network = meshnetwork
ipcalc.data.netpre = meshpre
ipcalc.data.netmask = meshnetmask
ipcalc.data.broadcast = meshbroadcast
ipcalc.data.dhcpstart = dhcpstart
ipcalc.data.dhcpend = dhcpend
ipcalc.data.dhcpoffset = dhcpoffset
ipcalc.data.dhcplimit = dhcplimit
ipcalc.data.dhcprangepre = dhcprangepre
ipcalc.data.dhcprangemask = dhcprangemask
ipcalc.data.dhcpnetwork = dhcpnetwork
ipcalc.data.dhcpbroadcast = dhcpbroadcast
ipcalc.data.dhcpnetmask = dhcpnetmask
ipcalc.data.clienthna = hna
ipcalc.data.mesh6ip = mesh6ip
ipcalc.data.mesh6net = mesh6net
ipcalc.data.mesh6pre = mesh6pre
ipcalc.data.mesh6nodenet = mesh6nodenet
ipcalc.data.mesh6nodepre = mesh6nodepre
end
function ipcalc.print(node)
if node==nil or node=="" then print("ERROR"); return -1 end
node=tonumber(node)
if node==nil then print("ERROR"); return -1 end
if node < 0 or node > ipcalc.data.max then return -1 end
ipcalc.calc(node)
for k,v in pairs(ipcalc.data)
do
print("export _ddmesh_"..k.."="..v)
end
end
function iplookup(ip)
if ip==nil then return -1 end
n=ipcalc.rCalcIp(ip)
if n == -1 then return -1 end
ipcalc.calc(n)
return ipcalc.data.hostname
end
function lookup(node)
if node==nil then return -1 end
if string.sub(node,1,1) == "r" then
n=tonumber(string.sub(node,2))
else
n=tonumber(node)
end
if n==nil then return -1 end
if n < 0 or n > ipcalc.data.max then return -1 end
ipcalc.calc(n)
return ipcalc.data.ip
end
</pre>
== Metadaten ==
=== Freifunk-API ===
Es existiert eine Inter-Community-API analog zur SpaceAPI. Beispiel: [http://cholin.spline.de/freifunk/api-viewer/ Freifunk API Viewer]
[https://github.com/freifunk/directory.api.freifunk.net/blob/master/directory.json Directory.json], [http://info.ddmesh.de/info/freifunk.json Dresden]
=== Knotenmetadaten ===
Jeder Knoten bietet ein JSON-Dokument unter http://10.200.../sysinfo-json.cgi an. Es enthält Versionsstände, Geokoordinaten, Kontaktinfo, Auslastung und alle Routen.
== Weblinks ==
* [https://www.freifunk-dresden.de/ <code>www.freifunk-dresden.de</code>, Homepage von] [[Freifunk Dresden]]
** [https://dresden.freifunk.net/ <code>dresden.freifunk.net</code>]
** [http://bt.freifunk-dresden.de/ Bugtracker von] [[Freifunk Dresden]]
* auf den Datenspuren:
** [[Datenspuren 2013]]: [https://datenspuren.de/2013/fahrplan/events/5175.html Vortrag ''ddmesh''] (by [[user:W01f|vv01f]]), [http://ftp.c3d2.de/datenspuren/2013/5175_ddmesh_hq.mp4 Video]
** [[Datenspuren 2014]]: [http://datenspuren.de/2014/fahrplan.html#13k Vortrag ''Sachstand Freifunk Dresden''] (by Emploi)
* [http://www.ddmesh.de/hotspots.html Hotspot-Liste]
* [https://drive.google.com/?ddrp=1#folders/0B1LY99qDqRVPdTBNT2JEMlRkRzQ Flyer / Sticker / Kollaboration für Werbemittel]
[[Kategorie:Projekt]]
[[Kategorie:WLAN]]
[[Kategorie:freier Netzzugang]]
[[Kategorie:Dresden]]
[[Kategorie:OpenWrt]]