Huawei HG556a A版 刷 openwrt


一直想玩玩openwrt,調研了一下 HG556a盡管散熱很爛,但性價比超高,於是淘寶入手一台A版,A版和C版區別為wifi芯片:

image

到貨后在網上找了幾個教程便開始動手刷openwrt,但刷機的過程中還是碰到不少問題。

刷機

無論是官方教程還是個人博客的教程都有提到:

斷電,按住restart,保持,插電,保持按住restart 10秒以上,只亮ed-power_red

但僅此操作中沒有提及HG556a在進入刷機模式后Lan無dhcp和沒有無線SSID。另外路由器到手時,默認網關是192.168.0.1,而刷機時是192.168.1.1。在折騰很久很,嘗試手動配置IP,並用網線連接筆記本和Lan,才進入刷機界面。

筆記本有線網卡靜態IP如下

21ia2)i6x$)a0plpp3]62nw

 

配好后,用有線連上HG556a,測試連通性:

sotchoii@5t$}}d`tey73vx

此時方能正常連接HG556a,用瀏覽器打開固件升級界面 http://192.168.1.1

wx$ac9a168ndlg%k4l]zk36

從openwrt官網上下載HG556a的openwrt固件(HG556a A版和C版都使用該固件),點擊下載openwrt-HW556-squashfs-cfe.bin

點擊上圖中的“選擇文件”選中下載好后的固件,點擊“update software”,如下圖所示

k{~siux1n43

此時,ed-power_red[7] 燈一閃一閃,當ed-power_red[7]常亮時,表示刷機成功。

登陸

待路由器重啟后,保持筆記本和HG556a連接方式不變,使用putty登陸HG556a(windows 8 不自帶telnet),如下圖:

image

登陸后即提示修改root密碼

配置

HG556a本身具有4個Lan口,但沒有Wan口,但默認配置中並沒有改變lan口,好在官方教程有將Lan4口(從1開始計數)配置成wan口,詳細配置為:

# path: /etc/config/network
# port 4 = WAN

config interface loopback
        option ifname   lo
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0

config interface lan
        option type     bridge
        option ifname   eth0.0
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0
        option nat      1

config interface wan
        option ifname 	eth0.1
        option macaddr 	00:11:22:33:44:55
        option proto 	dhcp 
        option defaultroute 1

config switch eth0
	option enable	1
	option reset	1
	option enable_vlan 1

config switch_vlan
	option device 	eth0
	option vlan 	0
	option ports 	"0 1 2 5t"

config switch_vlan
	option device 	eth0
	option vlan 	1
	option ports 	"3 5t"

從配置中可以看出eth0.1為原lan4口,現為wan口。將上述配置保持為/etc/config/network ,並執行“/etc/init.d/network restart”即可,(如果想修改網卡mac地址,直接修改該文件即可)。

官方固件默認開啟了DHCP,但修改DHCP地址池時,需要修改/etc/config/dhcp,如果只想修改dhcp的子網網段,可直接修改/etc/config/network,如下圖即為將原來的“192.168.1.0/24”網段修改成“192.168.123.0/24”網段:

clipboard

同上,重啟network即生效。

啟用無線

HG556a的官方openwrt固件沒有包含無線網卡的驅動,因此無法進行無線連接。下面開始安裝無線驅動。

首先將openwrt軟件包管理系統opkg進行更新:

clipboard[4]

然后安裝wifi芯片驅動,A版安裝(kmod-rt2800-pci),命令為:

opkg install kmod-rt2800-pci
 
執行后的日志為:
root@OpenWrt:~# opkg update
Downloading http://downloads.openwrt.org/snapshots/trunk/brcm63xx/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/barrier_breaker.
root@OpenWrt:~# opkg install kmod-rt2800-pci
Installing kmod-rt2800-pci (3.10.28+2014-01-23.1-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/brcm63xx/packages/kmod-rt2800-pci_3.10.28+2014-01-23.1-1_brcm63xx.ipk.
Installing kmod-rt2x00-pci (3.10.28+2014-01-23.1-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/brcm63xx/packages/kmod-rt2x00-pci_3.10.28+2014-01-23.1-1_brcm63xx.ipk.
Installing kmod-rt2x00-mmio (3.10.28+2014-01-23.1-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/brcm63xx/packages/kmod-rt2x00-mmio_3.10.28+2014-01-23.1-1_brcm63xx.ipk.
Installing kmod-rt2x00-lib (3.10.28+2014-01-23.1-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/brcm63xx/packages/kmod-rt2x00-lib_3.10.28+2014-01-23.1-1_brcm63xx.ipk.
Installing kmod-lib-crc-itu-t (3.10.28-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/brcm63xx/packages/kmod-lib-crc-itu-t_3.10.28-1_brcm63xx.ipk.
Installing kmod-eeprom-93cx6 (3.10.28-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/brcm63xx/packages/kmod-eeprom-93cx6_3.10.28-1_brcm63xx.ipk.
Installing kmod-rt2800-lib (3.10.28+2014-01-23.1-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/brcm63xx/packages/kmod-rt2800-lib_3.10.28+2014-01-23.1-1_brcm63xx.ipk.
Installing kmod-rt2800-mmio (3.10.28+2014-01-23.1-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/brcm63xx/packages/kmod-rt2800-mmio_3.10.28+2014-01-23.1-1_brcm63xx.ipk.
Configuring kmod-lib-crc-itu-t.
Configuring kmod-rt2x00-lib.
Configuring kmod-rt2800-lib.
Configuring kmod-eeprom-93cx6.
Configuring kmod-rt2x00-mmio.
Configuring kmod-rt2x00-pci.
Configuring kmod-rt2800-mmio.
Configuring kmod-rt2800-pci.
root@OpenWrt:~#

 

重啟路由器即出現SSID為openwrt的無線信號,dhcp地址池同lan一樣

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM