🍆

格安10GBASEスイッチ、SKS8300のOEMを買ってL2スイッチ化した話

に公開
2026/04/17

忙しい人向け

  1. まずこの手順に従う。ファームバックアップのみ2.の手順を行う。
    VectorのSolarWinds TFTP Serverは2026-01時点ではTFTP機能のみであった。

https://note.com/wildrick/n/n415ee09bc3f0

  1. 2025-07以降のファームでOpenwrtからscp、sshも出来なかった為
    外部からddを使ってバックアップした。(個体差かも?)
bash: PC ➔ ONTi L3
for i in {0..5}; do ssh 192.168.1.1 dd if=/tmp/mtdblock$i.bin.gz | dd of=mtdblock$i.bin.gz; done
for i in {0..5}; do md5sum mtdblock$i.bin.gz; done
コンソール
for i in 0 1 2 3 4 5; do md5sum /tmp/mtdblock$i.bin.gz; done

TIPS

  • dmesgですら満足に吐き出せないCPUなので、あまり高度なことは出来ない。
    また、当個体はMTU1500でないとパケロスする。おそらく個体差。
  • アーキテクチャはMIPS。ARMではない。
  • history保存なんて気の利いたものは無い。揮発する。

経緯

10G回線を引いた事で、10Gの回線をフルに使うためにスイッチが必要になった。
L2の10Gスイッチは2026-01現在、中華ですら2万円弱する。
出回っている中で最も安い、SKS8300系のL3スイッチを購入した。

参考記事よりファームが進んだせいか、記事通りのコマンドを受け付けなかった。
ファームのビルドは2025-7となっていた。

購入した機材

注文日: 2026-1-29

  • ONTi S508CL-8S
    (XikeStor SKS8300のOEM)

AliEX

  • Zyopm 10Gbase SFP+ - RJ45変換モジュール 80m対応品
    (BCM84891L系と思われる)

AliEX

  • RS232C-USB変換ケーブル
    RJ45コンソール-RS232CケーブルはONTiでは同梱されていた。

https://amzn.asia/d/09Kj8eld

実行環境

PC: Windows11 25H2, WSL2 Ubuntu
ハブ: NetGear GS305 (1000BASE)


Openwrt化

Openwrtを既存製品に焼く流れは、

  1. bootloader/U-bootで起動。
    Kernel(initramfs kernelイメージ)を仮bootする。
  2. ファームをバックアップする
  3. 仮boot状態からファームを消去
  4. Sysupgrade(squashfs-sysupgradeイメージ)を焼く。

その後は使い道によってuciコマンドやapkコマンドで設定を行う。

必要なファイルをダウンロード

OpenwrtのSysupgrade、Kernelをダウンロードする。

  • model: XikeStor SKS8300-8X / ONTi ONT-S508CL-8S
  • version: 25-12.0-rc4

を選択した。rc5でも良いと思われる。

他記事ではsnapshot版を用いているが、
2026-01では上手く起動しなかった為、25-12.0-rc4以降を使用する。

https://firmware-selector.openwrt.org/?version=25.12.0-rc5&target=realtek%2Frtl930x&id=xikestor_sks8300-8x

1. Openwrtを仮boot

参考記事と同じ方法である。
WiFiや別のUSB-LANアダプタ等でインターネットに接続した状態で作業すると効率が良い。

WindowsにてTFTPサーバーを立てて、ダウンロードしたイメージを配置する。
L3スイッチへ繋ぐインターフェイスを192.168.2.36とする。

Windows11では以下のように固定IPを設定する。
AliEX

Windows11
IPアドレス: 192.168.2.36
サブネットマスク: 255.255.255.0
ゲートウェイ: 192.168.2.1
DNS: お好きにどうぞ。

コンソールを繋げてTeraterm等ですぐにコマンドを打てるように準備し、電源を挿す。
WINBONDと表示されたら、すぐにCtrl+bを一回押す。
上手く行けば

コンソール
diagshell_unipoe_env
debug_unish_env

rtk 10g 0 fiber1g
rtk ext-devInit 0
rtk ext-pinSet 2 0
tftpboot 0x82000000 openwrt-25.12.0-rc4-realtek-rtl930x-xikestor_sks8300-8x-initramfs-kernel.bin

を1行ずつ、順にコンソールに入力する。

コンソール
bootm

と入力し、Enterを押したらすぐにコンソールケーブルを引っこ抜く。
RJ45側でも良いし、変換ケーブルの232C部分でも良い。

機材のSysと書かれたLEDの点滅が収まるまで待つ。
収まったらコンソールケーブルを繋ぎ直して、Enterを押す。

2. ファームをバックアップする

Openwrtとクソデカロゴがアスキーアートで表示されたら、

Openwrt コンソール
cd /tmp
for i in 0 1 2 3 4 5; do dd bs=64K if=/dev/mtdblock$i of=mtdblock$i.bin; gzip mtdblock$i.bin; done
ls -lg mtd*gz
for i in 0 1 2 3 4 5; do md5sum /tmp/mtdblock$i.bin.gz; done

とファームのバックアップ圧縮ファイルを生成する。

Openwrtになっているため、IPが変更されている。
そのため、WindowsのIP設定も変更する必要がある。
横着してIPの3番目部分だけ変えた。

Windows11
IPアドレス: 192.168.1.36
サブネットマスク: 255.255.255.0
ゲートウェイ: 192.168.1.1
DNS: お好きにどうぞ。

記事ではこの後scpでPCへバックアップファイルを転送していたが、
当環境では上手く行かず、openwrt側から接続先を見つけられなかった。
その為、WSLを用いてPCからsshで接続することにした。
やっている事は

ssh root@192.168.1.1 dd if=hoge | dd of=hoge

である。

Windows11 WSL Ubuntu
for i in {0..5}; do ssh root@192.168.1.1 dd if=/tmp/mtdblock$i.bin.gz | dd of=mtdblock$i.bin.gz; done
for i in {0..5}; do md5sum mtdblock$i.bin.gz; done

ddによる転送はパケロス、バイナリ化けが怖いので、念の為md5で確認を取っている。
下4桁しか見なかったが、問題なく転送できたことにする。

3. 仮boot状態からファームを消去

Openwrt コンソール
mtd erase firmware

4. Sysupgrade(squashfs-sysupgradeイメージ)を焼く。

本体のイメージを逆の手順でssh,ddを用いて転送する。

Windows11 WSL Ubuntu
dd if=/mnt/c/TFTP-Root/openwrt-25.12.0-rc4-realtek-rtl930x-xikestor_sks8300-8x-squashfs-sysupgrade.bin | ssh root@192.168.1.1 dd of=openwrt-25.12.0-rc4-realtek-rtl930x-xikestor_sks8300-8x-squashfs-sysupgrade.bin
md5sum /mnt/c/TFTP-Root/openwrt-25.12.0-rc4-realtek-rtl930x-xikestor_sks8300-8x-squashfs-sysupgrade.bin

受信が上手く行っているか確認する。

Openwrt コンソール
md5sum openwrt-25.12.0-rc4-realtek-rtl930x-xikestor_sks8300-8x-squashfs-sysupgrade.bin

確認できたら以下を実行。

Openwrt コンソール
sysupgrade -n -v openwrt-25.12.0-rc4-realtek-rtl930x-xikestor_sks8300-8x-squashfs-sysupgrade.bin

Openwrtの設定

以下はL2スイッチ化する際の設定例となる。
ここはそれぞれの使い方で異なってくるため
Openwrt uci 設定などで検索したり、Gemini等に聞きながら設定をしていく。

https://openwrt.org/docs/guide-user/additional-software/opkg-to-apk-cheatsheet?s[]=apk

以下参考まで設定集。
ここまでお疲れ様でした。

Openwrt: ssh
apk update
# base
apk add luci luci-i18n-base-ja luci-app-attendedsysupgrade luci-proto-ipv6
# tools
apk add lm-sensors ethtool curl nano lsblk iperf3 i2c-tools htop
# metrics
apk add prometheus-node-exporter-lua prometheus-node-exporter-lua-thermal prometheus-node-exporter-lua-ethtool
# fetch ssh publickey
curl https://github.com/<アカウント名>.keys | tee /etc/dropbear/authorized_keys


# uci settings
## metrics plugin settings
uci set prometheus-node-exporter-lua.main.listen_interface='lan'
uci commit prometheus-node-exporter-lua
/etc/init.d/prometheus-node-exporter-lua restart


## ssh server
uci set dropbear.main=dropbear
uci set dropbear.main.enable='1'
uci set dropbear.main.PasswordAuth='off'
uci set dropbear.main.RootPasswordAuth='on'
uci set dropbear.main.Port='90'


## firewall
uci set firewall.@defaults[0]=defaults
uci set firewall.@defaults[0].input='ACCEPT'
uci set firewall.@defaults[0].output='ACCEPT'
uci set firewall.@defaults[0].forward='ACCEPT'
uci set firewall.@defaults[0].synflood_protect='1'
uci set firewall.@defaults[0].flow_offloading='1'
uci set firewall.@defaults[0].flow_offloading_hw='1'
uci set firewall.@zone[0]=zone
uci set firewall.@zone[0].name='lan'
uci set firewall.@zone[0].input='ACCEPT'
uci set firewall.@zone[0].output='ACCEPT'
uci set firewall.@zone[0].forward='ACCEPT'


## L2 hub webui settings
uci set network.lan.ipaddr='<固定したいIP>/24'
uci set network.lan.gateway='<ご家庭のゲートウェイ>'
uci set network.lan.dns='<好きなDNS>'


## L2 hub settings (ipv4) 
uci set network.globals.packet_steering='1'
uci set network.globals.multipath='1'
uci set network.lan=interface
uci set network.lan.device='switch.1'
uci set network.lan.proto='static'
uci set network.lan.mtu='1500'
uci set network.lan.multipath='on'
uci set network.@device[2].promisc='1'
uci set network.@device[3].promisc='1'
uci set network.@device[4].promisc='1'
uci set network.@device[5].promisc='1'
uci set network.@device[6].promisc='1'
uci set network.@device[7].promisc='1'
uci set network.@device[8].promisc='1'
uci set network.@device[9].promisc='1'

## L2 hub settings (ipv6) 
uci set network.lan6=interface
uci set network.lan6.proto='dhcpv6'
uci set network.lan6.device='switch.1'
uci set network.lan6.reqaddress='try'
uci set network.lan6.reqprefix='auto'
uci set network.lan6.norelease='1'
uci set network.lan6.mtu='1500'
uci set network.lan6.multipath='on'

### ご家庭のプロバイダに応じて編集。
uci set network.lan6.ip6assign='64'
uci set network.lan6.ip6hint='0'


## System settings
uci set system.@system[0].hostname='<お好きなhost名>'
uci set system.@system[0].description='<好きな機器説明>'
uci set system.@system[0].notes='<好きな目的名>'
uci set system.@system[0].timezone='JST-9'
uci set system.@system[0].zonename='Asia/Tokyo'
uci set system.@system[0].clock_hourcycle='h23'
uci set system.ntp=timeserver
uci set system.ntp.server='0.openwrt.pool.ntp.org' '1.openwrt.pool.ntp.org' '2.openwrt.pool.ntp.org' '3.openwrt.pool.ntp.org'

# Apply settings
uci commit
reboot

ベンチマーク

speedtest-cliで測定

接続モジュールとケーブル

Xicom 10G SR SFP+ LC
AliEX
Zoerax OM3 LC to LC Duplex Cable
AliEX

  1. Ryzen 5500GT + ConnectX-4 4121A-XCAT, OM3 Fiber, proxmox9
❯ st -I vmbr10

   Speedtest by Ookla

      Server: IPA CyberLab 400G - Tokyo (id: 48463)
         ISP: au one net
Idle Latency:    11.88 ms   (jitter: 0.36ms, low: 11.57ms, high: 12.41ms)
    Download:  6769.17 Mbps (data used: 9.0 GB)
                 30.40 ms   (jitter: 31.47ms, low: 11.35ms, high: 347.63ms)
      Upload:  4139.20 Mbps (data used: 2.3 GB)
                 11.54 ms   (jitter: 0.16ms, low: 11.17ms, high: 11.95ms)
 Packet Loss:     0.0%
  Result URL: https://www.speedtest.net/result/c/2d113e50-7124-4988-a83a-c7584fef8236
入れてすぐの記録
   Speedtest by Ookla

      Server: IPA CyberLab 400G - Tokyo (id: 48463)
         ISP: au one net
Idle Latency:    11.82 ms   (jitter: 0.23ms, low: 11.68ms, high: 12.00ms)
    Download:  6593.28 Mbps (data used: 10.0 GB)
                 45.25 ms   (jitter: 36.01ms, low: 11.26ms, high: 530.61ms)
      Upload:   791.99 Mbps (data used: 1.4 GB)
                 11.47 ms   (jitter: 0.23ms, low: 10.95ms, high: 12.15ms)
 Packet Loss:     0.0%
  Result URL: https://www.speedtest.net/result/c/7534757a-f9f2-481b-a8b8-7f383516dad6
  1. Ryzen 5950X + ConnectX-3 ConnectX-4 4421AQN, OM3 Fiber, proxmox9
❯ st

   Speedtest by Ookla

      Server: IPA CyberLab 400G - Tokyo (id: 48463)
         ISP: au one net
Idle Latency:    11.29 ms   (jitter: 0.04ms, low: 11.22ms, high: 11.33ms)
    Download:  6481.56 Mbps (data used: 8.6 GB)
                 22.43 ms   (jitter: 30.48ms, low: 11.46ms, high: 333.26ms)
      Upload:  4290.05 Mbps (data used: 4.9 GB)
                 11.53 ms   (jitter: 0.24ms, low: 11.17ms, high: 13.39ms)
 Packet Loss:     0.0%
  Result URL: https://www.speedtest.net/result/c/7113ea05-ea4c-4f33-8ed6-368eb96359b5
入れてすぐの記録
   Speedtest by Ookla

      Server: IPA CyberLab 400G - Tokyo (id: 48463)
         ISP: au one net
Idle Latency:    11.64 ms   (jitter: 0.29ms, low: 11.42ms, high: 12.01ms)
    Download:  6562.09 Mbps (data used: 10.7 GB)
                 23.72 ms   (jitter: 27.98ms, low: 10.90ms, high: 581.95ms)
      Upload:  1412.94 Mbps (data used: 1.7 GB)
                 16.92 ms   (jitter: 28.80ms, low: 10.83ms, high: 817.47ms)
 Packet Loss:     0.0%
  Result URL: https://www.speedtest.net/result/c/285c925e-38b1-4f6e-b1eb-b0e5636169cc

ベンチ後の温度、ethtool内容

(Ryzen7)❯ sensors
zenpower-pci-00c3
Adapter: PCI adapter
SVI2_Core:     1.36 V
SVI2_SoC:      1.01 V
Tdie:         +68.2°C  (high = +95.0°C)
Tctl:         +68.2°C
Tccd1:        +65.2°C
Tccd2:        +54.5°C
SVI2_P_Core: 106.40 W
SVI2_P_SoC:    6.22 W
SVI2_C_Core:  81.03 A
SVI2_C_SoC:    6.18 A

mlx5-pci-0401
Adapter: PCI adapter
sensor0:      +52.0°C  (crit = +105.0°C, highest = +59.0°C)

r8169_0_600:00-mdio-0
Adapter: MDIO adapter
temp1:        +32.5°C  (high = +120.0°C)

nct6799-isa-0290
Adapter: ISA adapter
in0:                   672.00 mV (min =  +0.00 V, max =  +1.74 V)
in1:                     1.66 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in2:                     3.46 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in3:                     3.28 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in4:                     1.82 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:                     1.01 V  (min =  +0.00 V, max =  +0.00 V)
in6:                     1.18 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in7:                     3.46 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in8:                     3.28 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in9:                     1.81 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in10:                    2.05 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in11:                    1.25 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in12:                    1.08 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in13:                  920.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in14:                  904.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in15:                  816.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in16:                    3.28 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in17:                    0.00 V  (min =  +0.00 V, max =  +0.00 V)
fan1:                     0 RPM  (min =    0 RPM)
fan2:                     0 RPM  (min =    0 RPM)
fan3:                     0 RPM  (min =    0 RPM)
fan6:                     0 RPM  (min =    0 RPM)
fan7:                     0 RPM  (min =    0 RPM)
SYSTIN:                 +36.0°C  (high = +80.0°C, hyst = +75.0°C)
                                 (crit = +127.0°C)  sensor = thermistor
CPUTIN:                 +55.5°C  (high = +80.0°C, hyst = +75.0°C)
                                 (crit = +80.0°C)  sensor = thermistor
AUXTIN0:                +16.0°C  (high = +80.0°C, hyst = +75.0°C)
                                 (crit = +100.0°C)  sensor = thermistor
AUXTIN1:                -61.0°C  (high = +80.0°C, hyst = +75.0°C)
                                 (crit = +80.0°C)  sensor = thermistor
AUXTIN2:                +13.0°C  (high = +80.0°C, hyst = +75.0°C)
                                 (crit = +75.0°C)  sensor = thermistor
AUXTIN3:                +31.0°C  (high = +80.0°C, hyst = +75.0°C)
                                 (crit = +100.0°C)  sensor = thermistor
AUXTIN4:                +25.0°C  (high = +80.0°C, hyst = +75.0°C)
                                 (crit = +80.0°C)
SMBUSMASTER 0:          +68.0°C  (high = +80.0°C, hyst = +75.0°C)
AUXTIN5:                 -1.0°C
PCH_CHIP_CPU_MAX_TEMP:   +0.0°C
PCH_CHIP_TEMP:           +0.0°C
PCH_CPU_TEMP:            +0.0°C
TSI0_TEMP:              +68.2°C
pwm1:                       38%  (mode = pwm)  MANUAL CONTROL
pwm2:                      108%  (mode = pwm)
pwm3:                       38%  (mode = pwm)  MANUAL CONTROL
pwm4:                      108%  (mode = pwm)
pwm5:                       68%  (mode = pwm)
pwm6:                       38%  (mode = pwm)  MANUAL CONTROL
pwm7:                       64%  (mode = pwm)
intrusion0:            ALARM
intrusion1:            ALARM
beep_enable:           disabled

mlx5-pci-0400
Adapter: PCI adapter
sensor0:      +52.0°C  (crit = +105.0°C, highest = +59.0°C)
Module0:      +32.0°C  (crit = +80.0°C, highest = +37.0°C)

nvme-pci-0100
Adapter: PCI adapter
Composite:    +46.9°C  (low  = -20.1°C, high = +82.8°C)
                       (crit = +84.8°C)
Sensor 1:     +46.9°C  (low  = -273.1°C, high = +65261.8°C)

-----
(SKS8300系OEM)>sensors
sfp_p7-isa-0000
Adapter: ISA adapter
VCC:           3.29 V  (crit min =  +2.90 V, min =  +3.00 V)
                       (max =  +3.60 V, crit max =  +3.70 V)
temperature:  +41.5°C  (low  =  -5.0°C, high = +80.0°C)
                       (crit low = -10.0°C, crit = +85.0°C)
TX_power:    525.00 uW (max =   1.26 mW, min = 126.00 uW)
                       (lcrit = 100.00 uW, crit =   1.58 mW)
RX_power:    606.00 uW (max =   1.58 mW, min =  50.00 uW)
                       (lcrit =  40.00 uW, crit =   1.99 mW)
bias:          6.00 mA (crit min =  +0.00 A, min =  +0.00 A)
                       (max =  +0.01 A, crit max =  +0.01 A)

cpu_thermal-virtual-0
Adapter: Virtual device
temp1:        +49.0°C

sfp_p5-isa-0000
Adapter: ISA adapter
VCC:           3.28 V  (crit min =  +2.90 V, min =  +3.00 V)
                       (max =  +3.60 V, crit max =  +3.70 V)
temperature:  +42.6°C  (low  =  -5.0°C, high = +80.0°C)
                       (crit low = -10.0°C, crit = +85.0°C)
TX_power:    529.00 uW (max =   1.26 mW, min = 126.00 uW)
                       (lcrit = 100.00 uW, crit =   1.58 mW)
RX_power:    699.00 uW (max =   1.58 mW, min =  50.00 uW)
                       (lcrit =  40.00 uW, crit =   1.99 mW)
bias:          7.00 mA (crit min =  +0.00 A, min =  +0.00 A)
                       (max =  +0.01 A, crit max =  +0.01 A)

sfp_p2-isa-0000
Adapter: ISA adapter
VCC:           3.30 V  (crit min =  +2.90 V, min =  +3.00 V)
                       (max =  +3.60 V, crit max =  +3.70 V)
temperature:  +39.8°C  (low  =  -5.0°C, high = +80.0°C)
                       (crit low = -10.0°C, crit = +85.0°C)
TX_power:    529.00 uW (max =   1.26 mW, min = 126.00 uW)
                       (lcrit = 100.00 uW, crit =   1.58 mW)
RX_power:    564.00 uW (max =   1.58 mW, min =  50.00 uW)
                       (lcrit =  40.00 uW, crit =   1.99 mW)
bias:          6.00 mA (crit min =  +0.00 A, min =  +0.00 A)
                       (max =  +0.01 A, crit max =  +0.01 A)
                       
以前の温度
# sensors
sfp_p7-isa-0000
Adapter: ISA adapter
VCC:           3.29 V  (crit min =  +2.90 V, min =  +3.00 V)
                       (max =  +3.60 V, crit max =  +3.70 V)
temperature:  +43.0°C  (low  =  -5.0°C, high = +80.0°C)
                       (crit low = -10.0°C, crit = +85.0°C)
TX_power:    527.00 uW (max =   1.26 mW, min = 126.00 uW)
                       (lcrit = 100.00 uW, crit =   1.58 mW)
RX_power:    594.00 uW (max =   1.58 mW, min =  50.00 uW)
                       (lcrit =  40.00 uW, crit =   1.99 mW)
bias:          6.00 mA (crit min =  +0.00 A, min =  +0.00 A)
                       (max =  +0.01 A, crit max =  +0.01 A)

cpu_thermal-virtual-0
Adapter: Virtual device
temp1:        +50.0°C

sfp_p5-isa-0000
Adapter: ISA adapter
VCC:           3.28 V  (crit min =  +2.90 V, min =  +3.00 V)
                       (max =  +3.60 V, crit max =  +3.70 V)
temperature:  +43.8°C  (low  =  -5.0°C, high = +80.0°C)
                       (crit low = -10.0°C, crit = +85.0°C)
TX_power:    526.00 uW (max =   1.26 mW, min = 126.00 uW)
                       (lcrit = 100.00 uW, crit =   1.58 mW)
RX_power:    677.00 uW (max =   1.58 mW, min =  50.00 uW)
                       (lcrit =  40.00 uW, crit =   1.99 mW)
bias:          7.00 mA (crit min =  +0.00 A, min =  +0.00 A)
                       (max =  +0.01 A, crit max =  +0.01 A)

sfp_p2-isa-0000
Adapter: ISA adapter
VCC:           3.30 V  (crit min =  +2.90 V, min =  +3.00 V)
                       (max =  +3.60 V, crit max =  +3.70 V)
temperature:  +41.0°C  (low  =  -5.0°C, high = +80.0°C)
                       (crit low = -10.0°C, crit = +85.0°C)
TX_power:    527.00 uW (max =   1.26 mW, min = 126.00 uW)
                       (lcrit = 100.00 uW, crit =   1.58 mW)
RX_power:    559.00 uW (max =   1.58 mW, min =  50.00 uW)
                       (lcrit =  40.00 uW, crit =   1.99 mW)
bias:          6.00 mA (crit min =  +0.00 A, min =  +0.00 A)
                       (max =  +0.01 A, crit max =  +0.01 A)

# ethtool lan7
Settings for lan7:
        Supported ports: [ FIBRE ]
        Supported link modes:   10000baseSR/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: No
        Supported FEC modes: Not reported
        Advertised link modes:  10000baseSR/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: 10000Mb/s
        Duplex: Full
        Port: FIBRE
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: off
        Supports Wake-on: d
        Wake-on: d
        Link detected: yes
# ethtool lan5
Settings for lan5:
        Supported ports: [ FIBRE ]
        Supported link modes:   10000baseSR/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: No
        Supported FEC modes: Not reported
        Advertised link modes:  10000baseSR/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: 10000Mb/s
        Duplex: Full
        Port: FIBRE
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: off
        Supports Wake-on: d
        Wake-on: d
        Link detected: yes
# ethtool lan2
Settings for lan2:
        Supported ports: [ FIBRE ]
        Supported link modes:   10000baseSR/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: No
        Supported FEC modes: Not reported
        Advertised link modes:  10000baseSR/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: 10000Mb/s
        Duplex: Full
        Port: FIBRE
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: off
        Supports Wake-on: d
        Wake-on: d
        Link detected: yes

その他のアプリのインストール方法

lmsensors_exporterのインストール

バイナリがデカいので、Openwrtで遊ぶ人には非推奨。
L2スイッチ扱いして死んでないかだけしか見ない人で、
なんか弄りてぇなぁ!って人だけ見てね

lmsensors_exporterのフォークを作ってRTL9303用にビルドしました。
10MBあるのでこれ入れたら遊べないですが、SFPポートの供給電圧とか消費電力をGrafanaで見れるようになります。
よかったらどうぞ。
https://github.com/letwir/lmsensors_exporter
多分luaでsensorsをパースしてnode_exporterに投げたほうが効率的。

ssh L3スイッチ
# 前提アプリのインストール
apk add lm-sensors
wget https://github.com/letwir/lmsensors_exporter/releases/download/0.1.1/lmsensors_exporter-rtl9303 -O /usr/bin
echo "lmsensors_exporter &" | tee /etc/rc.local
# lmsensors_exporter & が入っていればOK
cat /etc/rc.local

# lmsensors_exporterのインストール
wget https://github.com/letwir/lmsensors_exporter/releases/download/0.1.1/lmsensors_exporter-rtl9303 -O /
usr/bin/lmsensors_exporter
chmod +x /usr/bin/lmsensors_exporter

lmsensors_exporter &

Loki-exporterのインストール

logreadをパースしてLokiに登録するアプリ。
https://github.com/defanator/openwrt-loki-exporter

ssh L3スイッチ
# Loki-exporterのインストール
# https://github.com/defanator/openwrt-loki-exporter/issues/27
curl -LO https://github.com/defanator/openwrt-loki-exporter/releases/download/v1.0.6/loki-exporter-1.0.6-r0.apk
# 1f8a5b77201204711982ee3219772e2dde79c496616a3de628bd9218d5a9080aならOK
sha256sum loki-exporter-1.0.6-r0.apk
apk extract --allow-untrusted loki-exporter-1.0.6-r0.apk 
cp -R etc/ /etc
cp -R lib/ /lib
cp -R usr/ /usr
rm -r etc lib usr loki-exporter-1.0.6-r0.apk

sysctlのチューニング

ssh L3スイッチ
# bbrインストール
apk add kmod-tcp-bbr
# 設定流し込み
tee /etc/sysctl.d/10-custom.conf << EOF

# Enable IPv6 Privacy Extensions
net.ipv6.conf.all.use_tempaddr = 0
net.ipv6.conf.default.use_tempaddr = 0
net.ipv6.conf.switch/1.use_tempaddr = 0

# RA receive
net.ipv6.conf.all.accept_ra = 2
net.ipv6.conf.default.accept_ra = 2
net.ipv6.conf.all.autoconf = 1
net.ipv6.conf.default.autoconf = 1

# NIC accept
net.ipv6.conf.eth0.accept_ra=0

# ICMPv6
net.ipv6.icmp.ratelimit = 0

# ipv6 PMTU
net.ipv4.tcp_mtu_probing = 1

# neighbor cache
net.ipv6.neigh.default.gc_thresh1 = 4096
net.ipv6.neigh.default.gc_thresh2 = 8192
net.ipv6.neigh.default.gc_thresh3 = 16384

# BBR v3 Congestion Control Configuration
net.core.default_qdisc = fq_codel
net.ipv4.tcp_congestion_control = bbr

# TCP Buffer Optimization
net.core.rmem_max = 134217728
net.core.wmem_max = 134217728
net.ipv4.tcp_rmem = 4096 87380 67108864
net.ipv4.tcp_wmem = 4096 65536 67108864

# TCP Performance Tuning
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_sack = 1
net.ipv4.tcp_no_metrics_save = 1
net.ipv4.tcp_moderate_rcvbuf = 1

# Network Stack Optimization
net.core.netdev_max_backlog = 5000
net.ipv4.tcp_slow_start_after_idle = 0
EOF
sysctl -p /etc/sysctl.d/10-custom.conf

Openwrtの更新方法

公式推奨の方法で行う。
やっていることは公式HPで入っているapkを入れたrootfsをビルド依頼し、それをDLして更新という方法だ。
なので公式が認知していないapkアプリが入っているとコケる。
消して更新後に入れ直すことで問題なくアップデートできる。

bash L3スイッチ
apk add luci-app-attendedsysupgrade

LuCi-Update
Search for firmware upgradeを押して進むと問題なければアップグレードが進む。
もしアプリがアップデートできない等のエラーが出たら、そのアプリを一旦消す必要がある。
エラー文の最後に書かれている。
当環境では以下の通りだった。

ssh L3スイッチ
apk del bc
apk del wget
apk del libmagicdel
apk del file
apk del libi2c
apk del i2c-tools
apk del lsblk
apk del libiwinfo-lua
apk del prometheus-node-exporter-lua-dawn
apk del prometheus-node-exporter-lua-hwmon
apk del prometheus-node-exporter-lua-nat_traffic
apk del prometheus-node-exporter-lua-thermal

再度アップデートが通ったらしばらく更新のため、電源を切らないように言われるのでWebGUIが更新されるまで待つ。

その後、さっき消したアプリを再度入れて、初期設定を完了させる。

ssh L3スイッチ
# 追加でwgetよりhttps対応のwget-sslを優先して入れる
apk add wget-ssl ca-certificates ca-bundle libustream-openssl librt
apk add bc
apk add libmagicadd
apk add file
apk add libi2c
apk add i2c-tools
apk add lsblk
apk add libiwinfo-lua
apk add prometheus-node-exporter-lua-dawn
apk add prometheus-node-exporter-lua-hwmon
apk add prometheus-node-exporter-lua-nat_traffic
apk add prometheus-node-exporter-lua-thermal

# 再起動
reboot

オマケ:今のOpenwrtの設定(抜粋)

ipv6での通信も出来るようにしてみたが、pingでしか試してないのでぶっちゃけMTUの良さを味わえているとは言えない。
また、v4のMTUを無理やり9000に上げても当機種では接続がよく切れたため、この端末は1500で運用している。

以下の行頭にuci set を入れて使うことで設定を上書きできる。
uci commit; rebootで再起動し反映。

dropbear.main.enable='0'
loki_exporter.@loki_exporter[0]=loki_exporter
loki_exporter.@loki_exporter[0].loki_push_url='https://<LOKIのURL>:3100/api/v1/push'
loki_exporter.@loki_exporter[0].loki_auth_header='ADDME'
loki_exporter.@loki_exporter[0].start_delay_on_boot='120'
loki_exporter.@loki_exporter[0].skewed_timestamps_delta_threshold='3600'
luci.languages=internal
luci.languages.ja='日本語 (Japanese)'

network.globals=globals
network.globals.packet_steering='1'
network.globals.multipath='1'
network.globals.tcp_l3mdev='1'
network.globals.udp_l3mdev='1'
network.switch=device
network.switch.name='switch'
network.switch.type='bridge'
network.switch.mtu='1500'
network.switch.mtu6='9000'
network.lan_vlan=bridge-vlan
network.lan_vlan.device='switch'
network.lan_vlan.vlan='1'
network.lan_vlan.ports='lan1 lan2 lan3 lan4 lan5 lan6 lan7 lan8'
network.@device[1]=device
network.@device[1].name='switch.1'
network.@device[1].macaddr='d0:aa:5f:01:46:b4'
network.@device[1].promisc='1'
network.@device[1].arp_accept='1'
network.@device[1].mtu6='9000'
network.lan=interface
network.lan.device='switch.1'
network.lan.proto='static'
network.lan.ipaddr='192.168.175.4/24'
network.lan.gateway='192.168.175.1'
network.lan.mtu='1500'
network.lan.dns='192.168.175.49'
network.lan.multipath='on'
network.lan.delegate='0'
network.@device[2]=device
network.@device[2].name='lan8'
network.@device[2].promisc='1'
network.@device[2].ipv6='1'
network.@device[3]=device
network.@device[3].name='lan6'
network.@device[3].promisc='1'
network.@device[3].ipv6='1'
network.@device[4]=device
network.@device[4].name='lan4'
network.@device[4].promisc='1'
network.@device[4].acceptlocal='1'
network.@device[4].arp_accept='1'
network.@device[4].ipv6='1'
network.@device[4].mtu6='9000'
network.@device[5]=device
network.@device[5].name='lan7'
network.@device[5].promisc='1'
network.@device[5].ipv6='1'
network.@device[6]=device
network.@device[6].name='lan3'
network.@device[6].promisc='1'
network.@device[6].ipv6='1'
network.@device[7]=device
network.@device[7].name='lan1'
network.@device[7].promisc='1'
network.@device[7].ipv6='1'
network.@device[8]=device
network.@device[8].name='lan2'
network.@device[8].promisc='1'
network.@device[8].ipv6='1'
network.@device[9]=device
network.@device[9].name='lan5'
network.@device[9].promisc='1'
network.@device[9].ipv6='1'
network.lan6=interface
network.lan6.proto='dhcpv6'
network.lan6.device='switch.1'
network.lan6.reqaddress='try'
network.lan6.reqprefix='auto'
network.lan6.norelease='1'
network.lan6.multipath='on'
network.lan6.ip6assign='64'
network.lan6.ip6hint='0'
prometheus-node-exporter-lua.main=prometheus-node-exporter-lua
prometheus-node-exporter-lua.main.listen_interface='lan'
prometheus-node-exporter-lua.main.listen_port='9100'
prometheus-node-exporter-lua.main.listen_ipv6='0'
system.@system[0]=system
system.@system[0].timezone='JST-9'
system.@system[0].zonename='Asia/Tokyo'
system.@system[0].clock_hourcycle='h23'
system.ntp=timeserver
system.ntp.server='0.openwrt.pool.ntp.org' '1.openwrt.pool.ntp.org' '2.openwrt.pool.ntp.org' '3.openwrt.pool.ntp.org'

Discussion