通过反射端口的方式实现多端口镜像

一、组网需求

镜像源端口:G1/0/1、G1/0/2

镜像目的端口:G2/0/1、G2/0/2、G2/0/3、G2/0/4、G2/0/5

两个镜像源端口(上行和下行端口)的双向流量要镜像到5个目的端口(安全设备端口)

二、需求分析

由于本镜像要求多源到多目的,故无法通过本地镜像方式实现,每个本地镜像组只支持1个目的端口,所以只能通过流镜像的方式实现。但是问题又出现了,现有H3C版本每个流行为最多支持4个镜像目的端口,所以引出了通过反射端口实现大于4个目的端口的流镜像解决方案。

三、解决方案

3.1 定义ACL规则

acl number 3000

rule permit ip

3.2 定义流分类

traffic classifier 3000

if-match acl 3000

3.3 定义流行为

traffic behavior 3000

mirror-to interface GigabitEthernet2/0/6          //G2/0/6为反射端口

3.4 创建流策略

qos policy 3000

classifier 3000 behavior 3000

3.5 应用流策略

interface gigabitethernet 1/0/1

qos apply policy3000 inbound

qos apply policy 3000 outbound

interface gigabitethernet 1/0/2

qos apply policy 3000 inbound

qos apply policy 3000 outbound

3.6 创建反射VLAN

vlan 4000

undo mac-address mac-learning enable    //关闭mac地址学习功能

3.7 配置反射端口

interface GigabitEthernet 2/0/6

undo stp enable                         //关闭STP

loopback internal                        //开启端口环回

qinq enable                            //开启qinq

mac-address max-mac-count 0           //关闭mac地址学习

port access vlan 4000

3.8 配置目的端口

interface GigabitEthernet2/0/1

port access vlan 4000

四、注意事项

大量数据会在反射VLAN泛洪,一定要对反射VLAN进行修剪。


2016年08月