Map: Unterschied zwischen den Versionen

Aus Freifunk Köln, Bonn und Umgebung
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „{{TOCright}} Kategorie:Infrastruktur == Voraussetzungen == https://en.wikipedia.org/wiki/Supernode_(networking) wikipedia-article Benötigte Soft…“)
 
(Änderung 42605 von JeffBurge6 (Diskussion) rückgängig gemacht.)
Markierung: Rückgängigmachung
 
(41 dazwischenliegende Versionen von 4 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
[[Kategorie:Archiv]]
{{:Archiv-Hinweis}}
{{TOCright}}
{{TOCright}}
[[Kategorie:Infrastruktur]]
[[Kategorie:Infrastruktur]]


== Voraussetzungen ==
== Voraussetzungen ==
[[https://en.wikipedia.org/wiki/Supernode_%28networking%29 wikipedia-article]]


Benötigte Software
* eine private IPv4/IPv6 Adresse


1) [[https://projects.universe-factory.net/projects/fastd fastd]] Mesh-vpn
Diese kannst du unter dem Artikel IP Netze selbst zuteilen, oder nachlesen, welches deine sind, wenn es jemand anderes dir schon zuteilte.
 
2) [[https://bmx6.net/projects/bmx6 bmx6]] BackboneMeshProtokoll
 
3) [[http://www.open-mesh.org/projects/open-mesh/wiki batman-adv]] ClientMeshProtokoll
 
4) [[http://www.tinc-vpn.org/ tinc]] Mesh-vpn


5) OS: debian jessie(or whatever you like)
= Server ins Freifunk Netz einbinden =


Du benötigst ausserdem: <br />
Grundlage: Debian 7 (Wheezy) oder Debian 8 (Jessy)


* eine private IPv4/IPv6 Adresse und ein Subnetz für die Clients
Edit /etc/apt/sources.list
* eine IPv4/IPv6 Adresse für das Backbone-Netz


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


(nur bei öffentlichen Supernodes)
and add this:
== Vorbereitungen ==
In der /etc/sysctl.conf muss folgendes mit einem Editor hinzugefügt werden:
<pre>
net.ipv4.ip_forward=1
net.ipv4.ip_no_pmtu_disc=1
net.ipv4.route.flush=1
net.ipv6.conf.all.forwarding=1
net.ipv6.conf.all.autoconf=0
net.ipv6.conf.all.accept_ra=0
</pre>


Danach die /etc/sysctl.conf neu einlesen:
deb http://repo.universe-factory.net/debian/ sid main
<pre>
sysctl -p
</pre>


Für Batman-adv und fastd-Pakete in /etc/apt/apt/sources.list hinzufügen, z.B. so:
Add Keys:
<pre>
echo "deb http://repo.universe-factory.net/debian/ sid main" >>/etc/apt/sources.list
</pre>
 
GPG-Key importieren:
<pre>
  gpg --keyserver pgpkeys.mit.edu --recv-key  16EF3F64CB201D9C
  gpg --keyserver pgpkeys.mit.edu --recv-key  16EF3F64CB201D9C
  gpg -a --export 16EF3F64CB201D9C | apt-key add -
  gpg -a --export 16EF3F64CB201D9C | apt-key add -
apt-get update
</pre>


== Batman-adv (compat14 (Hood Bonn))==
Install required Software:
=== Installation ===
Dies sollte auf debian wheezy batman-adv 2013.4.0 installieren.
<pre>
apt-get install batman-adv-dkms
echo "batman-adv" >> /etc/modules
</pre>


==== debian jessie ====
batman 14 aus folgender quelle installieren:
<pre>
http://repo.universe-factory.net/debian/ sid main
</pre>
dann dkms die richtige version beibringen:
<pre>
dkms remove batman-adv/2013.4.0 --all
dkms --force install batman-adv/2013.4.0
</pre>
und mit apt-pinning die richtige version für batctl erzwingen, in /etc/apt/preferences.d/batctl.pref:
<pre>
Package: batctl
Pin: origin repo.universe-factory.net
Pin-Priority: 1000
</pre>
und apt-get install batctl
== Batman-adv (compat15)==
=== Installation ===
Update and install:
  apt-get update
  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
  apt-get install apt-transport-https git make gcc build-essential linux-headers-$(uname -r) pkg-config libgps-dev libnl-3-dev libjansson-dev fastd nodejs


Install Batman, batctl and alfred
Install Batman, batctl and alfred
  mkdir /opt/freifunk
  mkdir /opt/freifunk
  cd $_
  cd $_
   
   
  git clone git://git.open-mesh.org/batman-adv.git
  git clone https://git.open-mesh.org/batman-adv.git
  cd batman-adv
  cd batman-adv
  git checkout v2015.1
  git checkout v2015.1
Zeile 98: Zeile 44:
  cd ../
  cd ../
   
   
  git clone http://git.open-mesh.org/batctl.git
  git clone https://git.open-mesh.org/batctl.git
  cd batctl
  cd batctl
  git checkout v2015.1
  git checkout v2015.1
Zeile 106: Zeile 52:
  cd ../
  cd ../
   
   
  git clone http://git.open-mesh.org/alfred.git
  git clone https://git.open-mesh.org/alfred.git
  cd alfred
  cd alfred
  git checkout v2014.4.0
  git checkout v2014.4.0
Zeile 112: Zeile 58:
  make install
  make install


== fastd ==
== Configuration ==
=== Installation ===
 
<pre>
apt-get install fastd curl
</pre>
 
=== Konfiguration ===
==== fastd.conf ====
"[YOUR SECRET KEY HERE]" Sollte dabei durch den fastd-secret-key ersetzt werden (erfragen)
<pre>
mkdir /etc/fastd/mesh-vpn;
cat > /etc/fastd/mesh-vpn/fastd.conf << EOF
# Log warnings and errors to stderr
#log level warn;
log level error;
 
# Log everything to a log file
#log to "/var/log/fastd-mesh-vpn.log" level debug;
log to "/var/log/fastd-mesh-vpn.log" level warn;
 
# Set the interface name
interface "mesh-vpn";
 
# Support xsalsa20 and aes128 encryption methods, prefer xsalsa20
method "salsa2012+gmac";
method "null";
 
# Bind to a fixed port, IPv4 only
bind 0.0.0.0:10000;
 
# Secret key generated by 'fastd --generate-key'
secret "[YOUR SECRET KEY HERE]";
 
# Set the interface MTU for TAP mode with xsalsa20/aes128 over IPv4 with a base MTU of 1492 (PPPoE)
# (see MTU selection documentation)
mtu 1426;
 
# Include peers from the directory 'peers'
include peers from "peers";
include peers from "backbone";
 
on up "./fastd-up";
# on down "./fastd-down";
 
on establish "
        NODE_ID=\${PEER_NAME:0:12}
        /usr/bin/curl  -u vpn2:XXXXXX  -X POST -d viewpoint=fastd2 -d mac=\$NODE_ID -d vpn_sw=fastd -d vpn_status=up -d ip=\$PEER_ADDRESS http://register.kbu.freifunk.net/nodes/update_vpn_status &
";
on disestablish "
        NODE_ID=\${PEER_NAME:0:12}
        /usr/bin/curl  -u vpn2:XXXXXX  -X POST -d viewpoint=fastd2 -d mac=\$NODE_ID -d vpn_sw=fastd -d vpn_status=down -d ip=\$PEER_ADDRESS http://register.kbu.freifunk.net/nodes/update_vpn_status &
";
EOF
</pre>
Hinweise:
* Username / Password stehen im Keypass.
* Viewpoint (hier: fastd2) anpassen
* Grundsätzlich wird die Node-ID nicht escpaed. Shell-code injections ist aber nicht möglich, da mon_serv nur node_ids der Form $mac_$key zulässt.
* Die Calls auf der Script sind synchron - Daher "&". fastd blockiert solange das Script nicht terminiert ist. (Zumindest Stand 04/2014)
Ordnerstruktur anlegen:
<pre>
mkdir /etc/fastd/mesh-vpn/backbone
mkdir /etc/fastd/mesh-vpn/peers
chown www-data /etc/fastd/mesh-vpn/peers
</pre>
 
==== Backbone ====
Backbone Keys einrichten:
<pre>
$:/etc/fastd/mesh-vpn# ls backbone/
fastd1 fastd2 fastd3 fastd4 fastd5 fastd6 fastd7 fastd8
$:/etc/fastd/mesh-vpn# cat backbone/*
key "4f856d95bd596ac7724edca73a19e6e9d142b374df27166bb1a78e58785efc59";
remote ipv4 "fastd1.kbu.freifunk.net" port 10000;


key "e1916b66c4f8a795e217877cf72607d952e796463c7024dd9a6a47ae2929bc10";
=== Fastd ===
remote ipv4 "fastd2.kbu.freifunk.net" port 10000;


key "d56181dfe9b5ac7cfe68a94c0ce406322a9924286a751673da0dcb28ad5218b0";
Only on Virtual Servers:
remote ipv4 "fastd3.kbu.freifunk.net" port 10000;
rm /dev/random
ln -s /dev/urandom /dev/random


key "9b3f65f99963343e2785c8c4fad65e70b73ee7e1205d63bd84f3e2decb53e621";
Generate fastd Keys
remote ipv4 "fastd4.kbu.freifunk.net" port 10000;
fastd --generate-key
Save your fastd Keys anywhere


key "6e4546121d16e7189715aef8ceb78ab58d59462720969318445f97b4301374d1";
Add Directories
remote ipv4 "fastd5.kbu.freifunk.net" port 10000;
mkdir /etc/fastd/meshvpn
mkdir /etc/fastd/meshvpn/peers


key "2a2c69dbb3b9fd90d7eb8e2f70be70b472d811cd4f3743ad9f5002d14b5c94cd";
Add your Secret to /etc/fastd/meshvpn/secret.conf:
remote ipv4 "fastd6.kbu.freifunk.net" port 10000;
# /etc/fastd/meshvpn/secret.conf
secret "$SECRETKEY";


key "68de6815a89270c8eaf7832deedb8da098aad2ae5793cd2cd55dec3541ad28f2";
fastd Config /etc/fastd/meshvpn/fastd.conf:
remote ipv4 "fastd7.kbu.freifunk.net" port 10000;


key "b41a9714b1178ce428b15af0b6055cc204b39af2088ef3b371d8c36219eedd1e";
First, random mac address has to be calculated on the linux console via:
remote ipv4 "fastd8.kbu.freifunk.net" port 10000;
</pre>


[[https://github.com/ff-kbu/fff/tree/v0.3-generic/files/lib/freifunk/mesh-vpn/backbone fastd-backbone]] for more
echo $RANDOM|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/'


==== fastd-up ====
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.
<pre>
cat > /etc/fastd/mesh-vpn/fastd-up << EOF
#/bin/sh
/sbin/ip link set dev mesh-vpn up
/usr/sbin/batctl if add mesh-vpn
/usr/sbin/batctl gw_mode server
/sbin/ifconfig bat0 [DEINE IPv4 Addresse hier] netmask 255.255.192.0 up


/sbin/ifconfig bat0:0 172.27.0.2 netmask 255.255.192.0 up
# /etc/fastd/meshvpn/fastd.conf
bind 0.0.0.0:53842;
# bind [*IPv6IP*]:53842; #Only if available
include "secret.conf";
include peers from "/etc/fastd/meshvpn/peers";
interface "fastd-meshvpn";
log level info;
method "aes128-gcm";
method "salsa2012+umac";
method "salsa2012+gmac";
method "xsalsa20-poly1305";
mtu 1312;


/sbin/ip rule add from 172.27.0.0/18 table ffkbu
on up "
/sbin/ip route add 172.27.0.0/18 dev bat0 table ffkbu
modprobe batman-adv
/sbin/ip route flush cache
ip link set address aa:bc:cc:dd:ee dev fastd-meshvpn #Change MAC to Random MAC Address
EOF
ip link set up dev fastd-meshvpn
</pre>
batctl -m bat0 if add fastd-meshvpn
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.158.191.254 broadcast 10.158.191.255 dev bat0 #Change IP to a available Address in the mesh network
ip -6 addr add 2a03:2260:11e:301::107/64 dev bat0 #Change IP to a available Address in the mesh network
";


fastd-up ausführbar machen:
Add the fastd servers:
<pre>
cd /etc/fastd/meshvpn/peers
chmod +x /etc/fastd/mesh-vpn/fastd-up
git clone https://gitlab.kbu.freifunk.net/ffkbu/fastd-peers.git ./ -b '''$BRANCH'''
</pre>


Branches (Hoods)
hoodk - Hood Köln
hoodb - Hood Bonn
hoodu - Hood Umgebung


== HopGlass-Server (Backend) aufsetzen ==


== Backbone Netz (tinc) ==
wget https://raw.githubusercontent.com/plumpudding/hopglass-server/v0.1/scripts/bootstrap.sh; bash bootstrap.sh; rm bootstrap.sh
=== Installation ===
<pre>
apt-get install tinc bridge-utils
</pre>


=== Konfiguration ===
Change config.json as you like. If you leave it as config.json.sample it will load default config
<pre>
mkdir /etc/tinc/backbone
echo "backbone" >> /etc/tinc/nets.boot  # Dies sagt tinc, dass es das Netz "backbone" starten soll
cd /etc/tinc/backbone
# Public keys der anderen Teilnehmer:
git clone https://github.com/ff-kbu/bbkeys
ln -s bbkeys/ hosts
</pre>


Jetzt fehlt noch des eigene Public/Private Keypaar. <br />
node /opt/hopglass/server/hopglass-server.js
Die Keys sollten in /etc/tinc/backbone gespeichert werden.<br />
Den Public-Key in den Namen des Supernodes umbenennen und nach bbkeys/ kopieren.
<pre>
tincd -K
cp rsa_key.pub bbkeys/[supernodename]
</pre>
Bevor jetzt der pub-key gepushed werden kann, muss tinc noch gesagt werden, welche Adressen über diesen Node zu routen sind. <br />
Also im .pub key:
<pre>
Subnet=172.27.255.X/32
Subnet=172.27.Y.0/21
Subnet=fdd3:5d16:b5dd:3::X/128
Subnet=2001:67c:20a0:b10Z::/64


-----BEGIN RSA PUBLIC KEY-----
== HopGlass-Server (Backend) aufsetzen Kaputt ==
</pre>
Und schliesslich:
<pre>
cd bbkeys; git push;
</pre>


==== tinc.conf ====
'''ArchLinux or Debian-based systems using systemd (preferred)'''
<pre>
cat > /etc/tinc/backbone/tinc.conf << EOF
Name=[supernodename]
Device=/dev/net/tun
Mode=router
Compression=9
ConnectTo=paula
ConnectTo=paul
EOF
</pre>


==== tinc-up ====
'''i.e. Debian Jessie or newer, Ubuntu 15.04 or newer'''
'''Wichtig:''' in der datei muss wirklich $INTERFACE stehen. Tinc ersetzt dies automatisch durch das entsprechende interface bei ausführung.
<pre>
cat > /etc/tinc/backbone/tinc-up << EOF
#!/bin/sh
ifconfig \$INTERFACE 172.27.255.[Backbone IPv4 Adresse hier] netmask 255.255.255.0 up


ip route add 172.27.255.0/24 dev backbone table ffkbu
ip route add default dev backbone table ffkbu
ip -6 addr add fdd3:5d16:b5dd:3::X/64 dev \$INTERFACE
ip -6 addr add 2001:67c:20a0:b10Y::1/128 dev \$INTERFACE
ip -6 route add default via fdd3:5d16:b5dd:3::3
EOF
</pre>


Auch diese Datei muss ausführbar gemacht werden:
1) Run # wget https://raw.githubusercontent.com/plumpudding/hopglass-server/v0.1/scripts/bootstrap.sh; bash bootstrap.sh; rm bootstrap.sh
<pre>
2) Review and edit the default configuration located at /etc/hopglass-server/default/config.json.
chmod +x /etc/tinc/backbone/tinc-up
3) Start the HopGlass Server: # systemctl start hopglass-server@default
</pre>
4) (Optional) Automatically start the HopGlass Server at boot: # systemctl enable hopglass-server@default


Danach sollte der Ordner etwa so aussehen:
<pre>
$:/etc/tinc/backbone# ls
bbkeys
hosts -> bbkeys
rsa_key.priv
rsa_key.pub
tinc.conf
tinc-up
</pre>


== Routing ==
= HopGlass Viewer (Frontend) =


we need to set up policy based routing.
'''Dependencies'''
npm
#bower
#grunt-cli
#Sass (>= 3.2)


<pre>
== Installing dependencies ==
echo "200 ffkbu" >> /etc/iproute2/rt_tables
</pre>
fastd-up und tinc-up erledigen den rest: <br />


ip rule ls
Install npm package-manager. On Debian-like systems run:
<pre>
ip rule ls
0:      from all lookup local
32765:  from 172.27.0.0/18 lookup ffkbu
32766:  from all lookup main
32767: from all lookup default
</pre>


ip route list table ffkbu
  sudo apt-get install npm
<pre>
ip route list table ffkbu
default dev backbone scope link
172.27.0.0/18 dev bat0  scope link
172.27.255.0/24 dev backbone  scope link
</pre>


== IPv4 DHCP ==
On Mac you have to install only npm via brew and sass
=== Installation ===
<pre>
apt-get install isc-dhcp-server
</pre>


=== Konfiguration ===
1) /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
<pre>
2) brew install node
cat > /etc/dhcp/dhcpd.conf << EOF
3) sudo gem install sass


option domain-name "mesh.kbu.freifunk.net";
option domain-name-servers 85.214.20.141, 213.73.91.35;


default-lease-time 60;
Execute these commands on your server as a normal user to prepare the dependencies:
max-lease-time 720;


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


subnet 172.27.0.0 netmask 255.255.192.0 {
== Building ==
range 172.27.X.10 172.27.Y.255;
Just run the following command from the hopglass directory:
option routers 172.27.X.1;
}
EOF
</pre>


== IPv6 ==
node_modules/.bin/grunt
=== Installation ===
<pre>
apt-get install radvd
</pre>


=== Konfiguration ===
This will generate build/ containing all required files.
<pre>
cat > /etc/radvd.conf << EOF
interface bat0 {
AdvSendAdvert on;
AdvHomeAgentFlag off;
MinRtrAdvInterval 10;
MaxRtrAdvInterval 30;
AdvOtherConfigFlag on;
AdvSourceLLAddress off;
AdvLinkMTU 1350; #1442 - fastd - batman-adv - See wiki for details
prefix 2001:67c:20a0:b10Y::/64 {
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr on;
};
prefix fdd3:5d16:b5dd::/64 {
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr on;
};
};
EOF


/etc/init.d/radvd start
== Configure ==
</pre>
Copy config.json.example to build/config.json and change it to match your community.


== Install Webserver ==


=== UDP-Queue Größe ===
apt-get install apache2
Durch Broadcasts können können auf Supernodes kurzzeitig hohe Lastspitzen enstehen. In der aktuellen batman-adv-Version wird jedes Broadcast-Paket zudem 3x auf jedem Link versendet.
Die vergleichweise hohe Datenrate von 100MBit/s zwischen Supernodes bewirkt darüber hinaus, dass broadcast-Pakete mit 100MBit/s eingehen können, während sie gleichzeitig an alle Nodes gesendet werden müssen.


Linux-Distributionen sehen per Default Queue-Größen im Bereich von 128 KB vor (http://www.cyberciti.biz/faq/linux-tcp-tuning/). Supernodes sind somit nicht in der Lage entsprechende Lastspitzen zu puffern und während Idle-Times zu versenden. Läuft die UDP-Queue über, so loggt fastd:
Delete default web files from html folder
2013-03-30 12:32:01 +0100 --- Warning: sendmsg: Resource temporarily unavailable
2013-03-30 12:32:01 +0100 --- Warning: sendmsg: Resource temporarily unavailable
2013-03-30 12:32:01 +0100 --- Warning: sendmsg: Resource temporarily unavailable
2013-03-30 12:32:01 +0100 --- Warning: sendmsg: Resource temporarily unavailable
2013-03-30 12:32:01 +0100 --- Warning: sendmsg: Resource temporarily unavailable
Jeder Log-Eintrag entspricht einem Paket, dass nicht enqueued werden konnte und damit verworfen wurde. Die Queue-Größen können via systctl angepasst werden (http://wwwx.cs.unc.edu/~sparkst/howto/network_tuning.php). Auf fastd2 wird zur Zeit verwendet:
#/etc/sysctl.conf
net.core.rmem_max=83886080
net.core.wmem_max=83886080
net.core.rmem_default=83886080
net.core.wmem_default=83886080


Das System verfügt dadurch über 80MB Speicher für Queues. Per default stehen ebenfalls 80MB zur Verfügung. Die konfigurierten 80MB reichen aus, um die 100MBit/s Verbindung über mehrere Sekunden auszulasten und Lastspitzen abzufangen.
rm -r /var/www/html/*


=[[Anycast_DNS]]=
== Move compiled map files to the Apache html folder ==
{{:Anycast_DNS}}
cp -r build/ /var/www/html/

Aktuelle Version vom 12. September 2020, 22:03 Uhr

Hinweis: Diese Seite wurde in das Archiv verschoben. Die Informationen sind größtenteils veraltet und nur für Spezialfälle relevant.

Voraussetzungen

  • 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

Add Keys:

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

Install required Software:

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

Install Batman, batctl and alfred

mkdir /opt/freifunk
cd $_

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

cd ../

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

cd ../

git clone https://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/meshvpn
mkdir /etc/fastd/meshvpn/peers

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

# /etc/fastd/meshvpn/secret.conf
secret "$SECRETKEY";

fastd Config /etc/fastd/meshvpn/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/meshvpn/fastd.conf
bind 0.0.0.0:53842;
# bind [*IPv6IP*]:53842; #Only if available
include "secret.conf";
include peers from "/etc/fastd/meshvpn/peers";
interface "fastd-meshvpn";
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 aa:bc:cc:dd:ee dev fastd-meshvpn #Change MAC to Random MAC Address
ip link set up dev fastd-meshvpn
batctl -m bat0 if add fastd-meshvpn
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.158.191.254 broadcast 10.158.191.255 dev bat0 #Change IP to a available Address in the mesh network
ip -6 addr add 2a03:2260:11e:301::107/64 dev bat0 #Change IP to a available Address in the mesh network
";

Add the fastd servers:

cd /etc/fastd/meshvpn/peers
git clone https://gitlab.kbu.freifunk.net/ffkbu/fastd-peers.git ./ -b $BRANCH

Branches (Hoods)

hoodk - Hood Köln
hoodb - Hood Bonn
hoodu - Hood Umgebung

HopGlass-Server (Backend) aufsetzen

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

Change config.json as you like. If you leave it as config.json.sample it will load default config

node /opt/hopglass/server/hopglass-server.js

HopGlass-Server (Backend) aufsetzen Kaputt

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/