Loading

NanoPi R1随身路由的二三事

背景

想要弄一个随身路由,能够通过USB连接iPhone热点共享,输出更稳定的wifi信号并加入自己的虚拟局域网实现在外访问家里设备。

硬件

这里选择NanoPi R1有USB接口和2.4G无线网络,有openwrt官方支持。
开始通过openwrt.ai下载23.05固件刷写wifi总是不正常,开始是radio0重启又变成radio1很不稳定。
从官方issue得知高版本内核uboot有bug,由于wifi模块采用sdio而每次启动emmc顺序不固定导致radio绑定异常。
相关PR很早有人提过但始终未合入主线,目前需要降级21.02.5及以前版本使用,无线正常。
这里给出官方sd卡固件下载地址

换源

first thing first

src/gz openwrt_core https://mirrors.aliyun.com/openwrt/releases/21.02.2/targets/sunxi/cortexa7/packages
src/gz openwrt_base https://mirrors.aliyun.com/openwrt/releases/21.02.2/packages/arm_cortex-a7_neon-vfpv4/base
src/gz openwrt_luci https://mirrors.aliyun.com/openwrt/releases/21.02.2/packages/arm_cortex-a7_neon-vfpv4/luci
src/gz openwrt_packages https://mirrors.aliyun.com/openwrt/releases/21.02.2/packages/arm_cortex-a7_neon-vfpv4/packages
src/gz openwrt_routing https://mirrors.aliyun.com/openwrt/releases/21.02.2/packages/arm_cortex-a7_neon-vfpv4/routing
src/gz openwrt_telephony https://mirrors.aliyun.com/openwrt/releases/21.02.2/packages/arm_cortex-a7_neon-vfpv4/telephony

软件

前两行是官方对iPhone USB tethering的安装建议,最后tailscale用来实现类似ipsec的效果。

opkg install kmod-nls-base kmod-usb-core kmod-usb-net kmod-usb-net-cdc-ether kmod-usb2
opkg install kmod-usb-net-ipheth usbmuxd libimobiledevice usbutils 
opkg install tailscale

配置

装好软件把usb网卡eth2绑定wan和wan6即可实现正常上网,原有的千兆wan口eth0建议不浪费转入br-lan网桥。
注意wan6一定要绑定,目前tailscale在ipv6状态下P2P成功率很高。
虚拟局域网部分用到的命令是tailscale up --advertise-routes=192.168.0.0/24 --accept-routes设置完成后需要在网页控制台对subnet route放行,此时子网客户端已经可以访问tailscale广播的内网地址。
机身上的LED灯也不浪费,WAN绑定usb网卡,LAN绑定ap无线。

IPv6

设置ipv6需要一些技巧能够达到类似passthrough的效果,修改内容:
接口->WAN6->DHCP服务器
忽略此接口 -> 取消打勾.
指定的主接口 -> 打勾
RA服务;DHCPV6服务;ndp代理 -> 中继模式.
接口 ->LAN -> DHCP
IPV6 设置 RA服务;DHCPV6服务;ndp代理 ->中继模式.

不足

  • 使用官方luci界面没装argon改善移动端访问体验
  • 官方固件不会自动扩充sd卡剩余空间(够用没折腾)

参考

NanoPi R1 - sees two radios · Issue #12237 · openwrt/openwrt · GitHub
[OpenWrt Wiki] Smartphone USB tethering
Subnet routers and traffic relay nodes · Tailscale Docs
openwrt ipv6 passthrough有没有大佬知道怎么弄-软路由,x86系统,openwrt(x86),Router OS 等-恩山无线论坛

posted @ 2024-05-10 22:12  azureology  阅读(81)  评论(0编辑  收藏  举报