Node

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

Aufsetzen eines Nodes mit Debian

/etc/apt/sources.list

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

für wheezy werden backports benötigt!

aptitude update; aptitude install fastd batman-adv-dkms;
mkdir -p /etc/fastd/mesh-vpn/backbone
git clone https://github.com/ff-kbu/fastd-pubkeys /etc/fastd/mesh-vpn/backbone 

/etc/fastd/mesh-vpn/fastd.conf

drop capabilities yes;
forward no;
hide ip addresses yes;
hide mac addresses yes;

peer group "backbone" {
  include peers from "backbone";
}
interface "mesh-vpn";

log to syslog level info;

method "salsa2012+umac";
mode tap;
mtu 1426;

on up sync "./fastd-up";
pmtu no;

secret "[KEY HERE";

/etc/fastd/mesh-vpn/fastd-up

#!/bin/sh
/sbin/ip link set dev mesh-vpn up

/usr/sbin/batctl if add mesh-vpn
/usr/sbin/batctl it 5000

chmod +x /etc/fastd/mesh-vpn/fastd-up
/usr/bin/fastd --generate-key
# enter key

/etc/fastd/mesh-vpn/upload_keys

#!/bin/sh
KEY=`/usr/bin/fastd --config /etc/fastd/mesh-vpn/fastd.conf --show-key | cut 9-`
WGETC=`which wget`
VERSION="debian node"
MAC=`/sbin/ip link show dev bat0 | tail -n 1 | cut -c 16-33`
DELAY=30
while [ 1 = 1 ]
do
	$WGETC "$UPLOAD_URL/upload_key?nodeid=${MAC}&_method=post&key=${KEY}&fw_version=${VERSION}" -O -  > /dev/null && break
	sleep $DELAY
	[ $DELAY -gt 42300 ] && DELAY=84600 || DELAY=$((DELAY * 2))
done