Sharing a Network Connection with USB RNDIS¶
How to expose an Ethernet-over-USB interface using RNDIS in an embedded Linux device.
This English edition retains the original diagrams and practical code or command examples.

Commands and examples¶
+---------------------------+
| 用户空间应用层 | <- 例如,通过 `ifconfig` 或 `ip` 命令配置网络
+---------------------------+
|
+---------------------------+
| 网络协议栈层(Linux) | <- 网络协议栈,如 TCP/IP、UDP 等
+---------------------------+
|
+---------------------------+
| 内核网络驱动层 | <- RNDIS 驱动,负责 USB 网络设备的初始化与数据传输
+---------------------------+
|
+---------------------------+
| USB 核心驱动层 | <- 处理 USB 设备的通信,支持 RNDIS 设备
+---------------------------+
|
+---------------------------+
| USB 设备硬件层 | <- 设备本身,支持 USB 规范并实现 RNDIS 协议
+---------------------------+
scp testfile.txt [email protected]:/home/user/
scp [email protected]:/home/user/testfile.txt /local/destination/
Practical notes¶
Validate pin multiplexing, clocks, power sequencing, kernel configuration, and device-tree bindings on the target board before drawing conclusions from a test result.