> For the complete documentation index, see [llms.txt](https://docs.verge.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verge.io/run-the-platform/zh/wang-luo/port-mirroring.md).

# 端口镜像

端口镜像会将网络流量复制到一个虚拟机网卡，从而允许对数据包进行分析，用于监控或诊断。

## 配置端口镜像

1. 启用 **端口镜像** 在网络设置中。 ![portmirrordropdown.png](/files/fdcce8b9502af4ccb5e88584af7f7ac746fb5ef7)
   * 选择 ***南北向*** 复制经过网络路由器的数据包
   * 选择 ***东西向*** 复制经过路由器以及所有网络内部数据包

{% hint style="warning" %}
***东西向*****&#x20;端口镜像通常只建议作为用于诊断的临时设置；长时间使用可能会影响性能，因为它会复制所有网络流量。**
{% endhint %}

2. 单击 **提交** 以保存更改。
3. 单击 **重启** 在左侧菜单中启动网络。
4. 创建一个将用于端口分析的虚拟机（或使用现有虚拟机）。
5. [**向虚拟机添加一个网卡**](/run-the-platform/zh/xu-ni-ji/vm-nics.md):
   * 在 **网络** 字段，选择： *NETWORKNAME*\_mirror
   * 单击 **提交** （页面底部）以保存
6. （重新）启动虚拟机。
7. 可在虚拟机中使用所选的操作系统/应用软件进行数据包分析。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.verge.io/run-the-platform/zh/wang-luo/port-mirroring.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
