华为交换机配置端口镜像命令包括:1. 进入特权模式;2. 创建镜像会话,指定源端口和目的端口/地址;3. 配置镜像类型(流量类型、vlan);4. 启用镜像;5. 禁用镜像。

华为交换机配置端口镜像命令
如何配置端口镜像?
在华为交换机上配置端口镜像,需要执行以下步骤:
1. 进入特权模式
<code>> enable</code>
2. 创建端口镜像会话
<code>> mirror source <端口> > mirror destination <端口/环回地址/组播组></code>
- :要镜像的端口
- :接收镜像数据包的端口、环回地址或组播组
3. 配置端口镜像数据类型
<code>> mirror destination port <端口> vlan <VLAN ID> traffic both</code>
- :接收镜像数据包的端口
-
:要镜像的 VLAN - traffic both:镜像入站和出站流量
4. 启用端口镜像
<code>> mirror enable</code>
5. 禁用端口镜像
<code>> undo mirror enable</code>
示例:
将端口 GigabitEthernet0/0/1 的流量镜像到端口 GigabitEthernet0/0/2:
<code>> enable > mirror source GigabitEthernet0/0/1 > mirror destination GigabitEthernet0/0/2 > mirror destination port GigabitEthernet0/0/2 vlan 10 traffic both > mirror enable</code>
注意:
- 只能存在一个活动的端口镜像会话。
- 接收镜像数据的端口必须处于同一 VLAN 中。
- 端口镜像会消耗交换机资源,请谨慎使用。











