华为交换机端口镜像配置方法
1、配置举例
1、 一对一本地端口镜像(一个监控设备监控一个端口)
拓扑图例见下图所示:

2、命令:
observe-port1 interface GigabitEthernet1/0/2 //观察口
#
interface GigabitEthernet1/0/1或者GigabitEthernet1/0/10 (上联口) //镜像口
port-mirroring to observe-port1 inbound/outbound/both
3、多对一端口本地端口镜像(多个监控设备同时监控一个端口)
拓扑图例见下图所示:

4、方法一命令:(单个配置观察端口)
observe-port 1 interface GigabitEthernet1/0/2 //观察口1
observe-port 2 interface GigabitEthernet1/0/3 //观察口2
observe-port 3 interface GigabitEthernet1/0/4 //观察口3
#
interface GigabitEthernet1/0/1或者GigabitEthernet1/0/10 (上联口) //镜像口
port-mirroring to observe-port 1 inbound/outbound/both
port-mirroring to observe-port 2 inbound/outbound/both
port-mirroring to observe-port 3 inbound/outbound/both
方法二命令:(批量配置观察端口)
observe-port 1 interface GigabitEthernet1/0/2 to GigabitEthernet1/0/4 //端口2到4为观察口
#
interface GigabitEthernet1/0/1或者GigabitEthernet1/0/10 (上联口) //镜像口
port-mirroring to observe-port 1 inbound/outbound/both
5、一对多端口镜像配置(一个监控设备监控多个端口)
拓扑图例见下图所示:

6、方法命令:
observe-port 1 interface GigabitEthernet1/0/4 //观察口1
#
interface GigabitEthernet1/0/1 //镜像口1
port-mirroring to observe-port 1 inbound/outbound/both
#
interface GigabitEthernet1/0/2 //镜像口2
port-mirroring to observe-port 2 inbound/outbound/both
#
interface GigabitEthernet1/0/3 //镜像口3
port-mirroring to observe-port 3 inbound/outbound/both