前幾天把一台貝爾金 Belkin F5D7230-4 v1444 韌體更新到DD-WRT V23-SP2 micro generic 版, 趁著記憶猶新把過程記錄下來, 資料參考:
小弟改刷DD-WRT 的最主要目的在於無線功率調整, 至於刷成功後, 預設連線數僅512, 這應該是受限於只有8MB 記憶體, 所以建議降低UDP time out, 以便迅速釋放記憶體
由於沒另外準備交換器, 所以小弟已經預期會遇上Windows 網卡 "備妥" 的問題, 此問題小弟也曾在其他文章提及, 主要就是網卡和分享器實體連接之後, Windows 仍需數秒鐘的時間建立TCP/IP 連線, 其中主要花在Link Speed & Duplex Negotiation 和Windows TCP/IP Media Sensing, 前者可由網卡的進階內容調整, 後者可由登錄檔修改, 由於DD-WRT 安裝教學已經確定TFTP 可行, 所以小弟並未嘗試以原廠Web GUI 升級, 以免節外生枝
首先小弟研判Media Sensing 的影響可能比較大, 所以先把它關閉, 再斷開WAN, 並重置分享器回到出廠預設值, 網卡設定成Dual-IP "192.168.1.2/24" & "192.168.2.2/24", 前者用於升級DD-WRT 成功之後, 後者為暫時針對Belkin 原廠韌體, Multi-IP 可由TCP/IP 的進階內容設定, Windows 桌面上一共開啟三個視窗, 瀏覽器登入Belkin Web GUI 192.168.2.1, 用來觀察分享器重啟過程, "fping" 密集連續ping 192.168.2.1, DD-WRT 網友tornado 修改過的Linksys tftp2.exe 則準備好以DD-WRT V23-SP2 micro generic 版韌體刷新, 由於原廠CFE Boot_Wait 可能只有1~2 秒之間, 所以用此方法必須眼明手快, 先由Web GUI 重新啟動分享器數次, 觀察fping 結果的變化, 看起來應該類似於:
C:\>
fping 192.168.2.1 -T -c -w 500 -t 500
Fast pinger version 2.20
(c) Wouter Dhondt (
http://www.kwakkelflap.com)
Pinging 192.168.2.1 with 32 bytes of data every 500 ms:
18:55:03 : Reply[1] from 192.168.2.1: bytes=32 time=2.3 ms TTL=64
18:55:03 : Reply[2] from 192.168.2.1: bytes=32 time=2.5 ms TTL=64
18:55:04 : Reply[3] from 192.168.2.1: bytes=32 time=2.2 ms TTL=64
18:55:05 : 192.168.2.1: request timed out
18:55:05 : 192.168.2.1: request timed out
18:55:06 : 192.168.2.1: request timed out
18:55:06 : 192.168.2.1: request timed out
18:55:07 : 192.168.2.1: request timed out
18:55:07 : 192.168.2.1: request timed out
18:55:07 : Reply[10] from 192.168.2.1: bytes=32 time=6.9 ms TTL=100
18:55:08 : Reply[11] from 192.168.2.1: bytes=32 time=5.7 ms TTL=100
18:55:08 : Reply[12] from 192.168.2.1: bytes=32 time=2.8 ms TTL=100
18:55:09 : 192.168.2.1: request timed out
18:55:10 : 192.168.2.1: request timed out
18:55:10 : 192.168.2.1: request timed out
以上可看出CFE 啟動約需2~3 秒, Boot_Wait 大約有1 秒, 掌握節奏之後, 於 "request timed out" 又重新 "Reply" 之際, 立刻按下tftp2 "Upgrade", 此法嘗試了數次, 都不成功, 肯定仍然超過CFE 等候的時間, 於是又手動調整網卡速率為 "10Mbps/Full Duplex", 接著便一試成功
小弟以Web GUI Reboot 取代分享器關機再開 (Power Cycle) 的理由是盡量減少對於網卡 "備妥" 的影響, 這點可由 "fping" 結果看出, 以下是小弟針對此流程所寫的韌體自動TFTP 更新批次檔, 請將fping.exe, 韌體以及此批次檔複製於同一個資料夾, 執行此批次檔之前, 請先登入分享器的Web GUI, 以下未經嚴格測試, 考慮未免不夠周詳, 敬請不吝批評指教
FW_UPG.BAT
語法:
@echo off
echo Router Firmware Auto TFTP Upgrade Procedure for Windows v1.1
echo ==============================================================
echo Syntax: %0 [host_ip] [firmware]
echo --------------------------------------------------------------
echo a) Login to Web GUI of the router before running this batch.
echo b) Press any key from this window to start pinging the router.
echo c) Select "Reboot" from Web GUI of the router.
echo d) Do Not power cycle the router during this procedure.
echo --------------------------------------------------------------
echo Requirements: Fping from http://www.kwakkelflap.com/fping.html
echo --------------------------------------------------------------
echo Copyleft: FYI@PCZONE
echo =====================
setlocal
rem Adjust init_timer to less than half of the time out period of "fping [host_ip] -T -c -w 1000 -t 1000" while rebooting.
rem Adjust short_timer to less than half of the Boot_Wait period.
set init_timer=1500
set short_timer=400
if %1. == . goto end
echo .
if %2. == . goto error3
if not %3. == . goto error3
if not exist %2 goto error2
fping %1 -l -n 1 -w %short_timer% >nul
if errorlevel 1 goto error1
echo Press Ctrl-C at anytime to stop.
break on
pause
echo Check if router reboot...
:stage1
fping %1 -l -T -n 1 -w %init_timer%
if errorlevel 1 goto stage2
goto stage1
:stage2
echo Router rebooting...
:stage3
fping %1 -l -T -n 1 -w %short_timer%
if errorlevel 1 goto stage3
break off
echo ****** Start TFTP. Do not interrupt. ******
echo on
tftp -i %1 PUT %2
echo off
echo .
echo If the tftp result is "Transfer successful", please reload the "New" Web GUI.
echo Otherwise, please restart the flash procedure.
goto end
:error1
echo IP address "%1" doesn't exist or router doesn't power on. Also check if Fping.exe exists.
goto end
:error2
echo Firmware "%2" doesn't exist.
goto end
:error3
echo Syntax error.
:end
endlocal
請先保持分享器正常啟動狀態, 不需預先恢復出廠值, 然後執行 "FW_UPG.BAT", 按任何鍵繼續, 再由WebGUI 重新啟動分享器, 接著就是自動偵測自動更新, 首次更新成功後分享器的 IP 會改為為 "192.168.1.1", 請立刻修改無線加密方式
書籤