华为3COM部分8016交换机1.假设8016交换机镜像端口为E1/0/15,被镜像端口为E1/0/0,端口1/0/15为端口镜像的观测端口。[SwitchA] port monitor ethernet 1/0/152.设置端口1/0/0为被镜像端口,对其输入输出数据都进行镜像。[SwitchA] port mirroring ethernet 1/0/0 both ethernet 1/0/15也可以通过两个不同的端口,对输入和输出的数据分别镜像1.设置E1/0/15和E2/0/0为镜像(观测)端口[SwitchA] port monitor ethernet 1/0/152.设置端口1/0/0为被镜像端口,分别使用E1/0/15和E1/0/14对输入和输出数据进行镜像。[SwitchA] port mirroring gigabitethernet 1/0/0 ingress ethernet 1/0/15[SwitchA] port mirroring gigabitethernet 1/0/0 egress ethernet 1/0/14『基于流镜像的数据流程』基于流镜像的交换机针对某些流进行镜像,每个连接都有两个方向的数据流,对于交换机来说这两个数据流是要分开镜像的。3500/3026E/3026F/3050交换机〖基于三层流的镜像〗1.定义一条扩展访问控制列表ACL[SwitchA]acl num 1002.定义一条规则报文源地址为1.1.1.1/32去往所有目的地址[SwitchA-acl-adv-101]rule 0 permit ip source 1.1.1.1 0 destination any3.定义一条规则报文源地址为所有源地址目的地址为1.1.1.1/32[SwitchA-acl-adv-101]rule 1 permit ip source any destination 1.1.1.1 04.将符合上述ACL规则的报文镜像到E0/8端口[SwitchA]mirrored-to ip-group 100 interface e0/8〖基于二层流的镜像〗1.定义一个ACL[SwitchA]acl num 2002.定义一个规则从E0/1发送至其它所有端口的数据包[SwitchA]rule 0 permit ingress interface Ethernet0/1 egress interface Ethernet0/23.定义一个规则从其它所有端口到E0/1端口的数据包[SwitchA]rule 1 permit ingress interface Ethernet0/2 egress interface Ethernet0/14.将符合上述ACL的数据包镜像到E0/8[SwitchA]mirrored-to link-group 200 interface e0/8QuiWay系列交换机方法1:1.配置镜像端口system-view[H3C] monitor-port Ethernet 0/242.配置被镜像端口[H3C] port mirror Ethernet 0/1 to Ethernet 0/8方法2:[H3C] port mirror Ethernet 0/1 to Ethernet 0/8 observing-port Ethernet 0/24S3100系列交换机system-view[H3C] mirroring-group 1 local[H3C] mirroring-group 1 monitor-port Ethernet 1/0/4[H3C] mirroring-group 1 mirroring-port Ethernet 1/0/1 bothS3600系列交换机在端口视图下配置1:system-view[H3C] mirroring-group 1 local[H3C] interface gigabitEthernet 1/1/4[H3C-GigabitEthernet1/1/4] monitor-port[H3C-GigabitEthernet1/1/4] quit[H3C] interface gigabitEthernet 1/1/1[H3C-GigabitEthernet1/1/1] mirroring-port both在端口视图下配置2:system-view[H3C] mirroring-group 1 local[H3C] interface GigabitEthernet 1/1/4[H3C-GigabitEthernet1/1/4] mirroring-group 1 monitor-port[H3C-GigabitEthernet1/1/4] quit[H3C] interface GigabitEthernet 1/1/1[H3C-GigabitEthernet1/1/1] mirroring-group 1 mirroring-port both在系统视图下配置:system-view[H3C] mirroring-group 1 local[H3C] mirroring-group 1 monitor-port GigabitEthernet 1/1/4[H3C] mirroring-group 1 mirroring-port GigabitEthernet 1/1/1 bothS6500/S7500系列交换机1.以太网端口视图下配置端口镜像1) 创建端口镜像组 system-view[SWITCH] mirroring-group 1 local2) 进入镜像目的端口的以太网端口视图[SWITCH] interface GigabitEthernet 1/0/23) 定义当前端口为镜像目的端口[SWITCH-GigabitEthernet1/0/2] mirroring-group 1 monitor-port4) 进入镜像源端口的以太网端口视图[SWITCH] interface GigabitEthernet 1/0/15) 配置镜像源端口,同时指定被镜像报文的方向[SWITCH-GigabitEthernet1/0/1] mirroring-group 1 mirroring-port both2.系统视图下配置端口镜像1) 创建端口镜像组。 system-view[SWITCH] mirroring-group 1 local2) 配置镜像目的端口。[SWITCH] mirroring-group 1 monitor-port GigabitEthernet 1/0/23) 配置镜像源端口,同时指定被镜像报文的方向。[SWITCH] mirroring-group 1 mirroring-port GigabitEthernet 1/0/1 both 09-14 08:19