🛠 OpenWrt upstream 24.10 en routeur 2,5G complet
Objectives
Install upstream OpenWrt (not just FriendlyWrt) on the NanoPi R5S: the board is officially supported under the device friendlyarm_nanopi-r5s in the rockchip target, available since the openwrt-24.10 branch (absent in 23.05). You will write the complete UCI configuration for WAN/LAN, enable hardware flow offloading — key to achieving >1 Gbps routing throughput on RK3568 — and validate with iperf3. Advanced level: sysupgrade manipulation, configuration backup, and rollback.
Hardware
- NanoPi R5S (2 or 4 GB) with an OpenWrt rockchip nanopi-r5s image (sysupgrade or sdcard) on microSD, eMMC, or NVMe M.2
- Serial console recommended for the first boot (1,500,000 bps)
- PC with a 2.5G port for measurements, Cat.6 cable
Complete code
#!/bin/sh
# Configuration UCI routeur 2,5G — à adapter selon les noms vus par ip link
# eth0 = gmac0/RTL8211F (GbE WAN) ; eth1/eth2 = RTL8125BG (2,5G LAN)
uci batch <<'EOF'
set network.wan.proto='dhcp'
set network.wan.device='eth0'
set network.lan.type='bridge'
set network.lan.proto='static'
set network.lan.ipaddr='192.168.69.1'
set network.lan.device='br-lan'
add network network
set network.@network[-1].name='br-lan'
set network.@network[-1].type='bridge'
set network.@network[-1].ifname='eth1 eth2'
EOF
# Flow offloading logiciel + matériel (indispensable pour dépasser 1 Gbps)
uci set firewall.@defaults[0].flow_offloading='1'
uci set firewall.@defaults[0].flow_offloading_hw='1'
uci commit
/etc/init.d/network restart
/etc/init.d/firewall restart
# Sauvegarde puis vérification des vitesses
sysctl -w net.ipv4.conf.all.send_redirects=0
ubus call system board | head
for i in eth0 eth1 eth2; do ethtool $i | grep -E 'Speed|Link'; done
# iperf3 -s sur le R5S ; iperf3 -c <ip> -t 30 -P 4 depuis le PC 2,5G
Expected verification
ubus call system board confirms the rockchip target and the model FriendlyElec NanoPi R5S. ethtool displays 2500Mb/s on eth1/eth2 and 1000Mb/s on eth0. iperf3 approaches CNX benchmarks: ~2.35 Gbps in Rx, ~1.85 Gbps in Tx per 2.5G port, ~941 Mbps in WAN. The CPU load remains low thanks to offloading (top during the test). Note: the default firewall settings of FriendlyWrt/OpenWrt may block WAN traffic until the wan zone is accepted — run fw4 reload after modification.
Common errors
- Downloading a 23.05 image: the device only exists starting from 24.10; check the branch.
- Overwriting the configuration by flashing over FriendlyWrt without backup: run
sysupgrade -bbeforehand. - Forgetting flow offloading: without it, routing caps near gigabit speeds and the CPU load spikes — a historical issue documented by CNX at launch.
- Interface names changing after a
mac-addresschange or a kernel update: always explicitly definedevice=in UCI rather than assuming eth0/eth1. - Not testing the two 2.5G ports separately: the mapping between PCIe controller ↔ physical port is not documented anywhere.
Other tutorials for this board
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash