Aruba Instant On AP11をUnified APとして使う

しばらく前に Aruba Instant On AP11 が特価販売されており,自宅用に 2 台購入した.
そのまま使っても十分すぎるほど良い AP だが,個人的には LAN 内のネットワーク機器の管理がクラウドサービスに依存している点は好ましくないと思い,LAN 内の Virtual Controller で管理できる Unified AP (旧称 Instant AP; IAP) 化をしてみた.

追記:Instant AP (IAP) を Unified AP の旧称として紹介していたが,これは誤解だった.仮想コントローラ機能のみ対応のものが Instant AP,仮想コントローラ + コントローラの両対応が Unified AP であるらしい.

Aruba Instant On AP11 = Aruba AP-303

AP11 は Unified AP である AP-303 とほぼ同じハードウェアであり,外装とファームウェアだけが異なる. 実際,AP11 のラベルには Model: APIN0303 と書かれており,また,技術基準適合証明番号は AP11 と AP-303 のどちらも 018-170421 であり区別されていない.

Aruba Instant On AP11 の Aruba AP-303 Unified AP 化

AP11 で AP-303 のファームウェアを起動することにより,AP11 の Unified AP 化が可能である.

Unified AP 化にはシリアルコンソールケーブル,TFTP サーバと AP-303 のファームウェアイメージが必要である.

シリアルコンソールケーブルには自作のケーブルを使用した. AP11 のコンソール端子は USB Micro-B コネクタが使われているが,信号は 3.3V の UART が流れている. 純正のコンソールケーブルである AP-CBL-SERU を購入しない場合でも,USB ケーブルを加工して USB-UART に繋げることでケーブルを自作できる.

TFTP サーバは TFTPD64 を使用した.

AP-303 のファームウェアは,入手可能な最新版の ArubaInstant_Ursa_8.8.0.1_80393 を使用した. このファイルは TFTP サーバのルート直下に配置する.
(旧版のファームウェアの URL がここに記載されているので,参考にしてほしい.)

1. Unified AP のイメージでネットワークブートする

APBootのコンソールに落ちる

シリアルコンソールを接続して起動すると,ブートローダの APBoot が起動する.(APBootはU-Bootがベースらしい.)
Hit <Enter> to stop autoboot: 2 と表示されてから 2 秒以内にエンターキーを入力すると,自動起動せずにAPBootのコンソールに落ちる.
(シリアルコンソールの接続設定は 9600bps, 8 data bits, no parity, 1 stop bit)

APBoot 2.5.0.2 (build 70487)
Built: 2019-05-14 at 12:27:57

Model: AP11
DRAM:  512 MiB
Flash: Detected MX25R3235F: with write protection  total 4 MiB
NAND:  128 MiB
Power: DC
Net:   eth0
Radio: ipq4019#0, ipq4019#1
FIPS:  passed

Hit <Enter> to stop autoboot:  0
apboot> 

とりあえず factory_reset する

Instant On AP として使用すると APBoot の環境変数に設定が書き込まれてしまうので,設定を初期化しておく.

apboot> factory_reset
Clearing state...
Checking OS image and flags

Image is signed; verifying checksum... passed
Preserving image partition 0
Erasing flash sector @ 0x3a0000... OK
Erasing UBIFS ...done

Purging environment...
preserving os_partition (1)
Erasing SPI flash...Writing to SPI flash...done
Erasing SPI flash...Writing to SPI flash...done

printenv

環境変数を確認してみる.

apboot> printenv
autoload=n
autostart=yes
baudrate=9600
boardname=Speyburn
bootargs=console=ttyMSM0,9600n8 rdinit=/sbin/init ubi.mtd=aos0 ubi.mtd=aos1 ubi.mtd=ubifs
bootcmd=boot ap
bootdelay=2
bootfile=ipq40xx.ari
ethact=eth0
ethaddr=bc:9f:e4:xx:xx:xx
machid=8010001
mtddevname=aos0
mtddevnum=0
mtdids=nand0=nand0
mtdparts=mtdparts=nand0:0x2000000@0x0(aos0),0x2000000@0x2000000(aos1),0x4000000@0x4000000(ubifs)
os_partition=1
partition=nand0,0
servername=aruba-master
stderr=serial
stdin=serial
stdout=serial

Environment size: 535/65532 bytes

boardname に Speyburn とあるが,これは Aruba Instant AP 基本操作 Guide によると AP-303 のコードネームのようだ.

ネットワークブート

以後,TFTP サーバの IP アドレスを 192.168.100.2DHCP により AP11 に割り当てられた IP アドレスを 192.168.100.3 とする.

以下のコマンドで TFTP サーバから Unified AP のファームウェアを読み込み起動する.

dhcp
setenv serverip 192.168.100.2
setenv bootfile ArubaInstant_Ursa_8.8.0.1_80393
netget
bootm 0x84000200#Speyburn@1

初めに DHCP で AP にアドレスを割り振り,TFTP サーバの情報を環境変数に設定する.

apboot> dhcp
eth0 up: 1 Gb/s full duplex
DHCP broadcast 1
DHCP IP address: 192.168.100.3
DHCP subnet mask: 255.255.255.0
DHCP def gateway: 192.168.100.1
DHCP DNS server: 192.168.100.1
DHCP DNS domain:
apboot> setenv serverip 192.168.100.2
apboot> setenv bootfile ArubaInstant_Ursa_8.8.0.1_80393

次に,TFTP サーバからファームウェアを読み込む.
Instant On 向けのファームウェアではないため,Invalid Instant Small Business image とエラーメッセージが表示されるが,ここでは無視する.

apboot> netget
eth0 up: 1 Gb/s full duplex
Using eth0 device
TFTP from server 192.168.100.2; our IP address is 192.168.100.3
Filename 'ArubaInstant_Ursa_8.8.0.1_80393'.
Load address: 0x84000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###############################################################
         302.7 KiB/s
done
Bytes transferred = 20670464 (13b6800 hex)
Invalid Instant Small Business image

最後に,メモリ上のファームウェアから起動する. bootm コマンドにはカーネルのアドレスとして 0x84000200 を指定する.0x84000000 にあるファームウェアの先頭から 512 バイト分をスキップしているが,これはファームウェアイメージのバリデーションを回避するためである. APBoot は Image Tree Blob (ITB) 形式のイメージに署名等を追加したファームウェアイメージを読み込むが,AP11 で AP-303 のファームウェアを起動しようとするとバリデーションで失敗する. そこで,ヘッダーをスキップして ITB の先頭アドレスを指定することで,バリデーションを回避して ITB を直接読み込ませる. また,この ITB には複数機種の Device Tree Blob (DTB) が記録されているため,AP-303 の DTB を読み込むように #Speyburn@1 を追加する. これで AP11 上で AP-303 のファームウェアを起動できる.なお,Uncompressing Kernel Image ... の段階で 20 ~ 30 秒ほどかかる.

apboot> bootm 0x84000200#Speyburn@1
Uncompressing Kernel Image ... OK
[    0.000000]
[    0.000000] Aruba Networks
[    0.000000] ArubaOS Version 8.8.0.1-8.8.0.1 (build 80393 / label #80393)
[    0.000000] Built by p4build@pr-hpn-build10 on 2021-06-02 at 04:10:32 UTC (gcc version 4.6.3)
[    0.000000]
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.016595] SMP: Total of 4 processors activated (384.00 BogoMIPS).
[    0.051336] i2c-gpio driver registered
[   15.818085] 3 ofpart partitions found on MTD device 7980000.qcom,nand
[   15.885099] Creating 3 MTD partitions on "7980000.qcom,nand":
[   15.953838] 0x000000000000-0x000002000000 : "aos0"
[   16.052979] 0x000002000000-0x000004000000 : "aos1"
[   16.139632] 0x000004000000-0x000008000000 : "ubifs"
[   16.275167] m25p80 spi0.0: found mx25r3235f, expected n25q128a11
[   16.374448] Found AT97SC3203 on MSM-I2C-v2-adapter
[   16.429747] Key type dns_resolver registered
[   16.470423] Registering SWP/SWPB emulation handler
[   17.799425] Watchdog run with TZ supported gpio reset
[   17.882119]
Starting Kernel SHA1 KAT ...
[   17.916584] Completed Kernel SHA1 KAT
[   17.963611] Starting Kernel HMAC-SHA1 KAT ...
[   18.013646] Starting Kernel DES KAT ...[   18.059366] Completed Kernel DES KAT
[   18.103125] Starting Kernel AES KAT ...
[   18.146845] Completed Kernel AES KAT
[   18.146845]
[   18.210372] Starting Kernel AESGCM KAT ...
[   18.257187] Completed Kernel AESGCM KAT
[   18.306450] Completed Kernel HMAC-SHA1 KAT
Thu Jan  1 00:00:00 PST 1970
Populate AP type info
Domain Name: SetMeUp.arubanetworks.com
Current OEM Name : Aruba Networks
Disabling ipv6 for devices by default
AP-type has_ble_support: ONBOARD.
IPv6 capability is supported for devices
No panic info available
Enabling UDMD via nanny
Writing /dev/ttyMSM1 into /tmp/ble_port
Enabling ble_daemon and ble_relay via nanny
glenmorangie: Start hotplug
Backup ENV.
Installing glenmorangie ethernet driver
[   29.635327] edma module_init
Enter non-FIPS mode
Cfg len is 0
Configuration file is empty, turning on default services...
extended ssid activate due to no AP config ...
The AP is in factory default status
Mesh enabled
single uplink platform
Starting watchdog process...
Aruba watchdog daemon started [4 thread(s)]
touching file /tmp/ip_mode_0
Enable IPv6 for the Conductor v6 discovery
Enabling DHCPv6 ...
Checking country code.
[   34.716084] bond0: GMAC Link is up with phy_speed=1000
Ethernet uplink active. Becoming Mesh Portal
Mesh is DISABLED on this device.
extended ssid is activated on the platform ...
copying bootuplog ...
[   35.420084] uol: module license 'Proprietary' taints kernel.
[   35.505878] Disabling lock debugging due to kernel taint
[   35.570611] uol_init_driver:425 HW offload not applicable, AP will use cutting through path!
allow PAPI
set device anul0 mtu to 2000
notify asap_mod 3g no present...
Enabling IPv6 for devices... IP mode is v4-only...
apdot1x authentication is not enabled
LLDP not sent yet, DHCP is waiting
LLDP not sent yet, DHCP is waiting
LLDP not sent yet, DHCP is waiting
Starting DHCP
Getting an IP address...
Jan  1 00:00:21 udhcpc[4028]: udhcpc (v0.9.9-pre) started
Jan  1 00:00:21 udhcpc[4028]: send_discover: pkt num 0, secs 0
Jan  1 00:00:21 udhcpc[4028]: Sending discover...
Jan  1 00:00:21 udhcpc[4028]: send_selecting: pkt num 0, secs 256
Jan  1 00:00:21 udhcpc[4028]: Sending select for 192.168.100.3...
Jan  1 00:00:21 udhcpc[4028]: Lease of 192.168.100.3 obtained, lease time 259200
[   40.752825] ip_time_handler: Got ip and packets on bond0 Started conductor election 9-0, rand 15
[   41.342239] (08:00:22) !!! Init ---> Member
192.168.100.3 255.255.255.0 192.168.100.1
Compressing all files in the /etc/httpd directory...
Done.
Starting Webserver
bind: Transport endpoint is not connected
bind: Transport endpoint is not connected
bind: Transport endpoint is not connected
Put ntpdate to the nannylist.
AP rebooted caused by cold HW reset(power loss)
shutting down watchdog process (nanny will restart it)...

        <<<<<       Welcome to the Access Point     >>>>>

Completed SW FIPS KAT test
Power supply mode is DC, USB Modem is not present.
User: [   74.710824] Starting Kernel HMAC SHA1 FIPS KAT ...
[   74.753629] Completed Kernel HMAC SHA1 FIPS KAT
[   76.712818] Starting Kernel HMAC SHA256 FIPS KAT ...
[   76.757692] Completed Kernel HMAC SHA256 FIPS KAT
ble_ready NOT present @init ....
[   78.720805] Starting Kernel HMAC SHA384 FIPS KAT ...
[   78.765709] Completed Kernel HMAC SHA384 FIPS KAT
[   80.720801] Starting Kernel HMAC SHA512 FIPS KAT ...
[   80.765694] Completed Kernel HMAC SHA512 FIPS KAT
[  119.763872] asap_send_elected_conductor: sent successfully
[  120.342730] asap_send_elected_conductor: sent successfully

2. Unified AP のファームウェアを書き込む

手動で Unified AP のファームウェアを起動することができたが,毎回ネットワークブートをするのも面倒なので,AP-303 のファームウェアを焼く. 手順としては単純で,Virtual Controller にログインしてファームウェアの更新を実行するだけでよい.

初回ログイン時,ユーザ名は admin,パスワードはシリアル番号を入力するとログインできる.

f:id:v2n:20210811184057p:plain
Aruba ファームウェアの更新画面

更新後,ファームウェアが更新されていることを確認する.今回は Partition 0 に Unified AP 向けイメージが書き込まれた.

f:id:v2n:20210811184327p:plain
Aruba ファームウェアバージョンの確認

APBoot で osinfo コマンドを用いると,保存されているイメージについてより詳細な情報が得られる.

apboot> osinfo
Partition 0:
    image type: 0
  machine type: 48
          size: 20670464
       version: 8.8.0.1-8.8.0.1
  build string: ArubaOS version 8.8.0.1-8.8.0.1 for Ursa (p4build@pr-hpn-build10) (gcc version 4.6.3) #80393 SMP Wed Jun 2 04:10:32 UTC 2021
         flags: Instant preserve 0020
           oem: aruba
Invalid Instant Small Business image

Partition 1:
    image type: 0
  machine type: 48
          size: 24924852
       version: 2.3.1.0
  build string: ArubaOS version 2.3.1.0 for Ursa (p4build@pr-hpn-build04) (gcc version 5.3.0) #80532 SMP Wed Jun 16 17:11:33 UTC 2021
         flags: Instant preserve SMB
           oem: smbap

Image is signed; verifying checksum... passed
SHA2 Signature available
Signer Cert OK
Policy Cert OK
RSA signature verified using SHA2.

3. ブートローダの設定を変更する

Unified AP のファームウェアを書き込んだだけでは,次回起動時にバリデーションで不正なイメージと判定され,バックアップパーティションから元の Instant On のファームウェアを読み込んで起動してしまう. そこで,以下のコマンドで起動時の自動実行コマンドを変更し,バリデーションを回避するようにブートローダの設定を変更する.

setenv bootcmd "ubi part aos\${os_partition}; ubi read 0x84000000 aos\${os_partition}; bootm 0x84000200#${boardname}@1"
saveenv
reset

まず,APBoot で起動時に自動実行されるコマンドが設定された環境変数 bootcmd を書き換え,設定を保存する.

apboot> setenv bootcmd "ubi part aos\${os_partition}; ubi read 0x84000000 aos\${os_partition}; bootm 0x84000200#${boardname}@1"
apboot> saveenv
Saving Environment to SPI Flash...
Erasing SPI flash...Writing to SPI flash...done

bootcmd が正しく変更できたか確認する.

apboot> printenv bootcmd
bootcmd=ubi part aos${os_partition}; ubi read 0x84000000 aos${os_partition}; bootm 0x84000200#Speyburn@1

APBoot を再起動し,Unified AP のファームウェア自動起動できることを確認する.

apboot> reset
resetting ...


APBoot 2.5.0.2 (build 70487)
Built: 2019-05-14 at 12:27:57

Model: AP11
DRAM:  512 MiB
Flash: Detected MX25R3235F: with write protection  total 4 MiB
NAND:  128 MiB
Power: DC
Net:   eth0
Radio: ipq4019#0, ipq4019#1
FIPS:  passed

Hit <Enter> to stop autoboot:  0
No size specified -> Using max size (30855168)
Uncompressing Kernel Image ... OK
[    0.000000]
[    0.000000] Aruba Networks
[    0.000000] ArubaOS Version 8.8.0.1-8.8.0.1 (build 80393 / label #80393)
[    0.000000] Built by p4build@pr-hpn-build10 on 2021-06-02 at 04:10:32 UTC (gcc version 4.6.3)
[    0.000000]
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d

以上で Aruba Instant On AP11 を Aruba AP-303 Unified AP 化できた.