很久以前買的 fon 都只是拿來當一般 AP 用,但前一陣子感覺很不穩,就想說是不是掛了,因為每次摸它都很燙手~後來找問題找了半天,原來問題出在我的小黑 (ThinkPad X60) 上,因為 X60 的無線網卡 Intel 3945 ABG 舊的驅動程式的一個 bug,在於無線網卡的電源管理設定上,只要把電源管理設定為最大值,網路就不會斷斷續續了;而這個 bug 也在後續的新版 driver 中獲得改善。
好了,提外話,不過這也是我把 fon 的韌體刷成 dd-wrt 的起因,所以也不能說毫無關係~呵
接著就來說說改 dd-wrt 韌體的方法吧,基本上網路上有一堆教學,不論是國外的論壇、或是國內的網友自己的心得,多到我實在是不知道怎麼去刷成 dd-wrt。
後來剛好看到一個網站 http:/la-fon.blogspot.com 上面的一篇說明(英文),便照著說明一步一步做下來,耶~竟然成功了呢~
所以我就來紀錄一下我的步驟囉:
- 先下載兩個檔案:
- openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma
- out.hex
- DD-WRT 的 Image 檔案:linux.bin
(可以上 dd-wrt 找看看有沒有更新的版本,連結裡的是我使用的版本)
- PuTTY(或是 PieTTY):用來做 ssh 連線用的工具。
- telnet:用來做 telnet 連線用的工具,可用 windows 內建的 telnet 指令,或是直接用 putty/pietty 也可以。
- tftpd:用來做 tftp 服務的 server
(第一步驟的第三個檔案請跟 tftpd 的目錄放在一塊) - HFS: 作為檔案傳輸時的 server
(第一步驟的第一、第二個檔案請在 HFS 第一次執行後,在檔案上按右鍵選擇 Add to HFS)
- 先將本機電腦的區域網路設定為 ip=169.254.255.2 / mask=255.255.0.0,其餘不用設定。
- 將下列內容複製起來,存為 open-ssh-step1.html
<html>
<head>
</head>
<body>
<center>
<form method=”post” action=”http://169.254.255.1/cgi-bin/webif/connection.sh” enctype=”multipart/form-data”>
<input name=”username” value=”$(/usr/sbin/iptables -I INPUT 1 -p tcp –dport 22 -j ACCEPT)” size=”68″ >
<input type=”submit” name=”submit” value=”Submit” onClick=”{this.form.wifimode.value='”;’ + this.form.wifimode.value +’;”‘}” />
</form>
</body>
</html> - 再將下列內容複製起來,存成 open-ssh-step2.html
<html>
<head>
</head>
<body>
<center>
<form method=”post” action=”http://169.254.255.1/cgi-bin/webif/connection.sh” enctype=”multipart/form-data”>
<input name=”username” value=”$(/etc/init.d/dropbear)” size=”68″ >
<input type=”submit” name=”submit” value=”Submit” onClick=”{this.form.wifimode.value='”;’ + this.form.wifimode.value +’;”‘}” />
</form>
</body>
</html> - 在本機電腦上執行 open-ssh-step1.html,按下 submit 按鈕後,會跳出視窗要輸入帳號密碼,請輸入帳號 admin 以及密碼 admin。
- 接著執行 open-ssh-step2.html,也是一樣按下 submit 按鈕後,等到瀏覽器出現 fon 的管理視窗即可。
- 執行 PuTTY/PieTTY,連線到 169.254.255.1,輸入帳號 root 以及密碼 admin。
- 將 /etc/firewall.user 的第 22、23 行註解拿掉
# vi /etc/firewall.user - 把 fon 的 sshd 設定為開機即啟動
# cd /etc/init.d
# mv dropbear S50dropbear - 重新設定密碼以及同步一下
# passwd
# sync - 將 fon 重開後就再也不會自動去升級韌體了。
> cd /tmp
> wget http://169.254.255.2:8080/openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma
> mtd -e vmlinux.bin.l7 write openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma vmlinux.bin.l7
> reboot
> cd /tmp
> wget http://169.254.255.2:8080/out.hex
> mtd -e “RedBoot config” write out.hex “RedBoot config”
> reboot
C:\>telnet 192.168.1.254 9000
RedBoot>
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> 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 linux.bin
Using default protocol (TFTP)
Raw file loaded 0x80041000-0x806a0fff, assumed entry at 0x80041000
RedBoot> fis create linux
如果在 load -r -b 0x80041000 linux.bin 之後等了很久,那可能是你忘了啟動 tftpd,如果是這樣,那得退出 telnet 視窗,重新來過。
… Erase from 0xa8030000-0xa8690000: …………………………………………………………………………………………
… Program from 0x80041000-0x806a1000 at 0xa8030000: …………………………………………………………………………………………
… Erase from 0xa87e0000-0xa87f0000: .
… Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> fconfig
Run script at boot: true
Boot script:
.. fis load -l vmlinux.bin.l7
.. exec
Enter script, terminate with empty line
>> fis load -l linux
>> exec
>>
Boot script timeout (1000ms resolution): 10
Use BOOTP for network configuration: false
Gateway IP address:
Local IP address: 192.168.1.254
Local IP address mask: 255.255.255.0
Default server IP address:
Console baud rate: 9600
GDB connection port: 9000
Force console for special debug messages: false
Network debug at boot time: false
Update RedBoot non-volatile configuration – continue (y/n)? y
… Erase from 0xa87e0000-0xa87f0000: .
… Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> reset
完成了這一些設定,就可以好好的享受 fon + dd-wrt 所帶來的強大無線基地台的功能囉~~~雖然這有違當初 fon 創辦人的精神 >_<
September 14, 2009 at 5:40 pm
謝謝分享..已完成修改..OK了
但有一事要詢問 現在的版本 04/25/09
如要更新到較新的版本 以上的動作還要再來一次嗎..
還是用DD-WRT裡的更新來執行…問題多多 還請見諒.