Map

Aus Freifunk Köln, Bonn und Umgebung
Zur Navigation springen Zur Suche springen

Voraussetzungen

Benötigte Software

1) ----

Du benötigst ausserdem:

  • eine private IPv4/IPv6 Adresse

Diese kannst du unter dem Artikel IP Netze selbst zuteilen, oder nachlesen, welches deine sind, wenn es jemand anderes dir schon zuteilte.

Server ins Freifunk Netz einbinden

Grundlage: Debian 7 (Wheezy) oder Debian 8 (Jessy)

Edit /etc/apt/sources.list

nano  /etc/apt/sources.list 

and add this:

deb http://repo.universe-factory.net/debian/ sid main
deb http://http.debian.net/debian wheezy-backports main

Add Keys:

gpg --keyserver pgpkeys.mit.edu --recv-key  16EF3F64CB201D9C
gpg -a --export 16EF3F64CB201D9C | apt-key add -

Update and install:

apt-get update
apt-get install git make gcc build-essential linux-headers-$(uname -r) pkg-config libgps-dev libnl-3-dev libjansson-dev fastd

Install Batman, batctl and alfred

mkdir /opt/freifunk
cd $_

git clone git://git.open-mesh.org/batman-adv.git
cd batman-adv
git checkout v2015.1
make
make install

cd ../

git clone http://git.open-mesh.org/batctl.git
cd batctl
git checkout v2015.1
make
make install

cd ../

git clone http://git.open-mesh.org/alfred.git
cd alfred
git checkout v2014.4.0
make 
make install

Configuration

Fastd

Only on Virtual Servers:

rm /dev/random
ln -s /dev/urandom /dev/random

Generate fastd Keys

fastd --generate-key

Save your fastd Keys anywhere

Add Directories

mkdir /etc/fastd/tro
mkdir /etc/fastd/servers
mkdir /etc/fastd/servers/tro

Add your Secret to /etc/fastd/tro/secret.conf:

# /etc/fastd/tro/secret.conf
secret "SECRETKEY";

fastd Config /etc/fastd/tro/fastd.conf:

First, random mac address has to be calculated on the linux console via:

echo $RANDOM|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/')

The 02 for the first octet just sets the "locally assigned" bit, which makes it obvious that it's not a vendor-provided MAC address, and guarantees that you won't collide with a real NIC's MAC address.

# /etc/fastd/tro/fastd.conf
bind 0.0.0.0:53842;
# bind [*IPv6IP*]:53842; #Only if available 
include "secret.conf";
include peers from "/etc/fastd/servers/tro";
interface "fastd-tro";
log level info;
method "aes128-gcm";
method "salsa2012+umac";
method "salsa2012+gmac";
method "xsalsa20-poly1305";
mtu 1312;

on up "
 modprobe batman-adv
 ip link set address xx:xx:xx:xx:xx dev fastd-tro #Change MAC to Random MAC Address
 ip link set up dev fastd-tro
 batctl -m bat0 if add fastd-tro
 batctl -m bat0 it 5000
 batctl -m bat0 bl enable
 batctl -m bat0 gw client
 ip link set up dev bat0
 ip addr add 10.188.1.XXX/16 broadcast 10.188.255.255 dev bat0 #Change IP to a available Address in the mesh network
 ip -6 addr add fda0:747e:ab29:7405::XXX/64 dev bat0 #Change IP to a available Address in the mesh network
 ";

Add the fastd servers:

cd /opt/freifunk
git clone https://github.com/Freifunk-Troisdorf/fastd-server.git
cp fastd-server/* /etc/fastd/servers/tro/.

HopGlass-Server (Backend) aufsetzen

ArchLinux or Debian-based systems using systemd (preferred)

i.e. Debian Jessie or newer, Ubuntu 15.04 or newer

1) Run # wget https://raw.githubusercontent.com/plumpudding/hopglass-server/v0.1/scripts/bootstrap.sh; bash bootstrap.sh; rm bootstrap.sh

2) Review and edit the default configuration located at /etc/hopglass-server/default/config.json.

3) Start the HopGlass Server: # systemctl start hopglass-server@default

4) (Optional) Automatically start the HopGlass Server at boot: # systemctl enable hopglass-server@default

HopGlass Viewer (Frontend)

Dependencies npm

  1. bower
  2. grunt-cli
  3. Sass (>= 3.2)

Installing dependencies

Install npm package-manager. On Debian-like systems run:

sudo apt-get install npm

On Mac you have to install only npm via brew and sass

1) /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2) brew install node
3) sudo gem install sass

Execute these commands on your server as a normal user to prepare the dependencies:

1) git clone https://github.com/plumpudding/hopglass
2) cd hopglass
3) npm install
4) npm install grunt-cli

Building

Just run the following command from the hopglass directory:

node_modules/.bin/grunt

This will generate build/ containing all required files.

Configure

Copy config.json.example to build/config.json and change it to match your community.

Install Webserver

apt-get install apache2

Delete default web files from html folder

rm -r /var/www/html/*

Move compiled map files to the Apache html folder

cp -r build/ /var/www/html/