Linuxtag 2007 in Berlin: ein FreeWRT- Stand, supernette Leute, gute Gespräche. Meine Bastelkiste: Ein oller Netgear WGT 634U.
Und jetzt ratet mal, was ich mit dem Ding gemacht habe...
Vorbereitungen
Der Netgear WGT634U ist eigentlich ein super Router. Er hat 5x 10/100 Mbit Ports, 1x Wlan, 2x serielle Konsole und 1xUSB 2.0. Nur das originale Betriebssysten(Firmware) ist nicht so toll, also runter damit. Infos zum Gerät: http://wiki.openwrt.org/OpenWrtDocs/Hardware/Netgear/WGT634U
USB-Seriell-Kabel
Du brauchst zum neu Aufspielen des Systems zwingend einen seriellen Port, den passenden Wandler bekommst Du bei Ebay für unter 5 Euro, incl. Porto.
- Ich habe mir einen USB-Seriell Wandler von einem Siemens A52, A55, A56, A60, C55, C56, C60, C65, CF62, CT56, M55, MC60, MT55, S55, S56, S57, S65, SL5C, SL55, SL56, 1168, 2218, SX1 geholt und den Siemens-Stecker abgemacht. Hier ein Bild des Original-Steckers:
(Bild von Webseite http://www.s65.info/USB-Kabel-Umbau.1050.0.html )
Hier die Layout-Belegung: http://pinouts.ru/CellularPhones-P-W/siemens_c55_pinout.shtml
Wir brauchen die Pins 2, 3 und 4, den Rest der Kabel kann man abschneiden. Achtung: verlasst euch nicht auf die Farben der Kabel, die sind von Hersteller zu Hersteller anders, nur die Belegung am Original-Stecker ist maßgebend! Bei meinem Modell war GND rot, rx blau und tx weiß, das kann bei Euch anders sein! Im Zweifelsfall messt einfach mit einem Multimeter nach, wenn Ihr die richtigen Kabel erwischt habt, dürfen max. 2,3 Volt zwischen den Kabeln anliegen. Wenn Ihr 5 Volt messt, dann habt Ihr das falsche Kabel! (Solltet ihr das falsche Kabel angeschlossen haben hattet ihr einen funktionierenden Router!) Wenn Ihr die drei richtigen Kabel erwischt habt, dann stellt sich die Frage: wie bekomme ich diese Kabel an meinen WGT? Ich habe mir einen alten Audio-Stecker vom CD-Laufwerk genommen und passend abgeschnitten und die Kabel verdrillt, der passt Stecker genau auf die Steckerleiste des WGT.
serielle Konsole
Belegung von unten nach oben gesehen, wenn man von vorne auf den WGT schaut, so das die Pinleiste rechts liegt:
1: Masse
2: rx
3: tx
4: frei
Die Konsole am Computer auf 115200 einstellen. Ich nutzte dazu Minicom, /dev/ttyUSB0. Die zweite Schnittstelle sitzt genau daneben, nur sind leider keine Stifte heraus geführt. Mit etwas löten ist aber auch diese Schnittstelle nutzbar.
FreeWRT
von http://www.freewrt.org, entweder mit dem super webbuilder ein image zusammen klicken oder selbst compilieren. Es geht beides, supergut und einfach. Einfach den Anleitungen auf der Webseite folgen. Ich habe Version 1.0 von Imagebuilder und Version 1.0.3 als selbst kompilierte Version getestet, ging beides auf Anhieb.
flash
* einen tftp- Server aufsetzen, ich hatte dazu atftpd. Das gebaute oder herunter geladene Image ins /tftpboot/ verschieben, serielle Schnittstelle anschließen, den roter neu booten. Dann sehr schnell nach dem booten <strg>+<c> drücken, damit man ins "Bios" des roters kommt. Ihr solltet so etwas sehen:
CFE version 1.0.34 for BCM95365R (32bit,SP,LE) Build Date: Tue Feb 24 03:21:41 CST 2004 (root@jackylinux) Copyright (C) 2000,2001,2002 Broadcom Corporation. Add MAC client version(DNI). Initializing Arena. Initializing Devices. et0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller CPU type 0x29007: 200MHz Total memory: 0x2000000 bytes (32MB) Total memory used by CFE: 0x81BB1280 - 0x82000000 (4517248) Initialized Data: 0x81BB1280 - 0x81BB3E90 (11280) BSS Area: 0x81BB3E90 - 0x81BB45D0 (1856) Local Heap: 0x81BB45D0 - 0x81FB45D0 (4194304) Stack Area: 0x81FB45D0 - 0x81FB65D0 (8192) Text (code) segment: 0x81FB65E0 - 0x81FFFFB0 (301520) Boot area (physical): 0x01B70000 - 0x01BB0000 Relocation Factor: I:E23B65E0 - D:01BB0280 configure vlans ***************************************************************** *********************** VLAN Driver initial ******************** ***************************************************************** Process LAN port(2-5) vlan Architecture... SUCCESS: trying to create VLAN 0 for switch SUCCESS: trying to add LAN port Process WAN port(2-5) vlan Architecture... SUCCESS: trying to create VLAN 0 for switch SUCCESS: trying to add WAN port SUCCESS: enable ports success configure vlans...done Automatic startup canceled via Ctrl-C CFE> ^C CFE> ^C CFE> ^C CFE>
so, jetzt kann die neue Firmware aufgespielt werden. Mein TFTP-Server hat übrigens die IP 192.168.123.254, das müsst Ihr natürlich anpassen. BTW: es gibt den Befehl "help":
CFE>
CFE> help
Available commands:
copydisk Copy a remote disk image to a local disk device via TFTP
setup Setup configuration defaults
reset Reset the system
reboot Reset the system
fprobe reprobe for flash devices
envdev set environment device
test fatfs Do a FAT file system test
test disk Do a disk test, read/write sectors on the disk
test timer Test the timer
set console Change the active console device
loop Loop a command
flash Update a flash memory device
memtest Test memory.
f Fill contents of memory.
e Modify contents of memory.
d Dump memory.
u Disassemble instructions.
autoboot Automatic system bootstrap.
batch Load a batch file into memory and execute it
go Start a previously loaded program.
boot Load an executable file into memory and execute it
load Load an executable file into memory without executing it
save Save a region of memory to a remote file via TFTP
ping Ping a remote IP host.
arp Display or modify the ARP Table
ifconfig Configure the Ethernet interface
show flash Display information about a flash device.
show boot Display boot block from device,
show heap Display information about CFE's heap
show memory Display the system physical memory map.
show devices Display information about the installed devices.
unsetenv Delete an environment variable.
printenv Display the environment variables
setenv Set an environment variable.
help Obtain help for CFE commands
For more information about a command, enter 'help command-name'
*** command status = 0
CFE>
CFE> help ifconfig
SUMMARY
Configure the Ethernet interface
USAGE
ifconfig device [options..]
Activates and configures the specified Ethernet interface and sets its
IP address, netmask, and other parameters. The -auto switch can be used
to set this information via DHCP.
OPTIONS
-auto Configure interface automatically via DHCP
-off Deactivate the specified interface
-addr=* Specifies the IP address of the interface
-mask=* Specifies the subnet mask for the interface
-gw=* Specifies the gateway address for the interface
-dns=* Specifies the name server address for the interface
-domain=* Specifies the default domain for name service queries
-speed=* Sets the interface speed (auto,10fdx,10hdx,
100fdx,
100hdx,1000fdx,1000hdx)
-loopback=* Sets the loopback mode (off,internal,external) External
loopback causes the phy to be placed in loopback mode
-hwaddr=* Sets the hardware address (overrides environment)
*** command status = 0
CFE>
CFE> help flash
SUMMARY
Update a flash memory device
USAGE
flash [options] filename [flashdevice]
Copies data from a source file name or device to a flash memory device.
The source device can be a disk file (FAT filesystem), a remote file
(TFTP) or a flash device. The destination device may be a flash or eeprom.
OPTIONS
-noerase Don't erase flash before writing
-offset=* Begin programming at this offset in the flash device
-size=* Size of source device when programming from flash to flash
-noheader Override header verification, flash binary without checking
*** command status = 0
CFE>So, genug Hilfe gelesen, jetzt holen wir uns eine IP, manuelles konfigurieren geht natürlich auch, siehe hilfe...
CFE>
CFE>
CFE> ifconfig eth0 -auto
Device eth0: hwaddr 00-0F-B5-97-28-C9, ipaddr 192.168.123.160, mask 255.255.255.0
gateway 192.168.123.254, nameserver 192.168.123.254
*** command status = 0Dann flashen wir. Achtung, das dauert ein oder zwei Minuten, nicht abbrechen!!!
CFE> flash -noheader 192.168.123.254:image.bin flash0.os Reading 192.168.123.254:image.bin: Done. 3670016 bytes read Programming...
Hier steht dann der Router. Schaltet das Ding nicht aus!! Wartet einfach. Das dauert. Irgendwann gehts dann weiter, Die komplette Ausgabe des Routers nach dem flashen sieht dann so aus:
CFE> flash -noheader 192.168.123.254:image.bin flash0.os Reading 192.168.123.254:image.bin: Done. 3670016 bytes read Programming...done. 3670016 bytes written *** command status = 0 CFE>
Fein, hat geklappt. Nun den Router mit folgenden Befehl neu booten:
CFE> reboot CFE version 1.0.34 for BCM95365R (32bit,SP,LE) Build Date: Tue Feb 24 03:21:41 CST 2004 (root@jackylinux) Copyright (C) 2000,2001,2002 Broadcom Corporation. Add MAC client version(DNI)....... ... ... ...
Und dann habt Ihr so etwas hübsches vor Euch:
______ _ ______ ______
/ ____/_______ ___| | / / __ \/_ __/
/ /_ / ___/ _ \/ _ \ | /| / / /_/ / / /
/ __/ / / / __/ __/ |/ |/ / _, _/ / /
/_/ /_/ \___/\___/|__/|__/_/ |_| /_/
---- functional and secure GNU/Linux distribution ----
-------------- version 1.0.3 -------------------------
If you like to permanently change files in /etc,
do not forget to write it to flash with "fwcf commit".
root@FreeWRT:/#