[Discuss] dir300 mit openwrt flashen

Sven-Ola Tuecke (spam-protected)
Do Feb 26 07:56:12 CET 2009


Hey,

falls du im Web nix findest, sich hab' mal beim Basteln Notizen mitgeschrieben 
(Anhang).

HTH
// Sven-Ola

Am Mittwoch 25 Februar 2009 14:20:46 schrieb Felix Ehritz:
> bin gerade in der arbeit. die links im wiki kenn ich alle.
> habe in einem forum dann das richtige gefunden. poste das dann in der
> discuss... bei mir gabs probleme mit dem tftp- linux.bin zu kopieren. aber
> mit einer passenden anleitung in der man die tftp-server-ip (ip des
> rechners) angibt hats dann geklappt. jetzt läuft dd-wrt drauf..
> nur jetzt steh ich an. welche bin soll ich flashen?
> wie bekomm ich luci drauf und wie olsrd
>
> mfg felix
> -------- Original-Nachricht --------
>
> > Datum: Wed, 25 Feb 2009 08:58:28 +0100
> > Von: "Gregor G." <(spam-protected)>
> > An: Felix Ehritz <(spam-protected)>
> > CC: (spam-protected)
> > Betreff: Re: [Discuss] dir300 mit openwrt flashen
> >
> > Hi!
> >
> > Felix Ehritz schrieb:
> > > Bräuchte aber openwrt+luci weil ich diese woche einen testknoten
> > > aufstellen möchte. Kann mir das wer helfen?
> > >
> > > MFG
> >
> > Im wiki.funkfeuer.at ist eine passende Firmware verlinkt. Hab mich
> > gestern stundenlang damit gequält, das Ding hinzubekommen, habs aber
> > schlussendlich geschafft. Wieviele Probleme hats bei dir bisher gemacht?
> > Wie hast du dd-wrt drauf gemacht? Wenn du das wiki ergänzen könntest
> > wärs ganz super!
> >
> > LG Gregor
> >
> > --
> > Partykeller
> > www.meineparty.at
>
> --
> Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen:
> http://www.gmx.net/de/go/multimessenger01


-------------- nächster Teil --------------
Newer: Ubuntu-EEE

(Toll: einfach downloaden und mit GUI-Tool auf Stick packen. Alles geht, sogar Atheros Wifi. Bis auf den ethernet-treiber und beim 'runterfahren gibts bildschirmsalat. naja)

Erstmal Internet: Oben rechts auf Network-Manager klicken und irgendwat auswaehlen. Bei mir: Wep-Key Hex, danach kommt ein Save-Passwort-Dialog, den ich mit leeren eingaben und Unsafe password bestätige.

Alt-F2-"gksudo gnome-terminal"
gedit Alina*.txt &
cd /tmp
wget http://x-alina.freifunk-potsdam.de/downloads/dir300-flash/dir300-flash-0.9.8.tar.gz
tar xvzf dir300-flash-0.9.8.tar.gz
cd dir300-flash
make install
dir300-flash --help
apt-get update
apt-cache search tftp
apt-get install tftpd-hpa
  (Y)
(shit: der eth-driver ist nicht: modprobe r8169)
cd /usr/share/dir300-flash
wget http://dev.luci.freifunk-halle.net/freifunk-snapshots/atheros/openwrt-atheros-root.squashfs
wget http://dev.luci.freifunk-halle.net/freifunk-snapshots/atheros/openwrt-atheros-vmlinux.lzma
(for some reason, the interface parameter does not work. gedit /usr/sbin/dir300-flash and change eth0 to ath0).
https://bugs.launchpad.net/bugs/298641

New: Knoppix-5.3

K-Menu: Run: "kdesu konsole"
cd /tmp
ln -sf dash /bin/sh
wget http://x-alina.freifunk-potsdam.de/downloads/dir300-flash/dir300-flash-0.9.7.tar.gz
tar xvzf dir300-flash-0.9.7.tar.gz
cd dir300-flash
make install
wget http://dev.luci.freifunk-halle.net/freifunk-snapshots/atheros/openwrt-atheros-root.squashfs
wget http://dev.luci.freifunk-halle.net/freifunk-snapshots/atheros/openwrt-atheros-vmlinux.lzma
  connect eth0 to dir-300(wan-port)
dir300-flash --factory


I recently exchanged a spare Atheros MiniPCI-Express wireless card for a new router. The box says, it's a D-Link DIR-300 currently available in the supermarket for approx. 30,-- Euros. After unboxing, I removed the label cying "!Stop, insert CD first" and attached an ethernet cable to the WAN port. According the the previous owner, I can telnet into redboot by using these commands. Start ALT-F2-"kdesu konsole" and type in:

killall NetworkManager;killall NetworkManagerDispatcher
killall dhcdbd;killall dhclient
ip addr add dev eth0 192.168.20.80/24
ip link set dev eth0 up
while true;do sleep 1;telnet 192.168.20.81 9000;done
  switch on router, wait for "Escape is", press [ret]

Note, that this is a first test and there are other ways to stop DHCP from interfering a static IP address on the Ethernet port. The following steps are done on my netbook which runs under Kubuntu/Hardy. I also added the group "src" to my linux login using the Kubuntu user manager. Your Linux may vary...

=============
PLEASE: Alina has posted an updated script which corrects some issues. I'll leave my orig descrition
here, until I upgade this text while flashing live next time.
=============

After rebooting the netbook, I searched for the easy-flash tool announced by alina in order to flash ff-lucy on that thing. Docs on the DIR-300 and ff-luci can be found here:

http://wiki.openwrt.org/OpenWrtDocs/Hardware/D-Link/DIR-300
http://luci.freifunk-halle.net

Now start by issueing ALT-F2-konsole and grab/unpack alinas script:

cd /usr/src
wget http://x-alina.freifunk-potsdam.de/downloads/dir300-flash/dir300-flash-0.9.5.tar.gz
tar xvzf dir300-flash-0.9.5.tar.gz
cd dir300-flash
sudo mkdir /usr/share/dir300-flash
sudo chgrp src /usr/share/dir300-flash
sudo chmod g+w /usr/share/dir300-flash
sudo chgrp 
./dir300-flash.sh

Which complains something about "no tftp found". So I do:

sudo apt-get install tftpd-hpa
sudo chgrp src /var/lib/tftpboot
sudo chmod g+w /var/lib/tftpboot
sudo kwrite /etc/default/tftpd-hpa
  [change to RUN_DAEMON="yes"]
sudo /etc/init.d/tftpd-hpa start
./dir300-flash.sh

Which says something about "No kernel". So I do:

wget http://dev.luci.freifunk-halle.net/freifunk-snapshots/atheros/openwrt-atheros-root.squashfs
wget http://dev.luci.freifunk-halle.net/freifunk-snapshots/atheros/openwrt-atheros-vmlinux.lzma
./dir300-flash.sh

Which mutters blabla about the IP addr of eth0. So I

sudo kwrite /etc/network/interfaces
  [add the following statement]
iface eth0 inet static
        address 192.168.1.2
        netmask 255.255.255.0
        up ip addr add dev $IFACE 192.168.20.80/24
        up ip addr add dev $IFACE 192.168.0.2/24
        down ip addr del dev $IFACE 192.168.0.2/24
        down ip addr del dev $IFACE 192.168.20.80/24
  [now restart eth0]
sudo ifdown eth0
sudo ifup eth0
./dir300-flash.sh

Which starts flashing that thing (needs some minutes). After successful flashing, you may "telnet 192.168.1.1" as a first step while eventually http://192.168.1.1/ may also work for you.

----------

For my special device, there was no original firmware on it. I needed to restore the D-Link FW using the emergency web UI under http://192.168.20.81/ to be able to flash successfully. Heres what is displayed, if no D-Link FW on the device:

RedBoot> load ap61.ram.dir300-flash
Using default protocol (TFTP)
Entry point: 0x800410bc, address range: 0x80041000-0x800680d8
RedBoot> go
[fload] execution fail! [go] abort...

(spam-protected):/usr/src/dir300-flash$ md5sum /var/lib/tftpboot/ap61.ram.dir300-flash
4aaec2bff1edffe8c49003ed9363ad8b  /var/lib/tftpboot/ap61.ram.dir300-flash

Helpful hints may be found here:
http://www.shadowandy.net/2007/10/flashing-dir-300-back-to-original-firmware.htm

To make sure, nothing is vanishing from the net, I've mirrored the necessary downloads here. They may be outdated if you read this, so be sure to check the original sites for newer downloads.

http://download.berlin.freifunk.net/sven-ola/dir-300
http://download-master.berlin.freifunk.net/sven-ola/dir-300

// Have fun - Sven-Ola

Using that thing as freifunk router
===================================

With the advent of the ffluci interface, doing the base config is straightforward: 

01) Start you web browser and go to http://192.168.1.1/. Click "Administration". Password is empty.
02) Go to "System:Passwort ändern" and hack in a new password.
03) Go to "Freifunk:Freifunkassistent". Activate "Freifunkzugang einrichten".
04) Enter your Freifunk-IP and click "Absenden" followed by "Speichern&Anwenden".
    (This may restart the router. Wait and re-login using your new password)
05) Go to "Freifunk:Kontakt" and enter your credentials. Do not forget the GPS position.
06) Go to "System:System" and change "Hostname" and "Zeitzone". Click "Speichern&Anwenden".
07) Go to "Netzwerk:Drahtlos:Wifi0". Verfiy the settings. You may want "Rts=2346" and
    "Fragment=2346". Click on "Speichern&Anwenden" shows uncritial error. Ignore.
08) Go to "System:Paketverwaltung:IPKG". Change the "8.09_rc1" to the correct
   "8.09_RC1" uppercase. Click "Absenden".
09) Start "ssh 192.168.1.1" on your PC. Login. Enter "cd /etc/config;vi wireless".
    Go to last line (in config 'wifi-iface' section) using the cursor keys. Press the
    ["i"] key and add a line "(tab)option sw_merge 1". Press ["esc"],["w"],["q"],["ret"].
    This writes the file. The change prevents madwifi from blocking TX from time to time.
10) Enter "cd /etc/modules.d;vi 50-madwifi". Add "countrycode=276" behind "ath_ahb".
    For vi usage see step 8. Your countrycode may be different. Free up channel 13 on
    ath0, that channel is legal in country 276 (germany).
11) You may want a shell status script for OLSR. Enter "cd /usr/sbin" and cat and copy
echo>neigh.sh<<EOF
#!/bin/sh
wget -q -O - http://localhost:2006/neighbours
EOF
    Then enter "chmod +x neigh.sh" and test by entering "neigh.sh".
12) Now install some soft. Enter "opkg update" and "opkg list". You may want to test
    with "opkg install tcpdump". After installation, you may "tcpdump -ni ath0" to 
    watch the network activity. 

The DIR-300 is now usable as Freifunk Router with reasonable defaults. After startup, it needs too long to grab active neighbours (needs a minute or two) for unknown reason. But you can attach a PC via cable, start DHCP on eth and use Freifunk as inet gate with this...

Again have fun,
// Sven-Ola, Nov-2008


Mehr Informationen über die Mailingliste Discuss