华三-端口镜像

本地端口镜像

fa7f386ec150f6a26a35945d2466871d

本地端⼝镜像是指镜像源端⼝和⽬的端⼝处于同⼀台设备上。 ⽰例中,若需要交换机将进⼊FGE1/0/1的报⽂复制⼀份,从FGE1/0/2 将 报 ⽂ 转 发 给 监 测 设 备 , 就可以配 置本地镜像组 , 其中源端⼝为 FGE1/0/1,镜像⽅向为⼊⽅向,⽬的端⼝为FGE1/0/2

mirroring-group 1 local  //创建本地端口镜像组1

mirroring-group 1 mirroring-port GigabitEthernet 1/0/1  //设置源镜像端口,可以设置多个

mirroring-group 1 monitor-port GigabitEthernet 1/0/2   //设置目的镜像端口

interface GigabitEthernet 1/0/2    //进入目的镜像端口

undo stp enable    //关闭生成树协议

 

display mirroring-group all   //查看所有的端口镜像组

二层远程端口镜像

远程端⼝镜像是指,镜像源端⼝和⽬的端⼝处于不同设备上。如果源设备与⽬的设备之间通过⼆层⽹络连接,则称为⼆层远程端⼝镜像,其实现包括反射端⼝⽅式和出端⼝⽅式。 这里给大家介绍一下反射端口方式。远程镜像VLAN是指将镜像报⽂从源设备传送⾄⽬的设备的专⽤VLAN。

1a4fe6f1691ffa100485f1d16ea1e34e

该⽅法的实现过程为,源设备将进⼊镜像源的报⽂复制⼀份给反射端⼝,反射端⼝将镜像报⽂在远程镜像VLAN中⼴播。镜像报⽂经由中间设备 ⼴播转发⾄⽬的设备。⽬的设备收到该报⽂后判别其VLAN ID,若与远程镜像VLAN的VLAN ID相同,则将镜像报⽂通过⽬的端⼝转发给监测设备.

配置目的设备

vlan 10    //创建VLAN10作为远程镜像VLAN

interface fortygige  1/0/6     //配置端口为Trunk口,并允许VLAN 10的报文通过

port link-type trunk  

port trunk permit vlan 10

mirroring-group 2 remote-destination   //创建远程目的镜像组2

mirroring-group 2 remote-probe vlan 10   //配置远程目的镜像组2的远程镜像VLAN为VLAN 10

interface fortygige 1/0/7    //进入1/0/7口

mirroring-group 2 monitor-port   //目的端口为FGE1/0/7

undo stp enable    //要关闭生成树

port access VLAN 10   //加入VLAN10

配置源设备

mirroring-group 1 remote-source    //创建远程镜像组1

vlan 10    //创建VLAN10为远程镜像VLAN

mirroring-group 1 remote-probe vlan 10     //配置远程源镜像组1的远程镜像VLAN为10

mirroring-group 1 mirroring-port fortygige 1/0/1 inbound     //源端口为FG1/0/1

mirroring-group 1 reflector-port fortygige 1/0/2  

Y

interface fortygige  1/0/3   //配置端口FGE1/0/3为Trunk口,并允许VLAN 10的报文通过

port link-type trunk

port trunk permit vlan 10 

配置中间设备

只需要放行镜像VLAN就可以。

流镜像

3234fb887e9288fd124b5cb82cd73098

流镜像通过QoS实现,设备先通过流分类匹配待镜像的报⽂,再通过 流⾏为将符合条件的报⽂复制⾄指定⽬的地。该⽅式可以灵活配置报⽂的匹配条件,从⽽对报⽂进⾏精细区分,并将区分后的报⽂镜像到⽬的地。

acl  advanced  3000   //创建高级ACL

rule permit ip source 192.168.2.0 0.0.0.255     //并定义规则匹配源为Host B的报文

traffice classifier test    //创建流分类test

if-match acl    3000   //配置报文匹配规则为ACL 3000

traffice behavior test  //创建流行为为test

mirror-to interface forygige 1/0/2   //配置流镜像到接口FGE1/0/2

qos policy test   //创建Qos策略test

classifier test behavior test     //在QOS策略中关联流分类和流行为

interface twenty-fivegige 1/0/1   //进入1口

qos apply policy test  inbound    //将QoS策略test应用到接口FGE1/0/1的入方向上

 

posted @ 2025-08-13 11:08  乐泉1  阅读(111)  评论(0)    收藏  举报