10ge 1/0/2 2、在SwitchA上配置接口10GE1/0/1为镜像端口,以监控其入方向的报文 [SwitchA] interface 10ge 1/0/1 [SwitchA-10GE1/0/1] port-mirroring
将gi 0/0/2 口配置为观察接口 observe-port 1 interface GigabitEthernet 0/0/2 注:1 为观察组 int gi 0/0/1 port-mirroring
③执行命令port-mirroring to observe-portobserve-port-index { both | inbound | outbound },将接口接收或发送的报文镜像至指定观察端口 l2-acl | name acl-name } [ rule rule-id ] to observe-port observe-port-index 【2】检查配置结果 # 执行命令display port-mirroring <HUAWEI> display port-mirroring -------------------------------------------------------------------- 删除镜像配置前,可以执行display port-mirroring命令和display current-configuration命令查看设备上的镜像配置,后续操作步骤仅提供具体的删除示例作为参考。 删除端口镜像配置 <HUAWEI> system-view [HUAWEI] interface gigabitethernet 0/0/2 [HUAWEI-GigabitEthernet0/0/2] undo port-mirroring
behavior [name](绑定分类与行为) traffic-policy [name] inbound(应用流策略) 八、端口镜像 observe-port [interface](配置观察端口) port-mirroring
例如,如果要镜像GigabitEthernet 0/1端口上的流量: interface GigabitEthernet 0/1 配置端口镜像: 输入以下命令启用端口镜像并将流量复制到目标端口: port-mirroring to <目标端口> 例如,如果要将源端口的流量复制到GigabitEthernet 0/2端口: port-mirroring to GigabitEthernet 0/2 保存配置: 输入以下命令保存配置更改
observe-port 1 interface gigabitethernet0/0/3 [SW] interfae gigabitethernet0/0/2 [SW-gigabitethernet0/0/2] port-mirroring
interface gigabitethernet1/0/1 进入流量采集接口:interface gigabitethernet1/0/2 配置镜像规则,将g1/0/2入方向的流量镜像到g1/0/1:port-mirroring
[SwitchA] interface gigabitethernet 1/0/2 [SwitchA-GigabitEthernet1/0/1] port-mirroring to observe-port