Intro: ------ Fuer unsere Deutschen Benutzer sei die ganz hervorragende Website von Freifunk Hannover empfohlen: http://wiki.freifunk-hannover.de/Fonera_mit_OLSR (German) This package installs Freifunk meshing software on top of the original FON software delivered with the FON router named "Fonera". While the FON function continues, an additional virtual Wifi card in AdHoc mode is created to realize parallel Freifunk meshing. Please also read this english blog entry for an in depth discussion of its function: http://blog.freifunk.net/2007/fonera-pack-story The News: --------- Still 1.0.42: - Changed flasher for special mode 1.0.42: - Corrected watch_chilli script (do not write /index.html) - Extended fonlist script to output upgrade*.tgz contents 1.0.41: - Removed the fon-chillispot from ff-fonera-pack, because the newer chilli(coova) does not use too much RAM and hence also runs under kernel-2.6. The old ff-fonera-pack installed a chilli version cutted down to 512 connections to save some memory on this which does not work any more. - Added a "FON upgrade avail" warning to the freifunk homepage. - Removed the "Protect DHCP gateway from FON user" hack as well as "Protect two FON users" from /etc/firewall.freifunk because those seemed to be fixed by FON now. 1.0.40: - Changed ath0 to wifi0 to repair heardbeat MAC addr - Newer version of olsrd-0.5.6 (same as freifunk firmware) 1.0.39: - Included fon-upgrade to 0.7.2-r3 (on top of 0.7.1-r2) - Fixed freifunk map (added param in /etc/init.d/*olsrd) 1.0.38: - Update to olsrd-0.5.5-pre 1.0.37: - if you configure inet=static and the IP in the freifunk IP range, the standard ad-hoc mode is used now and the AP (aka Myplace) is removed. - Tweaked wireless in S80freifunk /etc/sysctl.conf - Added OLSR prio traffic shaping - Tweaked Kernel config to fit LZMA kernel in 0xb0000 bytes for manual flashing. Note: the flash tool comes with a gz kernel which is a bit larger. To speed up the boot, grab lzma kernel and rootfs from download dir and flash those (LZMA does not work on Meraki mini). 1.0.36: - included fon-upgrade to 0.7.1-rev 5 - upgraded olsrd (includes refactoring changes) - added foneraplus (aka fon2201) Marvell switch support which also includes ADM6996 init grabbed from dd-wrt (dunno for which device it's good for but normally brainslayer knows what he does) 1.0.35: - again upgraded olsrd-0.5.3 (cpu perf enhance) 1.0.34: - upgraded to olsrd-0.5.3 (cvs) with cpu% en- hancements and inet/hna threshold of 0.9 1.0.27: - bugfix: switching to ego disables FON cronjob but switching _from_ ego does not re-enable it - update to olsrd-0.5.3 - changed base fon version to REV4 which adds some entries to /etc/chilli.conf (which where never included in any FON updates to REV2) older versions: - moved from download.olsrexperiment.de to download.berlin.freifunk.net - arp refresh plugin added - 1.0.24 has disfunct olsrd. Corrected - olsrd-1.5.2 plus policy addons - OLSR via WAN-WAN (see below) - SPF-refactoring patch for OLSR - Decentralized Freifunk Map (if you enter GPS Position) - groups for winscp3, fixes - Easyflash (see below) - Beta -> 1.0.0 - Cipe tunnels working - Open, Ego + Stealth mode - New web UI pages: Advanced/Freifunk - Enables RedBoot telnet 169.254.255.1 9000 - Change to kernel to 2.6 - AdHoc + Access-point runs concurrently - Horst tool, OLSR capable tcpdump included - cgi-bin-dev-zero.bin as well as test.sh - Port 8000 has the olsrinfo plug-in - madwifi-0.9.3 Copyrights: ----------- As with other Linux distros, the work of a lot of people is included in a package like this. Special thanks to the folks behind http://www.openwrt.org/, http://www.olsr.org/ and http://madwifi.org/ . All softs are GPL, GPLv2, BSD or some other similar license. Source is provided via CVS on http://ff-firmware.sf.net/ (ff-ng). Freifunk Easyflash ------------------- If you dont want to fiddle with telnet, tftp and IP settings, this is for you. The fonera-flash (Linux) and the fonera-flash.exe (Windows) programs will flash the Freifunk enhanced version of the FON software, but can also be used to flash OpenWrt/Kamikaze or DD-WRT. The program comes with it's own TFTP server and because it is based on libpcap, the current network config of your PC does not matter. You need low-level access to the ethernet device, (run as root on Linux, install WinPcap on Windows see http://winpcap.org/ ). The telnet access to RedBoot needs to be enabled of course. This is the case, if you enabled it via serial cable, via the sound file approach (see below), or if you already flashed ff-fonera-pack, OpenWrt or DD-WRT. For in-depth info about telnet refer to http://wiki.freifunk-hannover.de/Fonera_mit_OLSR . [Windows] 1) Connect the Fonera to the ethernet jack. Use a cross linked cable. 2) Browse to http://winpcap.org/ , download the installer and install it. 3) Download http://download.berlin.freifunk.net/fonera/fonera-flash-gui-1.0-42.exe 4) Run the program. Select interface. Click Go. Switch on the Fonera. [Linux] 1) Connect the Fonera to the ethernet jack. Use a cross linked cable. 2) Switch on the network card, e.g. "sudo ifconfig eth0 up". 3) Download http://download.berlin.freifunk.net/fonera/ap51-flash-fonera-1.0-42 4) Run "sudo ./ap51-flash-fonera-1.0-42 eth0" (run without eth0 to list interfaces) Linux: Extend the command line for your own roofs file name, kernel file name and with the optional keyword "nvram" to create the empty nvram partition necessary for DD-WRT. In that order. Windows: Enable the switches and browse for rootfs and/or kernel files. Enable the nvram switch if desired. Note1: Please use a direct connection (e.g. via cross linked eth cable) because the program starts to flash every device which sends an ARP packet and listens to port 9000 (e.g. you favorite DVD player with RedBoot & Linux). Do not get nervous - the process needs ~10 minutes to complete. Wait until "Done." shows up. Note2: The program start with "fis init" which erases anything currently flashed in that thing. You loose all of your previous configs as well as installed firmwares of course. Note3: There are two different programs for linux: ap51-flash and ap51-flash-fonera. The first is smaller (does not have kernel nor rootfs), which is suitable for flashing your own rootfs/kernel (Kamikaze, Meraki-Softs, DD-WRT). The second tool is larger, because it embeds a kernel as well as the FON+Freifunk rootfs. Play a song for RedBoot and Telnet: ----------------------------------- You may not own a MAX232 voltage converter cable. Here's an alternative approach: 1) Grab an old earphone. Cut the wire. You need the plug with some of the wire. 2) Splice the cable. Connect the copper ground to the fonera ground (e.g. to the copper screw of the antenna jack). Connect the white or the red inner wire to Pin8 of the 10-pin header (color does not matter, we play a mono song soon). To fix the wires, use a clamp / peg / paper clip / spring from a ball pen. Depends on your resources ;-) If the device lays opened on the table, this ASCII art shows pin8 with an x: a n t +-------------------------+ | | | | | ooooo | | oxooo | | | +-------------------------+ 3) Silence PC audio-out. Download listen-to-me-fonera.wav from the download dir. 4) Plug in the stero plug into your PC soundcard output. Switch on the fonera. Wait until you can access the web UI. 5) Unsilence the PC audio out. Play the song. See the LEDs blink during reboot which is also the right moment to unplug the stero jack. 6) Wait a couple of minutes until dropbear generates the keys. Connect via SSH, e.g. "ssh root@169.254.255.1" or via PuTTY. Enable the RedBoot telnet with: ipkg install http://download.berlin.freifunk.net/fonera/fon-telnet-for-redboot_1_mips.ipk Note1: With my notebook's sound card, I have to play rather loud. So I dont repeat this song too often, because the electronics may suffer ;-) Note2: If have feedback saying "only garbage is send". If some garbage is recognized from the serial input, the song is loud enough. Maybe the signal has the wrong polarisation. Try to exchange Ground/InnerCables. Note3: There's another song "rocking-redboot.wav". For this, timing is critical. After receiving the first ARP from the Fonera, you need to wait 3 seconds and play. Currently nobody has tried this one. It simply changes the RedBoot IP to enable the Telnet console. Manually install ff-fonera-pack: -------------------------------- Note: Standard way to install this stuff is to use the easyflash tool (see above). This also does not function on the FoneraPlus aka FON2201 nor on the Meraki mini, because this installation depends on the Whiterussian based FON softs. And: the necessary changes to /sbin/ifup & /sbin/ifdown for FoneraPlus are only included with the precompiled easyflash rootfs currently. 1) You need a Linux shell prompt. Ask someone who own a serial cable for that purpose. You also may assemble a standard MAX232 voltage level adapter (google for "wrt54g serial" for soldering tips). The onboard 10-pin header offers access to the serial port, speed is 9600,n,8,1, Pin1=3,3 Volt, Pin2=Ground, Pin6=TX(to PC), Pin8=RX(from PC). 2) Verify internet connectivity by "ping google.com" or similar. 3) Enter this command and press [return]: ipkg install http://download.berlin.freifunk.net/fonera/ff-fonera-pack_1.0-42_mips.ipk or (if you have stored files on a local ftp server) ipkg install ftp://169.254.255.2/upload/fonera/ff-fonera-pack_1.0-42_mips.ipk This will take a while... (ignore the "File not found: /usr/lib/ipkg/lists/fon" message) 4) Go to the Web UI/Advanced/Freifunk page. Change settings (at least IP/Mask) and set a fixed channel under Advanced/Wireless Settings. Set your password. Optional: Configure Public Wifi Settings, Private Wifi Settings and the CIPE tunnel setup. Beta Users: ----------- If you already installed older version of this stuff: It's best to completely recycle: "ipkg install ff-fonera-kernel24", then restart with step 1) above. The kernel26 has not changed recently, so it may be fine to clean the mini_fo overlay and ipkg install the pack again. FON Updates: ------------ During installation, the current FON updates will be installed. These updates are verified by me for compatibility with ff-fonera-pack. Nevertheless, further automatic upgrading from FON is stopped with this pack. You will notice some months later, that a new /tmp/.thinclient.sh exists. Check with "cat /tmp/.thinclient" then call up manually with ". /tmp/.thinclient". Tips and Hints: ---------------- To clean all files and re-format the jffs2 file system, issue "format-rootfs-data" on the command line. Only the ff-fonera-kernel26 and the original FON file system will survive this. After the next reboot, the ff-fonera-kernel26 will activate the dropbear ssh server by default. You can enter the box with ssh root@169.254.255.1 (password=admin). If you have no Internet on the device (e.g. you have cleaned the file system and now you miss the PPPoE kernel-2.6 modules), consider using a local Ethernet-connected ftp server under 169.254.255.2 to (re)install ff-fonera-pack. If you want channel 12/13/14, you need to change the ath_ahb module params. Add them to the ath_ahb line in /etc/modules.d/20-madwifi, e.g. change to "ath_ahb countrycode=276 outdoor=1". These settings are for Germany. The Freifunk version of ath_abh.ko is compiled with the necessary symbols. You may need to enter the channel number manually in /etc/config/fon, because the Web UI may not list them. Do not use a 192.168.x.x private IP for meshing in order to protect your eventually connected private LAN (either via Eth or via MyPlace Wifi). Use 10.x.x.x, 172.16.x.x or any other IP range you like. Check you local Freifunk community page for that. To connect to others, the BSSID setting is critical (ESSID may be ignored). In Wifi, the signal of any other Router is recognized only, if the BSSIDs match. And of course, you need a better antenna for 1000 meters and above. To revert, flash the original FON kernel. "ipkg install ff-fonera-kernel24" will do the job if you manually installed ff-fonera-pack. If you used Freifunk-Easyflash, install the complete FON firmare (*.FON) via Web UI. To flash stuff, you can also use the RedBoot console. I placed two versions of the kernel in the ff-fonera-pack download dir (the older rev2 and the newer rev4). The following expects a TFTP server under 169.254.255.2, but you may also transfer files using minicom/ymodem (see Freifunk Hannover): rb> ip_addr -h 169.254.255.2 -l 169.254.255.1/16 rb> load -r -v -b %{FREEMEMLO} vmlinux.bin.l7-fonera-rev2 rb> fis create -r 0x80041000 -e 0x80041000 -l 0x000b0000 -s 0x00080000 vmlinux.bin.l7 (Answer "y" to overwrite the existing vmlinux.bin.l7 partition) To overwrite an existing OpenWrt/kamikaze root file system do this additionally: rb> ip_addr -h 169.254.255.2 -l 169.254.255.1/16 rb> load -r -v -b %{FREEMEMLO} rootfs-fonera-rev2 rb> fis create -f 0xA8030000 -l 0x00700000 rootfs (Answer "y" to overwrite the existing rootfs partition) If you want to enter the Redboot telnet console, issue "telnet 169.254.255.1 9000" shortly after switching on. With my Linux/telnet, the Ctrl-C does not work for some reason. I use the "redboot.pl" script (also in download dir). On Linux, you need "apt-get install fping libnet- telnet-perl", then issue "./redboot.pl 169.254.255.1" to start. You can use the fonlist shell script (installed with ff-fonera-pack) to check FON updates yourself. "fonlist xxx.fon" lists a fon file, "fonlist -x xxx.fon" extracts. You can download *.fon files manually and install via Web UI or simply issue sh -x /tmp/.thinclient to install upgrades. One of the early updates will prevent the following hack from functioning, but it works with older out-of-the box devices: wget -O - --http-user root --http-password admin \ --post-data "submit=Submit&auth=wep&wepkey=\$(mv /etc/init.d/dropbear /etc/init.d/S51dropbear)\$(reboot)" \ http://169.254.255.1/cgi-bin/webif/private.sh OLSR via WAN-WAN ---------------- This feature is a typical "church setup" option. You interconnect two devices via ethernet (the Foneras need a cross linked cable for that). Then you configure a Freifunk-IP for ethernet on both devices and let the OLSR daemon fiddle out the routing. This works fine if you follow this simple steps: * On Advanced/Freifunk Settings, switch to "Ego" * On Advanced/Internet Settings, switch to Static, enter IP Adress, Netmask=255.255.255.252, a valid DNS Server and empty (no) Gateway. Note1: The Freifunk-IP used for WAN-WAN is critical. Select an IP address of the same range as the Freifunk-Wifi IP address. With the narrow netmask, this forms a "micro-network", so both WAN-WAN IP adresses must match the mask. Here is a sample (use "ipcalc IP Mask" to dig it out): Say Fonera1 has FFWifi=10.123.23.11/8 and Fonera2 has FFWifi=10.11.23.123/8 Valid FF IPs are 10.0.0.1 until 10.255.255.254 (denoted by /8 or 255.255.255.0) Your WAN-WAN "micro-network" will use 10.3.3.172/30. So you enter this on the Fonera command line to check that: ipcalc 10.3.3.172 255.255.255.252 This outputs the "micro-network" parameters: IP=10.3.3.172 NETMASK=255.255.255.252 BROADCAST=10.3.3.175 NETWORK=10.3.3.172 PREFIX=30 Use Fonera1/Internet Connection/IP is 10.3.3.173 (NETWORK plus 1) And Fonera2/Internet Connection/IP is 10.3.3.174 (NETWORK plus 2) Note2: Of course, you can use any netmask, e.g. 255.255.255.248 for 6 interconnected Nodes. The WAN netmask should not match the Wifi netmask, otherwise you depend on OLSR hostroutes and will not have simple ping connectivity if the OLSR-Daemon dies (because 2 Ifaces within same net). Q: Why in hell do you write so much sentences about masks? A: Because people think the netmask is a funny number. You need to think hex if you want to fiddle with them. Something even the experienced can do wrong. Changes done by ff-fonera-pack: ------------------------------- Installs a new kernel 2.6. The new kernel will also run Kamikaze if /etc/preinit is present. Because original FON-Firmware has no preinit, a predefined fallback will generate a fixed combination of device files under /dev and mount a squashfs/ mini_fo combination. Also added: files written with BBC-LZARJ to jffs2 under 2.4 are still readable from the new kernel. The /jffs2 partition will survive the kernel update. Installs a shell script variant of the ipkg command and alters the /bin/rmdir command. This is a bug fix for the buggy rmdir implementation of mini_fo. Ipkg removes a directory tree while deinstalling ipks even if directory is non-empty. Fatal with "rmdir /lib". Installs a newer version of hostapd with a bug fix for wirelesstools>v20. Also installs a changed version of fon-chillispot with less connections. 1024 connections need too much mem for kernel-2.6, so I limit to 512. Added the domains olsrexperiment.de and freifunk.net to chilli.conf (the free-to-surf-list) Installs the olsrd daemon as well as start scripts to add a new ath2 virtual ad-hoc Wifi interface. Opens the firewall to let any packets from-mesh IP address range through. Disables the auto-fon-update mechanism. You need to install upgrades manually. Done by adding a hash to the last line of /bin/thinclient. Installs some web UI add-ons (you will notice ;-) with a public status area visible for Freifunk mesh participants. Also provided: The config pages for Freifunk settings. Opens up port 8000 for the olsrinfo-Web-UI. Added a speed testing script to the Web-UI as well as the counterpart script, e.g. "test.sh 1.2.3.4" checks the connection speed to 1.2.3.4 for 10 seconds using wget. Installs tcpdump, iptraf (ip monitor) and horst (kismet-alike): - type "tcpdump -ni ath2 udp" [ret]: shows OLSR broadcasts - type "horst" [ret]: adds a monitor iface and starts, exit with "q" - type "iptraf" [ret]: shows current ip traffic (self explanatory) Installs the tunneling variant of CIPE. This is small, fast + very old. For the purpose, it is safe enough (better than the WPA protection with the weak password you entered - I'm sure). This is activated in the master and slave modes. !!! No warranties, no complaints. Fixes and enhancements welcome of course !!! // Sven-Ola