# 34.6.USB 网络共享

许多手机提供通过 USB 分享数据连接的选项（通常称为“共享网络”）。此功能使用 RNDIS、CDC 或自定义的 Apple® iPhone®/iPad® 协议。

* Android™ 设备通常使用 [urndis(4)](https://man.freebsd.org/cgi/man.cgi?query=urndis\&sektion=4\&format=html) 驱动程序。
* Apple® 设备使用 [ipheth(4)](https://man.freebsd.org/cgi/man.cgi?query=ipheth\&sektion=4\&format=html) 驱动程序。
* 较旧的设备通常使用 [cdce(4)](https://man.freebsd.org/cgi/man.cgi?query=cdce\&sektion=4\&format=html) 驱动程序。

在连接设备之前，将适当的驱动程序加载到内核中：

```sh
# kldload if_urndis
# kldload if_cdce
# kldload if_ipheth
```

待设备连接，`ue`*0* 将作为正常的网络设备可用。确保在设备上启用了“USB 共享网络”选项。

为了使此更改永久生效，并在启动时加载驱动程序，将适当的行添加到 **/boot/loader.conf** 文件中：

```sh
if_urndis_load="YES"
if_cdce_load="YES"
if_ipheth_load="YES"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://handbook.bsdcn.org/di-34-zhang-gao-ji-wang-luo/34.6.-usb-wang-luo-gong-xiang.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
