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

Aus Freifunk Kiel
Zur Navigation springen Zur Suche springen
(→‎Start-Script erstellen: script verbessert)
Zeile 27: Zeile 27:
  
 
echo "stopping network-manager"
 
echo "stopping network-manager"
/etc/init.d/network-manager stop
+
service network-manager stop
 
echo "pls wait"
 
echo "pls wait"
 
sleep 10
 
sleep 10
 +
echo turn wlan iface off
 
ifconfig $IFACE down
 
ifconfig $IFACE down
 +
echo set maximal transfer unit from standard 1500 to 1528
 
ifconfig $IFACE mtu 1528
 
ifconfig $IFACE mtu 1528
 +
echo turn wlan encryption off
 
iwconfig $IFACE enc off
 
iwconfig $IFACE enc off
 +
echo start ad-hoc mode
 
iwconfig $IFACE mode ad-hoc essid batman.kiel.freifunk.net ap 02:ca:ff:ee:ba:be channel 11
 
iwconfig $IFACE mode ad-hoc essid batman.kiel.freifunk.net ap 02:ca:ff:ee:ba:be channel 11
 +
echo load module into kernel
 
modprobe batman-adv
 
modprobe batman-adv
 +
echo adding iface to batman
 
batctl if add $IFACE
 
batctl if add $IFACE
 +
echo turn wlan iface on
 
ifconfig $IFACE up
 
ifconfig $IFACE up
 +
echo turn batman iface on
 
ifconfig bat0 up
 
ifconfig bat0 up
 
echo "batman.kiel.freifunk.net on $IFACE should be ready"
 
echo "batman.kiel.freifunk.net on $IFACE should be ready"
echo "internet starting, this may take some minutes..."
+
echo "internet starting, this may take some minutes due to latency..."
 
dhclient bat0
 
dhclient bat0
 
echo "internet connection IP:"
 
echo "internet connection IP:"
 
ifconfig|grep Bcast
 
ifconfig|grep Bcast
 
+
echo
 
echo "to resume normal networking just restart the networkmanager:"
 
echo "to resume normal networking just restart the networkmanager:"
echo "/etc/init.d/network-manager restart"
+
echo "service network-manager restart"
 +
echo "batctl if del $IFACE"
 +
echo "echo it can take a few minutes until network-manager gets a new route"
 +
echo
 
</pre>'''
 
</pre>'''
  

Version vom 20. November 2012, 22:47 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:

#! /bin/bash
IFACE=wlan0

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

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 batman.kiel.freifunk.net ap 02:ca:ff:ee:ba:be channel 11
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 "batman.kiel.freifunk.net 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 just restart the networkmanager:"
echo "service network-manager restart"
echo "batctl if del $IFACE"
echo "echo it can take a few minutes until network-manager gets a new route"
echo

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