Eigenen Rechner in das Freifunk-Netz: Unterschied zwischen den Versionen

Aus Freifunk Kiel
Zur Navigation springen Zur Suche springen
Zeile 18: Zeile 18:
 
Um sich mit <code>batman.kiel.freifunk.net</code> auf der Schnittstelle wlan0 mit der [[bssid]] <code>02:ca:ff:ee:ba:be</code> zu verbinden erstelle folgendes script und nenne es z.B. '''/usr/local/sbin/freifunk-connect''':
 
Um sich mit <code>batman.kiel.freifunk.net</code> auf der Schnittstelle wlan0 mit der [[bssid]] <code>02:ca:ff:ee:ba:be</code> zu verbinden erstelle folgendes script und nenne es z.B. '''/usr/local/sbin/freifunk-connect''':
  
 +
[http://pastebin.com/X0LMCrMS download script]
 
'''<pre style="color:#222233">
 
'''<pre style="color:#222233">
 
#! /bin/bash
 
#! /bin/bash

Version vom 6. Dezember 2012, 22:36 Uhr

So einfach kann man seinen Laptop in das Freifunk-Netz als Knoten mit integrieren (Unter Ubuntu 12.04 getestet):

Installation

sudo apt-get install batctl

Kernelmodul laden:

sudo modprobe batman-adv

Version prüfen:

sudo batctl -v

Nicht alle Batmanversionen sind kompatibel - siehe: http://www.open-mesh.org/projects/batman-adv/wiki/Compatversion

Start-Script erstellen

Um sich mit batman.kiel.freifunk.net auf der Schnittstelle wlan0 mit der bssid 02:ca:ff:ee:ba:be zu verbinden erstelle folgendes script und nenne es z.B. /usr/local/sbin/freifunk-connect:

download script

#! /bin/bash
IFACE=wlan0
ESSID=batman.kiel.freifunk.net
CHANNEL=11

if [ "$(whoami &2>/dev/null)" != "root" ] && [ "$(id -un &2>/dev/null)" != "root" ] ; then
  echo "You must be root to run this script!"; exit 1
fi

if [ "$1" = "stop" ]; then
  echo "resuming normal networking..."
  echo "restart network-manager"
  service network-manager restart
  echo "turn wlan iface off"
  batctl if del $IFACE
  sleep 10
  echo "OK"
  echo "echo it can take a few minutes until network-manager gets a new route"
  echo
  exit
elif [ "$1" = "restart" ]; then
  echo "not implemented. call this script first with stop and then with start"
  exit
elif [ "$1" = "--help" ]; then
  echo "[start](default) or [stop]"
  echo edit the options in the top section of this script to connect to another network
  exit
else # "start"
  echo "stopping network-manager"
  service network-manager stop
  echo "pls wait"
  sleep 10
  echo "turn wlan iface off"
  ifconfig $IFACE down
  echo" set maximal transfer unit from standard 1500 to 1528"
  ifconfig $IFACE mtu 1528
  echo "turn wlan encryption off"
  iwconfig $IFACE enc off
  echo "start ad-hoc mode"
  iwconfig $IFACE mode ad-hoc essid $ESSID ap 02:ca:ff:ee:ba:be channel $CHANNEL
  echo "load module into kernel"
  modprobe batman-adv
  echo "adding iface to batman"
  batctl if add $IFACE
  echo "turn wlan iface on"
  ifconfig $IFACE up
  echo "turn batman iface on"
  ifconfig bat0 up
  echo "ESSID $ESSID on $IFACE should be ready"
  echo "internet starting, this may take some minutes due to latency..."
  dhclient bat0
  echo "internet connection IP:"
  ifconfig|grep Bcast
  echo
  echo "to resume normal networking call this script with option stop"
  echo
fi

Wenn das script ausgeführt wird, dann ist dein Rechner Teil des Freifunk-Netzwerkes und mescht mit. Er kann so also auch als Brücke zwischen zwei Routern fungieren, die zu weit auseinander liegen.

Siehe auch: Askubuntu

Todo

fastd installieren und eine Werbindung vom eigenen Rechner aus aufbauen: