Orange Pi 5でデータディスクとしてならM.2 SATAも使える


Orange Pi 5で、M.2 SATAを利用する方法がある、という情報をいただきました。

(2023/01/05追記: M.2 NVMe SSDでLinuxを起動する記事はこちら→Orange Pi 5 が届いた)
(2023/01/08追記: M.2 SATA SSDからLinux/Androidが起動できるようになりました→Orange Pi 5でAndroid/Linux共にM.2 SATA SSDから起動できるようになった)

Orange Pi純正のUbuntuに入っているorangepi-configに設定がある、ということ。

「sudo orangepi-config」で起動して、[System]-[Hardware]を開くと、「ssd-sata」というモジュールがあります。

これにチェックを入れて保存し、再起動するとM.2 SATAを認識するようになります。

デバイスは/dev/sdaとして認識します。

ただし、現状、microSDからUbuntuを起動し、データディスクとしてM.2 SATAを起動できる、という状態です。

M.2 SATA を起動ディスクとして使うことはできませんでした。

Orange Pi 5をAndroid 12で動かす


2022/12/20時点で使えるOrange Pi 5のOSは、Ubuntu, Debian, Android 12。

Orange Pi (Droid)はリンクはあるもののファイル自体は存在していないという残念な状態

microSDで起動させる場合のAndroid 12はSDDiskTool_v1.72.zipに含まれているSD_Firmware_Tool.exe から書き込む。

中国語インタフェース…

config.iniを開いて「Selected=1」を「Selected=2」に替えたら英語インタフェースになった

まず「SD Boot」を選択してから、「Firmware」ボタンをクリックして、OrangePi5_RK3588S_Android12_v1.0.0.imgを指定して「Create」ボタンをクリックする。

書き込み確認で、はい、を選んで書き込み開始

書き込み完了

書き込んだmicroSDはこんな感じのパーテーションになりました。

NVMe SSDを取り外して、microSDのみ入れて電源オン…

しばらく待つと下記の画面となります。

アプリ一覧にブラウザはいませんが、検索欄をクリックすればブラウザとして使えます。

F-Droidでもアクセスしてフリーソフト中心のソフトウエアレポジトリにアクセスしてみましょう…

が・・・たいしていいアプリがあるわけじゃないので微妙なんですけど・・・

ただ、いい感じのブラウザがなくて・・・

Ubuntu Touchでも使ったBromite ブラウザ をF-Droidレポジトリに追加してインストールすると、Chromiumもダウンロードできるんですが、Google開発者サービスがない、といわれるのでBromiteの方を使った方がいいでしょう

で・・・ブラウザをインストールしてyoutubeにアクセスしてみたところ、HDMI経由の音声出力も動いていました。

うちの場合標準設定では音量が小さくて、大きくする必要がありました

ただ、結局アプリが微妙なので、使い道があまりないかなぁ・・と

Orange Pi 5 が届いた


2022年11月12日に発注し2022年12月5日に発送連絡があった Orange PI 5が12月19日に届いた。

Orange Pi のいつもの箱に入って届いた

中身もいつものごとく

ラズパイ2BとOrange Pi 5を並べて見る

裏面にM.2 コネクタがありますが、止めるためのネジが付属してないのでどうにか調達する必要があります。

私の場合はたまたま別件で買ったM.2 SSDにネジが添付されていたのでそれを流用しました。

さて、ここからは実際に使う為の資料について・・・

資料について

公式のマニュアルはOrange Pi 5 Downloadページ にあるUser Manualリンク にあるOrangePi_5_RK3588S_User Manual_v0.2.pdf となる。(2022/12/08版)

電源について

Orange Pi 5の注意点として電源はType-Cコネクタ形状だけれども、USB PD非対応で、5V4Aのみを受け付けるだけの単機能コネクタである、ということ。

このため、ノートパソコンなど用のType-C PD電源ををつなげても動作しません。

私の場合、秋月でラズパイ4用として売ってる「スイッチングACアダプター(USB ACアダプター) Type-Cオス 5.1V3.8A 」を買って使っています。

まお、マニュアルの上記記述にあるように、USB Type-Cとして使えるコネクタの方は電源供給には使えません。

裏面にあるM.2 コネクタには2242サイズのNVMeストレージを取り付けることができますが、固定する為のネジが添付されていません。

Orange Pi 5の基盤自体を固定する為の四隅の穴は3.0mmですが、M.2用の2230/2242用の固定穴は3.5mmとのこと。

また、GPIO端子から電源を供給することは可能ですが、推奨されていません。

GPIO端子に逆接続防止措置はないので、誤って逆に接続してしまうと基板が死ぬので注意してください。

OS書き込みについて

Linuxの場合

microSDの起動ディスクをつくる場合、Linuxを書き込む場合はddやrufus,etcher,win32diskimagerで書き込みます。

NVMe SSD起動にしたい場合は、一度microSDで起動させた後、NVMe SSDへのインストール処理を行う形となります。

使用できるNVMe SSDは、2230サイズもしくは2242サイズのものです。

NVMe SSD用に確保されている帯域は PCIe2.0x1 となっており、理論上は500MB/sまでとなります。PCIe3.0やPCIe4.0のSSDを使用しても、PCIe2.0x1で止まります。

NVMe SSDへのインストールは、Orange Pi公式配布のDebian/Ubuntuの場合「sudo nand-sata-install」を実行することでSPI Flashへブートローダを書き込み、NVMe SSDから起動できるような設定を行った上で、Linux用ディスクイメージファイルをddコマンドで/dev/nvme0n1に書き込みを行います。

書き込み後は、Linuxをshutdownし、microSDを抜いて、NVMe SSDのみとして起動します。

起動後、Orange Pi公式配布のDebian/Ubuntuの場合「sudo fix_mmc_ssd.sh」を実行し、ディスクのパーテーション調整を行います。(後述しますが、この手順は不要でした)

なお、初期ユーザは「root」パスワード「orangepi」と、ユーザ「orangepi」パスワード「orangepi」の2つがあります。

また、自動ログインの有効/無効が別途用意されているコマンドで設定できます。

詳細はUser Manualにて。

Androidの場合

Rockchip用のAndroidを起動するためのmicroSDは専用の書き込みソフトSDDiskTool(Windows)を使用する必要があります。

また、NVMe SSDからAndroidを起動したい場合は、Windows+専用ドライバ/書き込みソフト(RKDevTool)を使うことで、microSDを経由せずにType-Cケーブル経由で直接書き込むことが可能です。

ネットワーク設定について

Orange Pi公式が配布しているUbuntu/Debianイメージではネットワーク接続を /etc/network/interfaces ファイルの編集ではなくNetwork Manager経由で行う、ということになっています。

nmcliやnmtuiコマンドで設定します。


実際にセットアップしてみた

M.2 2242サイズのNVMe SSDを取り付けて…

Orangepi5_1.0.6_ubuntu_jammy_desktop_xfce_linux5.10.110.img をmicroSDに書き込んで初回起動すると、X-Windowでログインした状態となる

この際のユーザは「orangepi」

コマンドで「ip a s」などを実行してIPアドレスを確認して、sshでログイン

その際は「orangepi」でパスワードも「orangepi」

  ___  ____  _   ____
 / _ \|  _ \(_) | ___|
| | | | |_) | | |___ \
| |_| |  __/| |  ___) |
 \___/|_|   |_| |____/

Welcome to Orange Pi 1.0.6 Jammy with Linux 5.10.110-rockchip-rk3588

System load:   2%               Up time:       7 min    Local users:   3
Memory usage:  8% of 7.51G      IP:            192.168.1.141
CPU temp:      39°C            Usage of /:    16% of 29G

[ 2 security updates available, 2 updates total: apt upgrade ]
Last check: 2022-12-16 16:17

[ General system configuration (beta): orangepi-config ]

Last login: Fri Dec 16 16:17:44 2022
orangepi@orangepi5:~$

カスタマイズするためのスクリプト群が /usr/local/bin に用意されている

orangepi@orangepi5:~$ ls -l /usr/local/bin
total 1360
-rwxrwxr-x 1 root root    992 Dec  7 09:26 auto_login_cli.sh
-rwxrwxr-x 1 root root   9632 Dec  7 09:26 blink_all_gpio
-rwxrwxr-x 1 root root     47 Dec  7 09:26 cat_serial.sh
-rwxrwxr-x 1 root root    560 Dec  7 09:26 compile_python.sh
-rwxrwxr-x 1 root root    316 Dec  7 09:26 desktop_login.sh
-rwxrwxr-x 1 root root    140 Dec  7 09:26 disable_desktop_autologin.sh
-rwxrwxr-x 1 root root   2036 Dec  7 09:26 drm-hotplug.sh
-rwxrwxr-x 1 root root     86 Dec  7 09:26 enable_docker.sh
-rwxrwxr-x 1 root root    265 Dec  7 09:26 fix_mmc_ssd.sh
-rwxr-xr-x 1 root root    195 Dec 15 18:27 gpu_load.sh
-rwxrwxr-x 1 root root    111 Dec  7 09:26 install_bt_panel.sh
-rwxrwxr-x 1 root root    684 Dec  7 09:26 install_docker.sh
-rwxr-xr-x 1 root root    565 Dec 16 11:41 install_qt.sh
-rwxrwxr-x 1 root root   2364 Dec 16 15:36 install_ros.sh
-rwxrwxr-x 1 root root  76188 Dec  7 09:26 io
-rwxrwxr-x 1 root root  22896 Dec  7 09:26 memtester
-rwxrwxr-x 1 root root 772832 Dec  7 09:26 modetest
-rwxrwxr-x 1 root root  38856 Dec  7 09:26 multivideoplayer
-rwxrwxr-x 1 root root     78 Dec  7 09:26 reset_ssh.sh
-rwxrwxr-x 1 root root    115 Dec 12 09:41 set_device.sh
-rwxrwxr-x 1 root root    242 Dec 12 09:41 set_vnc.sh
-rwxrwxr-x 1 root root  19672 Dec  7 09:26 spidev_test
-rwxrwxr-x 1 root root 254056 Dec  7 09:26 stressapptest
-rwxrw-r-- 1 root root   1197 Dec 14 15:56 test_camera.sh
-rwxrwxr-x 1 root root    175 Dec 12 09:41 test_dec_mpv.sh
-rwxrwxr-x 1 root root    168 Dec  7 09:26 test_rknn_demo.sh
-rwxr-xr-x 1 root root    501 Dec 16 15:36 test_ros.sh
-rwxrwxr-x 1 root root    446 Dec  7 09:26 test_rtsp.sh
-rwxrwxr-x 1 root root  14736 Dec  7 09:26 tinycap
-rwxrwxr-x 1 root root  19448 Dec  7 09:26 tinymix
-rwxrwxr-x 1 root root  14440 Dec  7 09:26 tinypcminfo
-rwxrwxr-x 1 root root  19048 Dec  7 09:26 tinyplay
-rwxrwxr-x 1 root root     65 Dec  7 09:26 typec_usb2.sh
-rwxrwxr-x 1 root root    123 Dec 15 18:41 vpu_debug.sh
-rwxrwxr-x 1 root root  13816 Dec 16 16:23 watchdog_test
orangepi@orangepi5:~$ ls -l /usr/local/sbin
total 0
orangepi@orangepi5:~$

NVMe SSDにインストールするには/dev/nvme0n1に対してインストールイメージを書き込む

まずデバイス名確認。テストに使用したものなのでパーテーションが2つ作られている

orangepi@orangepi5:~$ ls -l /dev/nvme0*
crw------- 1 root root 239, 0 Dec 16 16:17 /dev/nvme0
brw-rw---- 1 root disk 259, 0 Dec 16 16:17 /dev/nvme0n1
brw-rw---- 1 root disk 259, 1 Dec 16 16:17 /dev/nvme0n1p1
brw-rw---- 1 root disk 259, 2 Dec 19 19:30 /dev/nvme0n1p2
orangepi@orangepi5:~$

確認のためM.2 SATA SSDが認識できないかを確認してみる

orangepi@orangepi5:~$ sudo fdisk -l
[sudo] password for orangepi:
Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/zram0: 3.75 GiB, 4031569920 bytes, 984270 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mtdblock0: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mmcblk1: 29.9 GiB, 32105299968 bytes, 62705664 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 53AE4D8D-573C-E044-AB71-027F31F37494

Device          Start      End  Sectors  Size Type
/dev/mmcblk1p1  61440   585727   524288  256M Linux extended boot
/dev/mmcblk1p2 585728 62062591 61476864 29.3G Linux filesystem


Disk /dev/zram1: 200 MiB, 209715200 bytes, 51200 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
orangepi@orangepi5:~$ ls /dev/nv*
ls: cannot access '/dev/nv*': No such file or directory
orangepi@orangepi5:~$

M.2 SATA SSDでは認識しないことを確認

(2022/12/21追記: データディスクとしてならM.2 SATAも動くことを確認しました → 詳細)

まあ、そういう仕様ですしね

さて、NVMe SSDに戻して、マニュアル記載のSPI Flash書き換えコマンドを実行

「sudo nand-sata-install」を実行して以下の画面とします。

「7 Install/Update the bootloader on SPI Flash」を選択してOKします

書き換え警告を[Yes]とします

YES選択後、数分間以下の状態で止まっていますが、正常です。

5分ぐらいすると下記の様になって終了します。

続いて、Orangepi5_1.0.6_ubuntu_jammy_desktop_xfce_linux5.10.110.img を /dev/nvme0n1 に対して書き込むため「sudo dd if=Orangepi5_1.0.6_ubuntu_jammy_desktop_xfce_linux5.10.110.img of=/dev/nvme0n1 status=progress」と実行します。

orangepi@orangepi5:~$ sudo dd if=Orangepi5_1.0.6_ubuntu_jammy_desktop_xfce_linux5.10.110.img of=/dev/nvme0n1 status=progress
6924734976 bytes (6.9 GB, 6.4 GiB) copied, 278 s, 24.9 MB/s
13533184+0 records in
13533184+0 records out
6928990208 bytes (6.9 GB, 6.5 GiB) copied, 279.176 s, 24.8 MB/s
orangepi@orangepi5:~$

現状のパーテーションを確認

orangepi@orangepi5:~$ sudo fdisk -l /dev/nvme0n1
GPT PMBR size mismatch (13533183 != 1000215215) will be corrected by write.
The backup GPT table is not on the end of the device.
Disk /dev/nvme0n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: NXM-512
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 53AE4D8D-573C-E044-AB71-027F31F37494

Device          Start      End  Sectors  Size Type
/dev/nvme0n1p1  61440   585727   524288  256M Linux extended boot
/dev/nvme0n1p2 585728 13533150 12947423  6.2G Linux filesystem
orangepi@orangepi5:~$

この段階では実際のSSD容量にあわせたパーテーション構成になっていないのでmismatchと表示されている。

この段階では、microSD起動を一度停止して、microSDを抜いてから再度電源を入れます

NVMe SSDから起動していることを確認します。

orangepi@orangepi5:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           769M  9.4M  760M   2% /run
/dev/nvme0n1p2  465G  4.6G  456G   1% /
tmpfs           3.8G     0  3.8G   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.8G   12K  3.8G   1% /tmp
/dev/nvme0n1p1  256M   95M  162M  37% /boot
/dev/zram1      188M  2.6M  171M   2% /var/log
tmpfs           769M   80K  769M   1% /run/user/1000
orangepi@orangepi5:~$

問題が起きてたパーテーション構成は起動時に自動修正されています。

orangepi@orangepi5:~$ sudo fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: NXM-512
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 53AE4D8D-573C-E044-AB71-027F31F37494

Device          Start       End   Sectors   Size Type
/dev/nvme0n1p1  61440    585727    524288   256M Linux extended boot
/dev/nvme0n1p2 585728 990183423 989597696 471.9G Linux filesystem
orangepi@orangepi5:~$

マニュアル記載にある「sudo fix_mmc_ssd.sh」はmicroSDも使う場合に実行するもので、NVMe SSDのみの場合は実行してみると以下のようなメッセージが出力されていました。

orangepi@orangepi5:~$ sudo fix_mmc_ssd.sh
ls: cannot access '/dev/mmcblk*': No such file or directory
Done
orangepi@orangepi5:~$

その上、NVMeから起動できなくなってしまうので必要無い限りはfix_mmc_ssd.shは実行しないように・・・

もしこの状態にしてしまった場合は、最初のNVMeへのインストール時に使ったmicroSDを入れるとシングルユーザモードで起動できます。

その状態で/etc/fstabにある/boot行を「/dev/nvme0n1p1 /boot vfat defaults 0 2」に書きかえて「mount -a」でマウント

その次に /boot/orangepiEnv.txt にあるroot=行を「rootdev=/dev/nvme0n1p2」に書き換えることで元の状態に戻ります。

あとは普通のUbuntu 22.04として利用できます。

ちょっと興味深かったのは、https://repo.huaweicloud.com/ からファイルを持ってくる初期設定になってるんだなぁ、というところ

カスタマイズ

「sudo orangepi-config」を実行すると設定ユーティリティが起動します。

まずは[System]から[Firmware]を選択してFirmwareアップデートを実行します。

再起動します。

この他、[Personal]にある[Timezone]など、いろいろ設定がありますので、必要に応じ変更します。

youtube(360p)再生中のCPU負荷

youtube(1080p)再生中のCPU負荷

Rockchip RK3588S搭載のOrange Pi 5が送料込み$84.2という格安価格でプレセール開始


2022/12/23追記

Orange Pi 5が届いたので「Linuxを動かす記事」「Androidを動かす記事」と「データディスクとしてM.2 SATA SSDを動かす記事(起動ディスクでは使えない)」を公開中です。


2022年7月に発表になったRockchip RK3588S搭載のOrange Pi 5が2022年12月1日から発売開始、ということで、プレセールが始まりました。

AliexressでRAM8GBモデルが送料込みで$84.2というなかなかに安い価格となっています。

他社動向を考えると安くても$120はするだろう、と思っていただけに、この価格は驚きの一言です。

さて、このOrange Pi 5、実は2022年7月の発表時点から構成に変化が出ています。

出典1:2022年7月15日付けのOrange Pi 5スペックページ
出典2:2022年11月11日付けのOrange Pi 5スペックページ

まずは表面の比較

7月版にあった「Wi-Fi 6 + Bluetooth」と「32GB EMMC Flash」が削除され、「16MB SPI Flash」と裏面に「M.2 NVMe 対応スロット」が追加されました。

7月版では恐らくEIAJ#2(PSPと同じやつ)だと思われる電源だったものが、Type-Cコネクタに変更・・・これはいいような悪いような・・・


続いて裏面

7月版の方だと、「CODEC(ES8388)」と「RTC」が書かれてないけど、配置が同じなのでこれについては変更無し。

7月版との大きな変更点は「M.2 PCIe2.0 (Supports 2242 NVMe SSD」と、M.2スロットが追加されたということ。

これにより、microSDの壊れやすさを気にする必要がなくなる、というのは大きな利点と言えます。

M.2 スロット搭載を$100を下回る価格で投入してきたのは予想外でした。

とりあえず為替レートがいろいろ動いているなか、1ドル151円換算のPayPal決済で発注してみました。

発注後、メッセージが飛んできて、2022年12月1日発送予定になるので、それまでの間「Extend delivery」ボタンを押してキャンセルされないような日数を追加してくれ、とのことです。

つまり、11/11時点で標準では「11 days」、つまり11/22にキャンセル処理がされる、ということになるので「Extend delivery」押して「14」ぐらいを入力して、25daysと12/1を超えるような日数にする、ということです

私の場合、ここで指定する日数が新しい日数なのか追加する日数なのかがわからなかったので、とりあえず「30」と入力してみたところ「41days」になりました。

このExtend delivyer設定を忘れるとAliexpress側の自動処理によって発注がキャンセルされてしまうので注意してください。


2022/11/15追記

16GBモデルの販売がプレセール価格$105(送料$11.31)で開始されました。

たしかに公式製品ページに「4GB/8GB/16GB/32GB(LPDDR4/4x)」って書いてあったけど、ほんとに16GBモデルが出るとは・・・

32GBモデルはいくらになるのかな?


2022/11/17追記

Orange Pi 5が要求しているType-Cコネクタで5V4Aをどうするかなーと秋月電子に行ってみたところ「スイッチングACアダプター(USB ACアダプター) Type-Cオス 5.1V3.8A(M-16293)」が950円だったので買っておきました。まだこれがOrange Pi 5で不足無く使えるかどうかはまだわかりません。

NanoPi R2S+OpenWRT 21.02.0でBIGLOBEのMAP-E接続


5月に「NanoPi R2S+openWRT 21.02.0RCでBIGLOBEのMAP-E接続」にてOpenWRT 21.02.0-RC版での手順を作成した。

しかし、OpenWRT 21.02.0リリース版になってみると、いろいろ設定画面が変更となり、この手順のままでは動作させることができなかった。

ぐぐってみたところ「OpenWrt(21.02)でIPv6インターネットを使う」に手順があったので、参考にしつつ手順を更新した。

前書き

OpenWRTルータを作成するにあたり、いろいろある選択肢からRockchip RK3328のNanoPi R2S と Rockchip RK3399のNanoPi R4S を候補にあげた。

Amazon日本の倉庫に在庫があるというのと、openWRTのページに「FriendlyARM NanoPi R2S」とデバイスに関する個別ページが作成されており、リリース版の提供がされていたので、NanoPi R2Sを買って設定を行った。

ちなみに置き換え対象となったGL-MV1000とのサイズ比較はこんな感じ

OpenWRT 21.02.0-RC版の時代はアップグレードしたら以前の設定を残しておくと起動しなくなるとか問題もありましたが、OpenWRT 21.02.0リリース版を書き込んだあと設定復旧で動作させることができました。

設定手順0: MicroSD作成

friendlyarm_nanopi-r2s-squashfs-sysupgrade.img.gz を展開したものをmicroSDに書き込んでNanoPi R2Sを起動。

設定手順1:パッケージの追加

mapパッケージと日本語UIパッケージ(luci-i18n-base-ja)をインストール

また、後述のニチバン対策を行う場合は iptables-mod-ipopt もインストールする。

GUIの場合、[システム]-[Software]にて、「Update lists」を実行してパッケージ一覧を取得した後に、「Filter」にパッケージ名を入れて、出てきたモジュールを「Install」する。

CLIでインストールする場合は以下を実行

# opkg update
# opkg install luci-i18n-base-ja
# opkg install map
# okpg install iptables-mod-ipopt

インストール後は再起動を行うこと。

再起動しないとluciのネットワーク設定で「プロトコル:MAP / LW4over6」が選択肢に現れません。

設定手順2:WAN6インタフェースの作成

WAN6インタフェースがなければ「プロトコル: DHCPv6クライアント」で作成する

最初はそのまま設定して、有効化し、WAN6インタフェースに割り当てられるIPv6アドレスを確認すること。

↑の画像は使い回しなので、この段階では無いはずの「MAP」インタフェースなどが入ってます

上記のようにWAN6インタフェースに「IPv6」アドレスが確認できたら、そのアドレスをコピーして、notepadにでも貼り付けておきます。

設定手順3:WAN6インタフェースにDHCPv6関連設定

openWRT 21.02.0のリリース版になったらWAN6インタフェースではDHCPv6関連設定がGUIできるようになりました。

[DHCPサーバー]を選択して、下記のようになっている場合は「DHCPサーバーをセットアップ」をクリックします。

クリックしたあと[一般設定]タブは下記のような感じで変更せず

[IPv6設定]タブで下記の設定を行います。

Designated master: チェックを入れる
RA-Service:リレーモード
DHCPv6-サービス: リレーモード
NDP-Proxy: リレーモード
(Learn routesは設定を変更していない)

設定手順4:LANインタフェースにDHCPv6関連設定

LANインタフェースの[DHCPサーバー]-[IPv6設定]で以下の設定を行います。

RA-Service:リレーモード
DHCPv6-サービス: サーバーモード
NDP-Proxy: リレーモード

(マスターにチェックは入れません)

設定手順5: IPv6 PD設定

OpenWRT 21.02.0-RC版だとIPv6 PD設定がWAN6にあったのですが、リリース版だと消えています。

これは別のインタフェースとして作成することで対応するようです。

[インタフェースを新規作成]から下記でインタフェースを作成します。

名前:WAN6PD
プロトコル:静的アドレス
デバイス: WAN6インタフェース(@wan6表記)

詳細設定では手順2で確認したIPv6アドレスを使います。

IPv6アドレスが「IPv6: wwww:xxxx:yyyy:zzzz:aaaa:bbbb:cccc:dddd/64」というようになっているとき、先頭の4カラム「wwww:xxxx:yyyy:zzzz」を使います。

まず、WAN6PDに割り当てる 「wwww:xxxx:yyyy:zzzz::1001」を「IPv6アドレス」に設定します。

「IPv6 ゲートウェイ」には「wwww:xxxx:yyyy:zzzz::1 」を指定します。このアドレスは設定完了後、WAN6PDインタフェースではなく、LANインタフェースに対して割り当てられます。

「IPv6ルートプレフィックス」には「wwww:xxxx:yyyy:zzzz::/56」と指定します。

設定すると上記のような感じです。

設定手順6: MAP-E接続設定

インタフェースの新規作成で「プロトコル:MAP / LW4over6」を作成して、必要な値を入れていきます。今回は「WAN_MAP」で作成しました。

[一般設定]では下記の様にしました。

プロトコル:MAP/LW4over6
タイプ:MAP-E
以後は環境に合わせた値

[詳細設定]では「従来のMAPを使用」にチェックを入れる

設定手順7: 各インタフェースのファイアウォールゾーン設定

wan系のゾーンに「wan_map」と「WAN6PD」を追加します。

設定完了

ひとまずこれで設定完了です。

うまく接続が始まらない場合は、再起動してみてください。

設定:ニチバン対策

通称「ニチバンベンチ」と呼ばれているものがある。

一部のIPv4通信のみが可能なサイトにアクセスした際に、一定数以上の通信が行えなくなりコンテンツが欠けるなどの現象が発生することがある。

これはNATテーブルの利用手法と、一回確保したNATテーブルエントリの有効期限設定の兼ね合いで、MAP-Eで確保できるIPv4通信用のNAT用ポートを使い果たしてしまった場合に発生している。

大量の小さなファイルがWebサーバ側の同時セッション数が非常に多い設定で流れてこなければならないので、この現象が発生しているかどうかを意図的に確認するのがなかなか難しいものがある。

しかし、長らくニチバンサイトではその条件に合致するサイト構造であったため、ニチバンサイトを10窓ぐらいでリロードすれば発生していたため、確認手法としてニチバンにアクセスすることを「ニチバンベンチ」と呼称していた。(なお、2021年9月時点のニチバンサイトはサイト内容が一新され発生しなくなっている)

このNATテーブルとIPv4 ポート割り当ての問題を解消するためにiptablesを利用して割り当て手法の調整を行う https://paste.teknik.io/VeN9r を使用した。

IP4,PSID, TUNDEVは自分の環境に合わせて変更すること
IP4, PSIDがわからない場合は http://ipv4.web.fc2.com/map-e.html で確認すること

TUNDEVは、GUIから設定した名前ではなく、アイコンの下に小さく書かれている方の名前を使う。↑の場合は「map-wan_map」になる。

また、units1とunits2は、BIGLOBEはV6plus相当であるため、数値を変更する。

units1=15 #V6plus:15 OCN:63
units2=4096 #V6plus 4096 OCN:1024
IP4='xxx.xxx.xxx.xxx'
PSID='x'
TUNDEV='map-wan_map'


iptables -t nat -F PREROUTING
iptables -t nat -F OUTPUT
iptables -t nat -F POSTROUTING

rule=1
while [ $rule -le $units1  ] ; do
  mark=`expr $rule + 16`
  pn=`expr $rule - 1`
  portl=`expr $rule \* $units2 + $PSID \* 16`
  portr=`expr $portl + 15`

  iptables -t nat -A PREROUTING -m statistic --mode nth --every $units1 --packet $pn -j MARK --set-mark $mark
  iptables -t nat -A OUTPUT -m statistic --mode nth --every $units1 --packet $pn -j MARK --set-mark $mark

  iptables -t nat -A POSTROUTING -p icmp -o $TUNDEV -m mark --mark $mark -j SNAT --to $IP4:$portl-$portr
  iptables -t nat -A POSTROUTING -p tcp -o $TUNDEV -m mark --mark $mark -j SNAT --to $IP4:$portl-$portr
  iptables -t nat -A POSTROUTING -p udp -o $TUNDEV -m mark --mark $mark -j SNAT --to $IP4:$portl-$portr
  rule=`expr $rule + 1`
done

上記をopenwrtの[ネットワーク]-[ファイヤーウォール]-[Custom Rules] (/etc/firewall.user) に記載する。

また、[システム]-[スタートアップ]-[ローカルスタートアップ] (/etc/rc.local)の exit 0よりも前に下記2行を追加する

sleep 30
sh /etc/firewall.user

なお、iptablesのstatisticモジュールはiptables-mod-ipoptに入っているが、標準では導入されていないため、冒頭でインストールしているが、まだの場合は下記のような感じでインストールする。

root@nanopi:~# opkg install iptables-mod-ipopt
Installing iptables-mod-ipopt (1.8.7-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.0-rc1/targets/rockchip/armv8/packages/iptables-mod-ipopt_1.8.7-1_aarch64_generic.ipk
Installing kmod-ipt-ipopt (5.4.111-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.0-rc1/targets/rockchip/armv8/packages/kmod-ipt-ipopt_5.4.111-1_aarch64_generic.ipk
Configuring kmod-ipt-ipopt.
Configuring iptables-mod-ipopt.
root@nanopi:~#

これで、とりあえずニチバンもスムースに開けるようになった。


参考資料

/etc/config/network

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fdaf:6014:6f21::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth1'

config device
        option name 'eth1'
        option macaddr '1a:e4:a4:73:0d:0c'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.1.1'

config device
        option name 'eth0'
        option macaddr '1a:e4:a4:73:0d:0b'

config interface 'wan'
        option device 'eth0'
        option proto 'dhcp'
        option auto '0'

config interface 'wan6'
        option device 'eth0'
        option proto 'dhcpv6'
        option reqaddress 'try'
        option reqprefix 'auto'

config interface 'wan_map'
        option proto 'map'
        option maptype 'map-e'
        option peeraddr '2404:9200:225:100::64'
        option ipaddr 'xxx.xxx.xxx.xxx'
        option ip4prefixlen '15'
        option ip6prefix 'wwww:xxxx::'
        option ip6prefixlen '31'
        option ealen '25'
        option psidlen '8'
        option offset '4'
        option legacymap '1'

config interface 'WAN6PD'
        option proto 'static'
        list ip6addr 'wwww:xxxx:yyyy:zzzz::1001'
        option ip6gw 'wwww:xxxx:yyyy:zzzz::1'
        option ip6prefix 'wwww:xxxx:yyyy:zzzz::/56'
        option device '@wan6'

/etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'
        option ednspacket_max '1232'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option ra 'relay'
        option ndp 'relay'
        list ra_flags 'none'
        option dhcpv6 'server'

config dhcp 'wan6'
        option dhcpv6 'relay'
        option ra 'relay'
        option ndp 'relay'
        option master '1'
        option interface 'wan6'
        option ignore '1'
        list ra_flags 'none'

iptablesの結果

意図した分散が行われているかを「iptables -t nat -L -v」のPOSTROUTING tcp/udpのpkts/bytesカウントが分散して増加していっているかを確認する。

ちなみに、 /etc/rc.local にsleep 30とsh /etc/firewall.user を入れないと、システムが生成した分散ルールも残って表示される。

root@nanopi:~# iptables -t nat -L -v
Chain PREROUTING (policy ACCEPT 2756 packets, 474K bytes)
 pkts bytes target     prot opt in     out     source               destination
  185 32012 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 MARK set 0x11
  184 28575 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 1 MARK set 0x12
  184 31952 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 2 MARK set 0x13
  184 31323 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 3 MARK set 0x14
  184 33123 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 4 MARK set 0x15
  184 36047 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 5 MARK set 0x16
  184 32939 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 6 MARK set 0x17
  184 33412 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 7 MARK set 0x18
  184 29916 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 8 MARK set 0x19
  184 28526 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 9 MARK set 0x1a
  184 29308 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 10 MARK set 0x1b
  183 32364 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 11 MARK set 0x1c
  183 30150 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 12 MARK set 0x1d
  183 29944 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 13 MARK set 0x1e
  183 34100 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 14 MARK set 0x1f

Chain INPUT (policy ACCEPT 598 packets, 40818 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 67 packets, 5056 bytes)
 pkts bytes target     prot opt in     out     source               destination
    5   372 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 MARK set 0x11
    5   372 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 1 MARK set 0x12
    5   372 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 2 MARK set 0x13
    5   372 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 3 MARK set 0x14
    5   380 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 4 MARK set 0x15
    5   380 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 5 MARK set 0x16
    5   380 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 6 MARK set 0x17
    4   300 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 7 MARK set 0x18
    4   304 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 8 MARK set 0x19
    4   304 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 9 MARK set 0x1a
    4   304 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 10 MARK set 0x1b
    4   304 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 11 MARK set 0x1c
    4   304 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 12 MARK set 0x1d
    4   304 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 13 MARK set 0x1e
    4   304 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 14 MARK set 0x1f

Chain POSTROUTING (policy ACCEPT 23 packets, 1064 bytes)
 pkts bytes target     prot opt in     out     source               destination
    2   168 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x11 to:xxx.xxx.xxx.xxx:5856-5871
   41  2607 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x11 to:xxx.xxx.xxx.xxx:5856-5871
    8   557 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x11 to:xxx.xxx.xxx.xxx:5856-5871
    4   336 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x12 to:xxx.xxx.xxx.xxx:9952-9967
   50  3503 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x12 to:xxx.xxx.xxx.xxx:9952-9967
   13   868 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x12 to:xxx.xxx.xxx.xxx:9952-9967
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x13 to:xxx.xxx.xxx.xxx:14048-14063
   46  2981 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x13 to:xxx.xxx.xxx.xxx:14048-14063
   11   771 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x13 to:xxx.xxx.xxx.xxx:14048-14063
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x14 to:xxx.xxx.xxx.xxx:18144-18159
   33  1991 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x14 to:xxx.xxx.xxx.xxx:18144-18159
   10   709 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x14 to:xxx.xxx.xxx.xxx:18144-18159
    2   168 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x15 to:xxx.xxx.xxx.xxx:22240-22255
   38  2280 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x15 to:xxx.xxx.xxx.xxx:22240-22255
   13   950 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x15 to:xxx.xxx.xxx.xxx:22240-22255
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x16 to:xxx.xxx.xxx.xxx:26336-26351
   42  3095 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x16 to:xxx.xxx.xxx.xxx:26336-26351
   11   831 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x16 to:xxx.xxx.xxx.xxx:26336-26351
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x17 to:xxx.xxx.xxx.xxx:30432-30447
   51  3838 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x17 to:xxx.xxx.xxx.xxx:30432-30447
   11   823 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x17 to:xxx.xxx.xxx.xxx:30432-30447
    1    84 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x18 to:xxx.xxx.xxx.xxx:34528-34543
   41  2564 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x18 to:xxx.xxx.xxx.xxx:34528-34543
    9   656 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x18 to:xxx.xxx.xxx.xxx:34528-34543
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x19 to:xxx.xxx.xxx.xxx:38624-38639
   44  2665 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x19 to:xxx.xxx.xxx.xxx:38624-38639
    9   629 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x19 to:xxx.xxx.xxx.xxx:38624-38639
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1a to:xxx.xxx.xxx.xxx:42720-42735
   55  3841 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1a to:xxx.xxx.xxx.xxx:42720-42735
   11   762 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1a to:xxx.xxx.xxx.xxx:42720-42735
    1    84 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1b to:xxx.xxx.xxx.xxx:46816-46831
   53  3161 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1b to:xxx.xxx.xxx.xxx:46816-46831
   10   699 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1b to:xxx.xxx.xxx.xxx:46816-46831
    2   168 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1c to:xxx.xxx.xxx.xxx:50912-50927
   46  2965 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1c to:xxx.xxx.xxx.xxx:50912-50927
    9   632 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1c to:xxx.xxx.xxx.xxx:50912-50927
    1    84 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1d to:xxx.xxx.xxx.xxx:55008-55023
   45  2700 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1d to:xxx.xxx.xxx.xxx:55008-55023
   10   671 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1d to:xxx.xxx.xxx.xxx:55008-55023
    1    84 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1e to:xxx.xxx.xxx.xxx:59104-59119
   48  2992 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1e to:xxx.xxx.xxx.xxx:59104-59119
   15  1003 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1e to:xxx.xxx.xxx.xxx:59104-59119
    1    84 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1f to:xxx.xxx.xxx.xxx:63200-63215
   38  2280 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1f to:xxx.xxx.xxx.xxx:63200-63215
    9   615 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1f to:xxx.xxx.xxx.xxx:63200-63215

Chain postrouting_lan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain postrouting_rule (0 references)
 pkts bytes target     prot opt in     out     source               destination

Chain postrouting_wan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_lan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_rule (0 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_wan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain zone_lan_postrouting (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 postrouting_lan_rule  all  --  any    any     anywhere             anywhere             /* !fw3: Custom lan postrouting rule chain */

Chain zone_lan_prerouting (0 references)
 pkts bytes target     prot opt in     out     source               destination
  389 44358 prerouting_lan_rule  all  --  any    any     anywhere             anywhere             /* !fw3: Custom lan prerouting rule chain */

Chain zone_wan_postrouting (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 postrouting_wan_rule  all  --  any    any     anywhere             anywhere             /* !fw3: Custom wan postrouting rule chain */
    0     0 MASQUERADE  all  --  any    any     anywhere             anywhere             /* !fw3 */

Chain zone_wan_prerouting (0 references)
 pkts bytes target     prot opt in     out     source               destination
    6   786 prerouting_wan_rule  all  --  any    any     anywhere             anywhere             /* !fw3: Custom wan prerouting rule chain */
root@nanopi:~#

2021/09/22追記: 8日間稼働した後の状態

root@nanopi:~# iptables -t nat -L -v
Chain PREROUTING (policy ACCEPT 1434K packets, 285M bytes)
 pkts bytes target     prot opt in     out     source               destination
95575   19M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 MARK set 0x11
95574   19M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 1 MARK set 0x12
95574   19M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 2 MARK set 0x13
95574   19M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 3 MARK set 0x14
95574   19M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 4 MARK set 0x15
95574   19M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 5 MARK set 0x16
95574   19M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 6 MARK set 0x17
95573   19M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 7 MARK set 0x18
95573   19M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 8 MARK set 0x19
95573   19M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 9 MARK set 0x1a
95573   19M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 10 MARK set 0x1b
95573   19M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 11 MARK set 0x1c
95573   19M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 12 MARK set 0x1d
95573   19M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 13 MARK set 0x1e
95573   19M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 14 MARK set 0x1f

Chain INPUT (policy ACCEPT 231K packets, 17M bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 1399 packets, 222K bytes)
 pkts bytes target     prot opt in     out     source               destination
   94 15373 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 MARK set 0x11
   94 16668 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 1 MARK set 0x12
   94 13812 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 2 MARK set 0x13
   94 14151 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 3 MARK set 0x14
   93 14819 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 4 MARK set 0x15
   93 13431 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 5 MARK set 0x16
   93 15387 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 6 MARK set 0x17
   93 14528 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 7 MARK set 0x18
   93 15124 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 8 MARK set 0x19
   93 16367 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 9 MARK set 0x1a
   93 14850 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 10 MARK set 0x1b
   93 14763 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 11 MARK set 0x1c
   93 14121 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 12 MARK set 0x1d
   93 13029 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 13 MARK set 0x1e
   93 15394 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 14 MARK set 0x1f

Chain POSTROUTING (policy ACCEPT 1289 packets, 186K bytes)
 pkts bytes target     prot opt in     out     source               destination
  772 64680 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x11 to:xxx.xxx.xxx.xxx:5856-5871
14703  948K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x11 to:xxx.xxx.xxx.xxx:5856-5871
 3753  257K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x11 to:xxx.xxx.xxx.xxx:5856-5871
  837 70140 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x12 to:xxx.xxx.xxx.xxx:9952-9967
14623  945K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x12 to:xxx.xxx.xxx.xxx:9952-9967
 3628  254K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x12 to:xxx.xxx.xxx.xxx:9952-9967
  806 67536 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x13 to:xxx.xxx.xxx.xxx:14048-14063
14690  930K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x13 to:xxx.xxx.xxx.xxx:14048-14063
 3705  257K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x13 to:xxx.xxx.xxx.xxx:14048-14063
  853 71540 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x14 to:xxx.xxx.xxx.xxx:18144-18159
14620  936K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x14 to:xxx.xxx.xxx.xxx:18144-18159
 3696  255K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x14 to:xxx.xxx.xxx.xxx:18144-18159
  802 67088 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x15 to:xxx.xxx.xxx.xxx:22240-22255
14833  942K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x15 to:xxx.xxx.xxx.xxx:22240-22255
 3723  256K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x15 to:xxx.xxx.xxx.xxx:22240-22255
  834 69944 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x16 to:xxx.xxx.xxx.xxx:26336-26351
14759  930K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x16 to:xxx.xxx.xxx.xxx:26336-26351
 3689  258K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x16 to:xxx.xxx.xxx.xxx:26336-26351
  804 67480 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x17 to:xxx.xxx.xxx.xxx:30432-30447
14874  946K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x17 to:xxx.xxx.xxx.xxx:30432-30447
 3746  261K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x17 to:xxx.xxx.xxx.xxx:30432-30447
  868 72800 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x18 to:xxx.xxx.xxx.xxx:34528-34543
14703  937K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x18 to:xxx.xxx.xxx.xxx:34528-34543
 3698  254K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x18 to:xxx.xxx.xxx.xxx:34528-34543
  843 70644 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x19 to:xxx.xxx.xxx.xxx:38624-38639
14651  931K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x19 to:xxx.xxx.xxx.xxx:38624-38639
 3720  256K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x19 to:xxx.xxx.xxx.xxx:38624-38639
  768 64288 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1a to:xxx.xxx.xxx.xxx:42720-42735
14731  942K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1a to:xxx.xxx.xxx.xxx:42720-42735
 3689  251K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1a to:xxx.xxx.xxx.xxx:42720-42735
  839 70084 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1b to:xxx.xxx.xxx.xxx:46816-46831
14826  944K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1b to:xxx.xxx.xxx.xxx:46816-46831
 3729  257K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1b to:xxx.xxx.xxx.xxx:46816-46831
  841 70420 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1c to:xxx.xxx.xxx.xxx:50912-50927
14751  939K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1c to:xxx.xxx.xxx.xxx:50912-50927
 3697  252K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1c to:xxx.xxx.xxx.xxx:50912-50927
  783 65492 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1d to:xxx.xxx.xxx.xxx:55008-55023
14802  937K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1d to:xxx.xxx.xxx.xxx:55008-55023
 3679  255K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1d to:xxx.xxx.xxx.xxx:55008-55023
  850 71288 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1e to:xxx.xxx.xxx.xxx:59104-59119
14824  942K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1e to:xxx.xxx.xxx.xxx:59104-59119
 3622  246K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1e to:xxx.xxx.xxx.xxx:59104-59119
  870 72968 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1f to:xxx.xxx.xxx.xxx:63200-63215
14802  941K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1f to:xxx.xxx.xxx.xxx:63200-63215
 3684  258K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1f to:xxx.xxx.xxx.xxx:63200-63215

Chain postrouting_lan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain postrouting_rule (0 references)
 pkts bytes target     prot opt in     out     source               destination

Chain postrouting_wan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_lan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_rule (0 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_wan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain zone_lan_postrouting (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 postrouting_lan_rule  all  --  any    any     anywhere             anywhere             /* !fw3: Custom lan postrouting rule chain */

Chain zone_lan_prerouting (0 references)
 pkts bytes target     prot opt in     out     source               destination
  389 44358 prerouting_lan_rule  all  --  any    any     anywhere             anywhere             /* !fw3: Custom lan prerouting rule chain */

Chain zone_wan_postrouting (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 postrouting_wan_rule  all  --  any    any     anywhere             anywhere             /* !fw3: Custom wan postrouting rule chain */
    0     0 MASQUERADE  all  --  any    any     anywhere             anywhere             /* !fw3 */

Chain zone_wan_prerouting (0 references)
 pkts bytes target     prot opt in     out     source               destination
    6   786 prerouting_wan_rule  all  --  any    any     anywhere             anywhere             /* !fw3: Custom wan prerouting rule chain */
root@nanopi:~#

2022/04/14追記

32日起動していた場合の出力なんだけど、以前と違って「conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat」の数が増えてないのはなんなのだ???

root@nanopi:~# uptime
 09:48:41 up 32 days, 12:38,  load average: 0.00, 0.01, 0.00
root@nanopi:~# iptables -t nat -L -v
Chain PREROUTING (policy ACCEPT 6326K packets, 1296M bytes)
 pkts bytes target     prot opt in     out     source               destination
 422K   86M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 MARK set 0x11
 422K   86M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 1 MARK set 0x12
 422K   86M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 2 MARK set 0x13
 422K   86M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 3 MARK set 0x14
 422K   87M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 4 MARK set 0x15
 422K   87M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 5 MARK set 0x16
 422K   86M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 6 MARK set 0x17
 422K   86M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 7 MARK set 0x18
 422K   86M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 8 MARK set 0x19
 422K   86M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 9 MARK set 0x1a
 422K   86M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 10 MARK set 0x1b
 422K   86M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 11 MARK set 0x1c
 422K   87M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 12 MARK set 0x1d
 422K   87M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 13 MARK set 0x1e
 422K   86M MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 14 MARK set 0x1f
6326K 1296M prerouting_rule  all  --  any    any     anywhere             anywhere             /* !fw3: Custom prerouting rule chain */
6321K 1295M zone_lan_prerouting  all  --  br-lan any     anywhere             anywhere             /* !fw3 */
    0     0 zone_wan_prerouting  all  --  eth0   any     anywhere             anywhere             /* !fw3 */
 4905  558K zone_wan_prerouting  all  --  map-wan_map any     anywhere             anywhere             /* !fw3 */

Chain INPUT (policy ACCEPT 1037K packets, 79M bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 9463 packets, 1532K bytes)
 pkts bytes target     prot opt in     out     source               destination
  632  101K MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 MARK set 0x11
  631  103K MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 1 MARK set 0x12
  631  100K MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 2 MARK set 0x13
  631 99184 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 3 MARK set 0x14
  631  101K MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 4 MARK set 0x15
  631  103K MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 5 MARK set 0x16
  631  105K MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 6 MARK set 0x17
  631  102K MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 7 MARK set 0x18
  631  102K MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 8 MARK set 0x19
  631 97260 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 9 MARK set 0x1a
  631  104K MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 10 MARK set 0x1b
  631  102K MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 11 MARK set 0x1c
  631  105K MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 12 MARK set 0x1d
  630  100K MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 13 MARK set 0x1e
  630  104K MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 14 MARK set 0x1f

Chain POSTROUTING (policy ACCEPT 7238 packets, 1363K bytes)
 pkts bytes target     prot opt in     out     source               destination
 2962  257K SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x11 to:xxx.xx.xxx.xx:5856-5871
62597 4208K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x11 to:xxx.xx.xxx.xx:5856-5871
14955 4828K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x11 to:xxx.xx.xxx.xx:5856-5871
 2998  256K SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x12 to:xxx.xx.xxx.xx:9952-9967
62399 4173K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x12 to:xxx.xx.xxx.xx:9952-9967
14973 4852K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x12 to:xxx.xx.xxx.xx:9952-9967
 2972  263K SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x13 to:xxx.xx.xxx.xx:14048-14063
62056 4109K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x13 to:xxx.xx.xxx.xx:14048-14063
14958 4830K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x13 to:xxx.xx.xxx.xx:14048-14063
 3020  270K SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x14 to:xxx.xx.xxx.xx:18144-18159
62491 4170K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x14 to:xxx.xx.xxx.xx:18144-18159
15125 4922K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x14 to:xxx.xx.xxx.xx:18144-18159
 2948  255K SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x15 to:xxx.xx.xxx.xx:22240-22255
62215 4170K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x15 to:xxx.xx.xxx.xx:22240-22255
15160 4931K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x15 to:xxx.xx.xxx.xx:22240-22255
 2985  259K SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x16 to:xxx.xx.xxx.xx:26336-26351
62214 4147K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x16 to:xxx.xx.xxx.xx:26336-26351
15056 4989K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x16 to:xxx.xx.xxx.xx:26336-26351
 3116  271K SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x17 to:xxx.xx.xxx.xx:30432-30447
62050 4150K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x17 to:xxx.xx.xxx.xx:30432-30447
15061 4789K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x17 to:xxx.xx.xxx.xx:30432-30447
 2973  256K SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x18 to:xxx.xx.xxx.xx:34528-34543
62684 4173K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x18 to:xxx.xx.xxx.xx:34528-34543
15055 4832K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x18 to:xxx.xx.xxx.xx:34528-34543
 3046  272K SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x19 to:xxx.xx.xxx.xx:38624-38639
62090 4162K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x19 to:xxx.xx.xxx.xx:38624-38639
14894 4747K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x19 to:xxx.xx.xxx.xx:38624-38639
 3045  263K SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1a to:xxx.xx.xxx.xx:42720-42735
62550 4157K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1a to:xxx.xx.xxx.xx:42720-42735
15085 4847K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1a to:xxx.xx.xxx.xx:42720-42735
 2970  255K SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1b to:xxx.xx.xxx.xx:46816-46831
62369 4167K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1b to:xxx.xx.xxx.xx:46816-46831
14965 4803K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1b to:xxx.xx.xxx.xx:46816-46831
 2912  257K SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1c to:xxx.xx.xxx.xx:50912-50927
62665 4189K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1c to:xxx.xx.xxx.xx:50912-50927
15057 4704K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1c to:xxx.xx.xxx.xx:50912-50927
 3024  263K SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1d to:xxx.xx.xxx.xx:55008-55023
62282 4191K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1d to:xxx.xx.xxx.xx:55008-55023
15039 4877K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1d to:xxx.xx.xxx.xx:55008-55023
 3022  262K SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1e to:xxx.xx.xxx.xx:59104-59119
62369 4163K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1e to:xxx.xx.xxx.xx:59104-59119
15014 4877K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1e to:xxx.xx.xxx.xx:59104-59119
 3001  261K SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1f to:xxx.xx.xxx.xx:63200-63215
62511 4145K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1f to:xxx.xx.xxx.xx:63200-63215
15094 4836K SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1f to:xxx.xx.xxx.xx:63200-63215
10025 1475K postrouting_rule  all  --  any    any     anywhere             anywhere             /* !fw3: Custom postrouting rule chain */
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 0 */ to:xxx.xx.xxx.xx:5856-5871
 2787  111K SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 1 */ to:xxx.xx.xxx.xx:5856-5871
    0     0 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 2 */ to:xxx.xx.xxx.xx:5856-5871
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 3 */ to:xxx.xx.xxx.xx:9952-9967
    0     0 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 4 */ to:xxx.xx.xxx.xx:9952-9967
    0     0 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 5 */ to:xxx.xx.xxx.xx:9952-9967
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 6 */ to:xxx.xx.xxx.xx:14048-14063
    0     0 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 7 */ to:xxx.xx.xxx.xx:14048-14063
    0     0 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 8 */ to:xxx.xx.xxx.xx:14048-14063
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 9 */ to:xxx.xx.xxx.xx:18144-18159
    0     0 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 10 */ to:xxx.xx.xxx.xx:18144-18159
    0     0 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 11 */ to:xxx.xx.xxx.xx:18144-18159
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 12 */ to:xxx.xx.xxx.xx:22240-22255
    0     0 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 13 */ to:xxx.xx.xxx.xx:22240-22255
    0     0 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 14 */ to:xxx.xx.xxx.xx:22240-22255
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 15 */ to:xxx.xx.xxx.xx:26336-26351
    0     0 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 16 */ to:xxx.xx.xxx.xx:26336-26351
    0     0 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 17 */ to:xxx.xx.xxx.xx:26336-26351
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 18 */ to:xxx.xx.xxx.xx:30432-30447
    0     0 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 19 */ to:xxx.xx.xxx.xx:30432-30447
    0     0 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 20 */ to:xxx.xx.xxx.xx:30432-30447
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 21 */ to:xxx.xx.xxx.xx:34528-34543
    0     0 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 22 */ to:xxx.xx.xxx.xx:34528-34543
    0     0 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 23 */ to:xxx.xx.xxx.xx:34528-34543
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 24 */ to:xxx.xx.xxx.xx:38624-38639
    0     0 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 25 */ to:xxx.xx.xxx.xx:38624-38639
    0     0 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 26 */ to:xxx.xx.xxx.xx:38624-38639
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 27 */ to:xxx.xx.xxx.xx:42720-42735
    0     0 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 28 */ to:xxx.xx.xxx.xx:42720-42735
    0     0 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 29 */ to:xxx.xx.xxx.xx:42720-42735
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 30 */ to:xxx.xx.xxx.xx:46816-46831
    0     0 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 31 */ to:xxx.xx.xxx.xx:46816-46831
    0     0 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 32 */ to:xxx.xx.xxx.xx:46816-46831
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 33 */ to:xxx.xx.xxx.xx:50912-50927
    0     0 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 34 */ to:xxx.xx.xxx.xx:50912-50927
    0     0 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 35 */ to:xxx.xx.xxx.xx:50912-50927
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 36 */ to:xxx.xx.xxx.xx:55008-55023
    0     0 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 37 */ to:xxx.xx.xxx.xx:55008-55023
    0     0 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 38 */ to:xxx.xx.xxx.xx:55008-55023
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 39 */ to:xxx.xx.xxx.xx:59104-59119
    0     0 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 40 */ to:xxx.xx.xxx.xx:59104-59119
    0     0 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 41 */ to:xxx.xx.xxx.xx:59104-59119
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 42 */ to:xxx.xx.xxx.xx:63200-63215
    0     0 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 43 */ to:xxx.xx.xxx.xx:63200-63215
    0     0 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             #conn dst/32 <= 16 /* !fw3: ubus:wan_map[map] nat 44 */ to:xxx.xx.xxx.xx:63200-63215
 7137 1356K zone_lan_postrouting  all  --  any    br-lan  anywhere             anywhere             /* !fw3 */
    0     0 zone_wan_postrouting  all  --  any    eth0    anywhere             anywhere             /* !fw3 */
    0     0 zone_wan_postrouting  all  --  any    map-wan_map  anywhere             anywhere             /* !fw3 */

Chain postrouting_lan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain postrouting_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain postrouting_wan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_lan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_wan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain zone_lan_postrouting (1 references)
 pkts bytes target     prot opt in     out     source               destination
 7137 1356K postrouting_lan_rule  all  --  any    any     anywhere             anywhere             /* !fw3: Custom lan postrouting rule chain */

Chain zone_lan_prerouting (1 references)
 pkts bytes target     prot opt in     out     source               destination
6321K 1295M prerouting_lan_rule  all  --  any    any     anywhere             anywhere             /* !fw3: Custom lan prerouting rule chain */

Chain zone_wan_postrouting (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 postrouting_wan_rule  all  --  any    any     anywhere             anywhere             /* !fw3: Custom wan postrouting rule chain */
    0     0 MASQUERADE  all  --  any    any     anywhere             anywhere             /* !fw3 */

Chain zone_wan_prerouting (2 references)
 pkts bytes target     prot opt in     out     source               destination
 4905  558K prerouting_wan_rule  all  --  any    any     anywhere             anywhere             /* !fw3: Custom wan prerouting rule chain */
root@nanopi:~#

これはどうやら、openwrt起動後にSoftwareパッケージの個別更新を実施していたのだが、ネットワークのrestartが行われた際に、iptablesが再設定されたためだったようで、openwrt全体を再起動した正常になった。

現在行っている設定はネットワーク開始後に /etc/rc.local からiptablesの設定を追加しているので、rc.localで行うことが消えた、という感じである