Map: Unterschied zwischen den Versionen

Aus Freifunk Köln, Bonn und Umgebung
Zur Navigation springen Zur Suche springen
(Änderung 42605 von JeffBurge6 (Diskussion) rückgängig gemacht.)
Markierung: Rückgängigmachung
 
(16 dazwischenliegende Versionen von 4 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
[[Kategorie:Archiv]]
{{:Archiv-Hinweis}}
{{TOCright}}
{{TOCright}}
[[Kategorie:Infrastruktur]]
[[Kategorie:Infrastruktur]]


== Voraussetzungen ==
== Voraussetzungen ==
Benötigte Software
1) ----
Du benötigst ausserdem: <br />


* eine private IPv4/IPv6 Adresse
* eine private IPv4/IPv6 Adresse
Zeile 17: Zeile 13:


Grundlage: Debian 7 (Wheezy) oder Debian 8 (Jessy)
Grundlage: Debian 7 (Wheezy) oder Debian 8 (Jessy)
apt-get install apt-transport-https


Edit /etc/apt/sources.list
Edit /etc/apt/sources.list
Zeile 32: Zeile 26:
  gpg -a --export 16EF3F64CB201D9C | apt-key add -
  gpg -a --export 16EF3F64CB201D9C | apt-key add -


Update and install:
Install required Software:
 
  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 48: 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 56: 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 86: Zeile 82:
First, random mac address has to be calculated on the linux console via:
First, random mac address has to be calculated on the linux console via:


  echo $RANDOM|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/')
  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.
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>
# /etc/fastd/meshvpn/fastd.conf
# /etc/fastd/meshvpn/fastd.conf
bind 0.0.0.0:53842;
bind 0.0.0.0:53842;
# bind [*IPv6IP*]:53842; #Only if available
# bind [*IPv6IP*]:53842; #Only if available
include "secret.conf";
include "secret.conf";
include peers from "/etc/fastd/meshvpn/peers";
include peers from "/etc/fastd/meshvpn/peers";
interface "fastd-meshvpn";
interface "fastd-meshvpn";
log level info;
log level info;
method "aes128-gcm";
method "aes128-gcm";
method "salsa2012+umac";
method "salsa2012+umac";
method "salsa2012+gmac";
method "salsa2012+gmac";
method "xsalsa20-poly1305";
method "xsalsa20-poly1305";
mtu 1312;
mtu 1312;


on up "
on up "
  modprobe batman-adv
  modprobe batman-adv
  ip link set address aa:bc:cc:dd:ee dev fastd-meshvpn #Change MAC to Random MAC Address
  ip link set address aa:bc:cc:dd:ee dev fastd-meshvpn #Change MAC to Random MAC Address
Zeile 116: Zeile 111:
  ip -6 addr add 2a03:2260:11e:301::107/64 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
  ";
  ";
</pre>


Add the fastd servers:
Add the fastd servers:
Zeile 129: Zeile 123:
== HopGlass-Server (Backend) aufsetzen ==
== HopGlass-Server (Backend) aufsetzen ==


'''Get HopGlass from GIT
wget https://raw.githubusercontent.com/plumpudding/hopglass-server/v0.1/scripts/bootstrap.sh; bash bootstrap.sh; rm bootstrap.sh
'''<pre>
cd /opt
git clone https://github.com/plumpudding/hopglass-server
cd hopglass-server
</pre>
 
Install NodeJS dependencies
npm install


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


Start HopGlass Server
  node /opt/hopglass/server/hopglass-server.js
  node  


== HopGlass-Server (Backend) aufsetzen Kaputt ==
== HopGlass-Server (Backend) aufsetzen Kaputt ==
Zeile 150: Zeile 135:
'''i.e. Debian Jessie or newer, Ubuntu 15.04 or newer'''
'''i.e. Debian Jessie or newer, Ubuntu 15.04 or newer'''


<pre>
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.
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


3) Start the HopGlass Server: # systemctl start hopglass-server@default
4) (Optional) Automatically start the HopGlass Server at boot: # systemctl enable hopglass-server@default
</pre>


= HopGlass Viewer (Frontend) =
= HopGlass Viewer (Frontend) =
Zeile 172: Zeile 154:
Install npm package-manager. On Debian-like systems run:
Install npm package-manager. On Debian-like systems run:


<pre>sudo apt-get install npm</pre>
sudo apt-get install npm


On Mac you have to install only npm via brew and sass
On Mac you have to install only npm via brew and sass
<pre>
 
1) /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
1) /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2) brew install node
2) brew install node
3) sudo gem install sass
3) sudo gem install sass
</pre>
 


Execute these commands on your server as a normal user to prepare the dependencies:
Execute these commands on your server as a normal user to prepare the dependencies:
<pre>
 
1) git clone https://github.com/plumpudding/hopglass
1) git clone https://github.com/plumpudding/hopglass
2) cd hopglass
2) cd hopglass
3) npm install
3) npm install
4) npm install grunt-cli
4) npm install grunt-cli
</pre>


== Building ==
== Building ==
Just run the following command from the hopglass directory:
Just run the following command from the hopglass directory:


<pre>node_modules/.bin/grunt</pre>
node_modules/.bin/grunt


This will generate build/ containing all required files.
This will generate build/ containing all required files.

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/