Map: Unterschied zwischen den Versionen
K3v1n (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
K3v1n (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
Zeile 75: | Zeile 75: | ||
Add Directories | Add Directories | ||
mkdir /etc/fastd/ | mkdir /etc/fastd/meshvpn | ||
mkdir /etc/fastd/ | mkdir /etc/fastd/meshvpn/peers | ||
Add your Secret to /etc/fastd/ | Add your Secret to /etc/fastd/meshvpn/secret.conf: | ||
# /etc/fastd/ | # /etc/fastd/meshvpn/secret.conf | ||
secret "SECRETKEY"; | secret "$SECRETKEY"; | ||
fastd Config /etc/fastd/ | fastd Config /etc/fastd/meshvpn/fastd.conf: | ||
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: | ||
Zeile 91: | Zeile 90: | ||
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. | ||
# /etc/fastd/ | # /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/ | include peers from "/etc/fastd/meshvpn/peers"; | ||
interface "fastd- | interface "fastd-meshvpn"; | ||
log level info; | log level info; | ||
method "aes128-gcm"; | method "aes128-gcm"; | ||
Zeile 106: | Zeile 105: | ||
on up " | on up " | ||
modprobe batman-adv | modprobe batman-adv | ||
ip link set address xx:xx:xx:xx:xx dev fastd- | ip link set address xx:xx:xx:xx:xx dev fastd-meshvpn #Change MAC to Random MAC Address | ||
ip link set up dev fastd- | ip link set up dev fastd-meshvpn | ||
batctl -m bat0 if add fastd- | batctl -m bat0 if add fastd-meshvpn | ||
batctl -m bat0 it 5000 | batctl -m bat0 it 5000 | ||
batctl -m bat0 bl enable | batctl -m bat0 bl enable | ||
Zeile 120: | Zeile 119: | ||
cd /opt/freifunk | cd /opt/freifunk | ||
git clone https://github.com/Freifunk-Troisdorf/fastd-server.git | git clone https://github.com/Freifunk-Troisdorf/fastd-server.git | ||
cp fastd-server/* /etc/fastd/ | cp fastd-server/* /etc/fastd/meshvpn/peers/. | ||
== HopGlass-Server (Backend) aufsetzen == | == HopGlass-Server (Backend) aufsetzen == |
Version vom 21. Mai 2016, 19:08 Uhr
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)
apt-get install apt-transport-https
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 -
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/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 xx:xx:xx:xx:xx 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.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/meshvpn/peers/.
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
- bower
- grunt-cli
- 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/