一直想玩玩openwrt,调研了一下 HG556a尽管散热很烂,但性价比超高,于是淘宝入手一台A版,A版和C版区别为wifi芯片:
到货后在网上找了几个教程便开始动手刷openwrt,但刷机的过程中还是碰到不少问题。
刷机
无论是官方教程还是个人博客的教程都有提到:
但仅此操作中没有提及HG556a在进入刷机模式后Lan无dhcp和没有无线SSID。另外路由器到手时,默认网关是192.168.0.1,而刷机时是192.168.1.1。在折腾很久很,尝试手动配置IP,并用网线连接笔记本和Lan,才进入刷机界面。
笔记本有线网卡静态IP如下:
配好后,用有线连上HG556a,测试连通性:
此时方能正常连接HG556a,用浏览器打开固件升级界面 http://192.168.1.1:
从openwrt官网上下载HG556a的openwrt固件(HG556a A版和C版都使用该固件),点击下载openwrt-HW556-squashfs-cfe.bin
点击上图中的“选择文件”选中下载好后的固件,点击“update software”,如下图所示
登陆
待路由器重启后,保持笔记本和HG556a连接方式不变,使用putty登陆HG556a(windows 8 不自带telnet),如下图:
登陆后即提示修改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”网段:
同上,重启network即生效。
启用无线
HG556a的官方openwrt固件没有包含无线网卡的驱动,因此无法进行无线连接。下面开始安装无线驱动。
首先将openwrt软件包管理系统opkg进行更新:
然后安装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一样
来源:https://www.cnblogs.com/yjunzhang/p/hg556a-openwrt.html