2010/05/16

FON2100EのRedBootの入り方

既にDD-WRTが導入されているFONにOpenWrtを焼く際にかなりハマったのでメモしておく

参考
C#学習メモ帳 & PC雑記: Fon2200 DD-WRT ファームウェアアップグレード失敗から復活
Firmware Update Instructions - FON Wiki Beta
Wolf Paulus' Web Journal
2009-01-05 - 日々のあれこれ -

・FONの電源を切る
・FONとPCを直接接続する
・PCのファイアウォールは切っておく
・RedBootからOpenWRTのインストールにはfping、nc、telnet、tftp-serverが必要
・ファームウェアを予めダウンロードしておく
 (openwrt-atheros-root.squashfs、openwrt-atheros-vmlinux.lzma)
・PCのIPアドレスは192.168.1.x以外では受け付けてくれない
・RedBootは192.168.1.254で起動する



# sudo yum install -y fping nc telnet tftp-server
# mv openwrt-atheros-* /var/lib/tftpboot/
# vi /etc/xinetd.d/tftp
disable=noに書き換える
# service xinetd restart
# ifconfig eth0 192.168.1.166



$ echo -e "\0377\0364\0377\0375\0006" >break.bin
$ while true; do fping -t 200 192.168.1.254 && break; done; nc -vvv 192.168.1.254 9000 <break.bin; telnet 192.168.1.254 9000


上記コマンドを実行してからFONの電源を入れるとこんな感じになる

192.168.1.254 is unreachable
ICMP Host Unreachable from 192.168.1.166 for ICMP Echo sent to 192.168.1.254
ICMP Host Unreachable from 192.168.1.166 for ICMP Echo sent to 192.168.1.254
ICMP Host Unreachable from 192.168.1.166 for ICMP Echo sent to 192.168.1.254
192.168.1.254 is unreachable
192.168.1.254 is unreachable
ICMP Host Unreachable from 192.168.1.166 for ICMP Echo sent to 192.168.1.254
ICMP Host Unreachable from 192.168.1.166 for ICMP Echo sent to 192.168.1.254
ICMP Host Unreachable from 192.168.1.166 for ICMP Echo sent to 192.168.1.254
192.168.1.254 is unreachable
192.168.1.254 is unreachable
ICMP Host Unreachable from 192.168.1.166 for ICMP Echo sent to 192.168.1.254
ICMP Host Unreachable from 192.168.1.166 for ICMP Echo sent to 192.168.1.254
ICMP Host Unreachable from 192.168.1.166 for ICMP Echo sent to 192.168.1.254
192.168.1.254 is unreachable
192.168.1.254 is unreachable
ICMP Host Unreachable from 192.168.1.166 for ICMP Echo sent to 192.168.1.254
ICMP Host Unreachable from 192.168.1.166 for ICMP Echo sent to 192.168.1.254
ICMP Host Unreachable from 192.168.1.166 for ICMP Echo sent to 192.168.1.254
192.168.1.254 is unreachable
192.168.1.254 is unreachable
192.168.1.254 is alive
Connection to 192.168.1.254 9000 port [tcp/cslistener] succeeded!
== Executing boot script in 9.880 seconds - enter ^C to abort
Trying 192.168.1.254...
Connected to 192.168.1.254.
Escape character is '^]'.
RedBoot>


IPアドレスの設定 & 試しにpingしてみる

RedBoot> ip_address -l 192.168.1.254/24 -h 192.168.1.166
IP: 192.168.1.254/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.1.166
RedBoot> ping -v -n 3 -h 192.168.1.166
Network PING - from 192.168.1.254 to 192.168.1.166
seq: 1, time: 0 (ticks)
seq: 2, time: 0 (ticks)
seq: 3, time: 0 (ticks)
PING - received 3 of 3 expected


フラッシュの初期化 & 書き込み(fis create ~ は時間が掛かる)、再起動

RedBoot> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> load -r -b 0x80041000 openwrt-atheros-root.squashfs
Using default protocol (TFTP)
Raw file loaded 0x80041000-0x801e0fff, assumed entry at 0x80041000
RedBoot> fis create -l 0x06f0000 rootfs
... Erase from 0xa8030000-0xa8720000: ...............................................................................................................
... Program from 0x80041000-0x801e1000 at 0xa8030000: ..........................
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> load -r -b 0x80041000 openwrt-atheros-vmlinux.lzma
Using default protocol (TFTP)
Raw file loaded 0x80041000-0x80100fff, assumed entry at 0x80041000
RedBoot> fis create -r 0x80041000 -e 0x80041000 vmlinux.bin.l7
... Erase from 0xa8720000-0xa87e0000: ............
... Program from 0x80041000-0x80101000 at 0xa8720000: ............
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> reset


再起動後は 192.168.1.1 でOpenWRTが起動しているのでtelnetで接続できる

$ telnet 192.168.1.1
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.
=== IMPORTANT ============================
Use 'passwd' to set your login password
this will disable telnet and enable SSH
------------------------------------------


BusyBox v1.11.2 (2009-12-02 11:25:47 UTC) built-in shell (ash)
Enter 'help' for a list of built-in commands.

_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
KAMIKAZE (8.09.2, r18961) -------------------------
* 10 oz Vodka Shake well with ice and strain
* 10 oz Triple sec mixture into 10 shot glasses.
* 10 oz lime juice Salute!
---------------------------------------------------
root@OpenWrt:/#


インストール後の設定で参考になりそうな所
FONルータ「La Fonera 2.0」を小型Linux機に改造してみる - hardware - 釣堀.net
OpenWRT化した「La fonera 2.0」にUSB-HDをマウントする - hardware - 釣堀.net
The T World » OpenWrt on La fonera Tips
日々雑感 OpenWRTのネットワーク設定を変更する(FON2100E)
OpenWrt - PukiWiki
The UCI System - OpenWrt Wiki

0 件のコメント:

コメントを投稿