# 28.3.USB 设备模式网络接口

虚拟网络接口支持由模板 1、8 和 10 提供。需要注意的是，这些模板都不适用于 Microsoft Windows。其他主机操作系统可以与所有三个模板兼容。必须加载 [usb\_template(4)](https://man.freebsd.org/cgi/man.cgi?query=usb_template\&sektion=4\&format=html) 和 [if\_cdce(4)](https://man.freebsd.org/cgi/man.cgi?query=if_cdce\&sektion=4\&format=html) 内核模块。

确保必要的模块已加载，并且在启动时设置了正确的模板，可以在 **/boot/loader.conf** 中添加以下行（如果该文件不存在，请创建它）：

```sh
if_cdce_load="YES"
hw.usb.template=1
```

要在不重启的情况下加载模块并设置模板，请使用：

```sh
# kldload if_cdce
# sysctl hw.usb.template=1
```


---

# 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-28-zhang-usb-she-bei-mo-shi-usb-otg/28.3.-usb-she-bei-mo-shi-wang-luo-jie-kou.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.
