Hi zusammen,
Hier findet ihr eine Sammlung der in Düsseldorf verwendeten Broker Config für Tunneldigger.
Als Vorraussetzung dafür sind: Batman mit allen patches wie auf den Nodes (Egal ob Compat 14 oder 15).
Außerdem ein aktueller Linux Kernel, wir haben Linux 4.1 erfolgreich auf Debian Jessie via Backports getestet.
Installation:
Alle Befehle werden als root user ausgeführt.
1.Notwendige Pakete installieren:
apt-get install iproute bridge-utils libnetfilter-conntrack3 python-dev libevent-dev ebtables python-virtualenv
2.Git repo herunterladen
mkdir /srv
git clone https://github.com/wlanslovenija/tunneldigger.git /srv/tunneldigger
3.Virtuelle umgebung installieren
virtualenv /srv/tunneldigger/ -p python2.7
4.Tunneldigger python abhängigkeiten installieren
cd /srv/tunneldigger
source bin/activate
pip install -r broker/requirements.txt
5.Broker config anlegen (/srv/tunneldigger/l2tp_broker.cfg)
[broker]
; IP address the broker will listen and accept tunnels on
address=89.163.150.94
; Ports where the broker will listen on
port=10050
; Interface with that IP address
interface=eth0
; Maximum number of cached cookies, required for establishing a
; session with the broker
max_cookies=1024
; Maximum number of tunnels that will be allowed by the broker
max_tunnels=100
; Tunnel port base
port_base=15000
; Tunnel id base
tunnel_id_base=100
; Tunnel timeout interval in seconds
tunnel_timeout=60
; Should PMTU discovery be enabled
pmtu_discovery=false
; Namespace (for running multiple brokers); note that you must also
; configure disjunct ports, and tunnel identifiers in order for
; namespacing to work
namespace=duesseldorf
[log]
; Log filename
filename=tunneldigger-broker.log
; Verbosity
verbosity=DEBUG
; Should IP addresses be logged or not
log_ip_addresses=false
[hooks]
; Arguments to the session.{up,pre-down,down} hooks are as follows:
;
; <tunnel_id> <session_id> <interface> <mtu> <endpoint_ip> <endpoint_port> <local_port>
;
; Arguments to the session.mtu-changed hook are as follows:
;
; <tunnel_id> <session_id> <interface> <old_mtu> <new_mtu>
;
; Called after the tunnel interface goes up
session.up=/srv/tunneldigger/scripts/bataddif.sh
; Called just before the tunnel interface goes down
session.pre-down=/srv/tunneldigger/scripts/batdelif.sh
; Called after the tunnel interface goes down
session.down=
; Called after the tunnel MTU gets changed because of PMTU discovery
session.mtu-changed=
6.Start-Script anlegen (/srv/tunneldigger/start-broker.sh)
Nicht vergessen das Script ausführbar zu machen! (chmod +x)
#!/bin/bash
WDIR=/srv/tunneldigger
VIRTUALENV_DIR=/srv/tunneldigger
cd $WDIR
source $VIRTUALENV_DIR/bin/activate
bin/python broker/l2tp_broker.py l2tp_broker.cfg
7.Systemd unit anlegen (/etc/systemd/system/tunneldigger.service)
[Unit]
Description = Start tunneldigger L2TPv3 broker
After = network.target
[Service]
ExecStart = /srv/tunneldigger/start-broker.sh
[Install]
WantedBy = multi-user.target
8.Session.up und Session.down scripts anlegen
Session.up (/srv/tunneldigger/scripts/bataddif.sh)
#!/bin/bash
INTERFACE="$3"
ip link set address 04:be:ef:25:00:01 dev $INTERFACE
ip link set dev $INTERFACE up mtu 1364
/usr/sbin/batctl if add $INTERFACE
echo "enabled" > /sys/devices/virtual/net/$INTERFACE/batman_adv/no_rebroadcast
Session.down (/srv/tunneldigger/scripts/batdelif.sh)
#!/bin/bash
INTERFACE="$3"
/usr/sbin/batctl if del $INTERFACE
9.Systemd units neu laden
systemctl daemon-reload
10.Systemd service aktivieren
systemctl enable tunneldigger.service