Files
LFLede/RM520N-5G/文档/RM520N-硬件结构与网络拓扑.md
T
2026-08-21 18:28:33 +08:00

132 lines
5.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 硬件结构与网络拓扑(2026-08-19)
> 峰的家用 NAS/软路由硬件拓扑与 RM520N-GL 5G 模块直通结构
> 整理日期:2026-08-19
---
## 一、硬件结构
### 宿主机(飞牛 Fnos
| 项 | 值 |
|---|---|
| 系统 | 飞牛 fnOS(云主机/软路由宿主) |
| CPU | Intel Core i5-8250U @ 1.60GHz4核8线程) |
| 内存 | 15 GiB |
| 网卡 | 4 × Intel I226-Venp1s0 / enp2s0 / enp3s0 / enp4s0 |
| 网卡现状 | enp1s0 = UPenp4s0 = UPenp2s0 / enp3s0 = 未接(DOWN |
| 虚拟化 | KVM/QEMUlibvirt`pc-i440fx-7.2`),需用 `vfio` 直通 |
### 5G 模块(移远 RM520N-GL
| 项 | 值 |
|---|---|
| 型号 | Quectel RM520N-GL |
| PCI 位置(宿主) | `06:00.0`PCI_ID `17cb:0308`Qualcomm Device 0308 |
| 物理接口 | PCIe / M.2 转接卡(M.2→PCIE ×1 |
| 直通方式 | vfio-pci 直通给 istoreos 虚拟机 |
| 固件 | RM520NGLAAR03A04M4G |
| IMEI | 868371050275649 |
| SIM | 联通(ICCID 89860125801671811893IMSI 460092810130406 |
### istoreos 虚拟机(5G 路由器)
| 项 | 值 |
|---|---|
| VM 名称 | adwi9jj4libvirt domain-1 |
| 系统 | iStoreOSOpenWrt 定制版,musl libc |
| 登录 IP | 192.168.110.200rootSSH |
| 虚拟网卡 | 2 × virtio-net-pcitap 桥接) |
| 直通 | vfio-pci hostdev `0000:06:00.0` → guest PCI `00:0a.0` |
---
## 二、虚拟网卡映射(宿主 ↔ istoreos)
| 宿主网卡 | istoreos 虚拟网卡 | guest 接口 | MAC | 网段/用途 |
|---|---|---|---|---|
| enp1s0 (UP) | net0 (virtio, tap) | **eth0** | dc:f9:90:7a:e3:d8 | 192.168.110.200 → 走宽带(管理+SSH |
| enp4s0 (UP) | net1 (virtio, tap) | **eth1** | ec:45:6d:3b:62:ef | 192.168.200.1 → 5G 出口(给主路由 wan2 |
> 注:宿主网卡通过 OVS/veth`enp1s0-ovs`、`enp4s0-ovs` 等)连接。
---
## 三、网络拓扑(逻辑)
```
┌─────────────────────────────────────────┐
│ 主路由 (OpenWrt) │
│ wan1 = 192.168.1.2 → 光猫宽带 (优先) │
│ wan2 = 192.168.200.2 → istoreos eth1 │
│ lan = 192.168.110.1 │
└──────┬────────────────────┬──────────────┘
│ │
(宽带) │ │ (5G 备份出口)
│ │
┌────────────▼──────┐ ┌─────────▼──────────┐
│ istoreos eth0 │ │ istoreos eth1 │
│ 192.168.110.200 │ │ 192.168.200.1 │
│ (管理/SSH) │ │ (NAT → 5G) │
└────────┬──────────┘ └─────────┬──────────┘
│ │
(直通vfio) │
┌───────────▼──────────┐ │
│ RM520N-GL 5G 模块 │◄────────────┘
│ 06:00.0 → 00:0a.0 │
│ MBIM → rmnet_mhi0.1 │
└──────────────────────┘
```
### 数据流向
| 流量 | 路径 | 出口 |
|---|---|---|
| istoreos 自身管理 | eth0 → 默认路由 110.1 | **宽带**(主路由 wan1 |
| 主路由 wan2 侧 (200.x) | eth1 → 策略路由表 200 → 5G NAT | **5G** |
| 主路由正常上网 | wan1 宽带(192.168.1.2 | **宽带**(优先) |
| 宽带断时 | 主路由自动切 wan2 → istoreos 5G | **5G**(备份) |
---
## 四、关键驱动与配置
### 驱动
- **pcie_mhi** V1.3.8(移远私有 MHI 驱动),参数 `mhi_mbim_enabled=1`**MBIM 模式**
- MBIM 设备节点:`/dev/mhi_MBIM`(控制通道)、`/dev/mhi_DUN`AT 通道)
- 数据接口:`rmnet_mhi0`(主)、`rmnet_mhi0.1`(实际拨号数据面,qmap vlan)
### istoreos 关键接口
| 接口 | IP | 作用 |
|---|---|---|
| eth0 (wan) | 192.168.110.200/24,网关 110.1 | 宽带/管理 |
| eth1 (br-lan) | 192.168.200.1/24 | 主路由 wan2 网关 |
| rmnet_mhi0.1 | 运营商动态 IP (10.x) | 5G 数据面 |
| docker0 / br-lan | — | 系统默认 |
### 开机自启链(重启自动恢复)
1. **/etc/modules.d/90-pcie_mhi**`pcie_mhi mhi_mbim_enabled=1` 驱动加载
2. **S95modem5g**:等待 `/dev/mhi_MBIM``quectel-CM -s wonet` 拨号(MBIM
3. **S96wan5g-route**:等待 `rmnet_mhi0.1` 有 IP → 加策略路由表 200 + NAT
> 注:rc.local **不需要**手动 bind mhi_q(手动强绑会抢设备致 SYS_ERR)。模块失联时先断电重启飞牛,仍无效再手动 `echo 0000:00:0a.0 > /sys/bus/pci/drivers/mhi_q/bind` 临时唤醒。详见《RM520N-故障排查与自启链路.md》
---
## 五、当前 IP 网段一览
| 网段 | 用途 | 关键设备 |
|---|---|---|
| 192.168.1.0/24 | 光猫宽带 | 主路由 wan1 = 192.168.1.2 |
| 192.168.110.0/24 | 主路由 LAN | 主路由 110.1istoreos eth0 = 110.200 |
| 192.168.200.0/24 | 主路由 wan2 ↔ istoreos eth1 | 主路由 wan2 = 200.2istoreos eth1 = 200.1 |
| 10.x.x.x | 5G 运营商内网 | istoreos rmnet_mhi0.1 |
---
## 六、备份与归档
- 完整成功路线归档于本目录上级:`/vol2/1000/OS/RM520N-5G-成功路线/`
- `文件/configs/` 基础拨号配置
- `文件/多WAN配置/` 双出口(eth1→5G / eth0→宽带)
- `文件/binaries/` musl 编译的 Quectel-CM V1.6.8
- `文件/source/` V1.6.8 源码
- 归档压缩包:`/vol2/1000/OS/RM520N-5G-成功路线.tar.gz`