2015年6月21日日曜日

Netgear WG302 へ OpenWrt Attitude Adjustment (12.09) をインストール

昨日シリアルコンソールの接続を確認したネットギア WG302 へ OpenWrt Attitude Adjustment (12.09) をインストールしました。

OpenWrt をインストールした Netgear WG302 です。

OpenWrt のインストール

インストールの方法は OpenWrt の公式 WIKI に記載されている通りの手順で行いました。シリアルコンソールの操作によって TFTP サーバからカーネルとファイルシステムの二つのファイルを吸い上げて、フラッシュメモリへ書き込むことでインストールを行う手法です。なお事前にカーネルとファイルシステムは TFTP サーバに準備をしています。
Netgear WG302 [OpenWrt Wiki]
http://wiki.openwrt.org/toh/netgear/wg302

このインストールの前に Mini PCI スロットへは、無線 LAN カードとしてアルプス電気 ALPJ1-3 を仮に設置して行いました。この ALPJ1-3 には、以前搭載されていた無線 LAN カードと同じ Atheros AR5212A が搭載されているため、相性がよいものと判断したためです。

仮に取り付けた アルプス電気 ALPJ1-3 です。

RedBoot 上での操作

以下はシリアルコンソールの RedBoot 上で行った操作です。一部公式 WIKI とは違った手順や設定を行なっていますので注意してください。

まず最初に我が家の家庭内 LAN に参加させるために IP アドレスの設定を行います。
RedBoot> ip_address -l 192.168.24.51
IP: 192.168.24.51/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.0.10, DNS server IP: 0.0.0.0

次に TFTP サーバ(192.168.24.100)を設定します。本来なら上記の IP アドレスの設定で同時に設定できるはずなのですが、同時に設定出来なかったため、別々に設定しています。
RedBoot> ip_address -h 192.168.24.100
IP: 192.168.24.51/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.24.100, DNS server IP: 0.0.0.0

カーネルを TFTP サーバから読み込みます。
RedBoot> load -r -b %{FREEMEMLO} openwrt-wg302v1-zImage
Using default protocol (TFTP)
Raw file loaded 0x0001fc00-0x00105547, assumed entry at 0x0001fc00

フラッシュメモリを初期化します。
RedBoot> fis init -f
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0x50060000-0x507c0000:
...........................................................
... Erase from 0x507e0000-0x507e0000:
... Erase from 0x50800000-0x50800000:
... Unlock from 0x507e0000-0x50800000: .
... Erase from 0x507e0000-0x50800000: .
... Program from 0x0ffdf000-0x0ffff000 at 0x507e0000: .
... Lock from 0x507e0000-0x50800000: .

フラッシュメモリへカーネルを書き込みます。
RedBoot> fis create kernel
... Erase from 0x50060000-0x50160000: ........
... Program from 0x0001fc00-0x00105548 at 0x50060000: ........
... Unlock from 0x507e0000-0x50800000: .
... Erase from 0x507e0000-0x50800000: .
... Program from 0x0ffdf000-0x0ffff000 at 0x507e0000: .
... Lock from 0x507e0000-0x50800000: .

ファイルシステムを TFTP サーバから読み込みます。
RedBoot> load -r -b %{FREEMEMLO} openwrt-ixp4xx-generic-squashfs.img
Using default protocol (TFTP)
Raw file loaded 0x0001fc00-0x001ffbff, assumed entry at 0x0001fc00

ファイルシステムをフラッシュメモリへ書き込みます。
RedBoot> fis create -r  0x0001fc00 -l 0x620000 rootfs
... Erase from 0x50160000-0x50780000:
.................................................
... Program from 0x0001fc00-0x001ffc00 at 0x50160000: ...............
... Unlock from 0x507e0000-0x50800000: .
... Erase from 0x507e0000-0x50800000: .
... Program from 0x0ffdf000-0x0ffff000 at 0x507e0000: .
... Lock from 0x507e0000-0x50800000: .

起動スクリプトの設定を行います。なお青字の部分は古い起動スクリプトが示された部分です。そして赤色の部分は今回設定した起動スクリプトです。この設定の途中でシリアル接続の通信速度を 9600bps から 115200bps へ変更しました。その他は初期値のままです。
RedBoot> fconfig
Run script at boot: true
Boot script:
.. fis load -b 0x01600000 ixp425
.. exec 0x0160004c
Enter script, terminate with empty line
>> fis load -b 0x01600000 kernel
>> exec 0x01600000
>>
Boot script timeout (1000ms resolution): 2
Use BOOTP for network configuration: false
Gateway IP address:
Local IP address: 192.168.0.35
Local IP address mask: 255.255.255.0
Default server IP address: 192.168.0.36
Configuration File Name: config.bin
Console baud rate: 115200
DNS server IP address:
GDB connection port: 9000
Force console for special debug messages: false
Main FW File Length: 0x600000
Main FW File Name: wg302.rmt
Network debug at boot time: false
Default network device: npe_eth0
Product Name:
Network hardware address [MAC] for NPE: 0x00:0x0F:0xB5:0x71:0x19:0x97
... Unlock from 0x507c0000-0x507c1000: .
... Erase from 0x507c0000-0x507c1000: .
... Program from 0x0ffd2000-0x0ffd3000 at 0x507c0000: .
... Program from 0x0ffd2000-0x0ffd3000 at 0x507c1000: .
... Lock from 0x507c0000-0x507c1000: .

以上でインストールは終了です。

電源の再投入か、以下の再起動コマンドを実行して、新しいカーネルで起動をさせます。
RedBoot> reset

OpenWrt の設定

WG302 が再起動したところで、WA302 の LAN ポートとパソコンを接続します。そして 192.168.1.1 へブラウザでアクセスすると OpenWrt の設定画面へアクセスできます。なおログインには、ユーザ名:root、パスワード:admin が必要です。

WG302 へインストールした OpenWrt の設定画面です。

意外なことですが、FON2100E や FON2201 では国コード(Country Code)を "JP" に設定しても、12, 13 チャンネルを設定することが出来ませんでしたが、この WG302というか ALPJ1-3 では 12, 13 チャンネルを指定することができました。

1 件のコメント:

  1. Found this discription her and followed steps. But for some reason it hang. It's a WG302v2.

    ÿEthernet eth0: MAC address 00:22:3f:e9:34:28
    IP: 192.168.0.3/255.255.255.0, Gateway: 0.0.0.0
    Default server: 192.168.0.2, DNS server IP: 0.0.0.0

    RedBoot(tm) bootstrap and debug environment [ROM]
    Red Hat certified release, version 1.92p1 - built 19:33:59, May 22 2006

    Platform: Netgear WG302 (XScale)
    Copyright (C) 2000, 2001, 2002, Red Hat, Inc.

    RAM: 0x00000000-0x02000000, 0x0001f9e0-0x01fd1000 available
    FLASH: 0x50000000 - 0x50800000, 64 blocks of 0x00020000 bytes each.
    == Executing boot script in 5.000 seconds - enter ^C to abort
    RedBoot> fis load -b 0x01600000 kernel
    RedBoot> exec 0x01600000
    Using base address 0x01600000 and length 0x000e5948

    Thats alli get from console. BTW, did not change bautrate as suggestet, left at 9600bps.

    Any hint?

    返信削除

注: コメントを投稿できるのは、このブログのメンバーだけです。