⑫交换机引流设备案例
一、配置交换机镜像。
[H3C]mirroring-group 1 ?
local Local mirroring group
mirroring-port Specify mirroring port
monitor-egress Specify monitor egress port
monitor-port Specify monitor port
reflector-port Specify reflector port
remote-destination Remote destination mirroring group
remote-probe Specify remote probe VLAN
remote-source Remote source mirroring group
[H3C]mirroring-group 1 local
- local:本地镜像组,用于配置本地镜像相关功能,涉及在同一设备内部进行流量镜像的设置。
- mirroring-port:指定镜像端口,即需要被镜像的源端口,从该端口经过的流量会被复制到其他端口进行监控。
- monitor-egress:指定监控出口端口,用于监控从设备向外发送的流量。
- monitor-port:指定监控端口,也就是流量被镜像到的目的端口,用于连接监控设备,以便对镜像流量进行分析。
- reflector-port:指定反射端口,用于在某些特殊镜像场景下,将镜像流量反射到其他端口或设备。
- remote-destination:远程目的镜像组,用于配置远程镜像的目的端,即将镜像流量发送到远程设备的相关设置。
- remote-probe:指定远程探测 VLAN,用于在远程镜像场景中,指定用于探测和传输镜像流量的 VLAN。
- remote-source:远程源镜像组,用于配置远程镜像的源端,即从哪里获取需要镜像的流量,并将其发送到远程设备。
[H3C]mirroring-group 1 mirroring-port GigabitEthernet 1/0/2 ?
FortyGigE FortyGigE interface
GigabitEthernet GigabitEthernet interface
Ten-GigabitEthernet Ten-GigabitEthernet interface
both Monitor the inbound and outbound packets
inbound Monitor the inbound packets
outbound Monitor the outbound packets
to Range of interfaces
[H3C]mirroring-group 1 mirroring-port GigabitEthernet 1/0/2 both
FortyGigE:表示四十千兆以太网接口(40GE)。如果需要镜像的端口是 40GE 接口,可以使用此选项。
GigabitEthernet:表示千兆以太网接口(1GE)。已经用于指定端口类型。
Ten-GigabitEthernet:表示十千兆以太网接口(10GE)。如果需要镜像的端口是 10GE 接口,可以使用此选项。
both:监控双向流量,即同时镜像从该端口进入(inbound)和离开(outbound)的流量。
inbound:仅监控进入该端口的流量。
outbound:仅监控从该端口离开的流量。
to:用于指定一系列接口范围。例如,可以指定多个端口同时作为镜像源端口
[H3C]mirroring-group 1 monitor-port GigabitEthernet 1/0/3
FortyGigE:指定四十千兆以太网接口(40GE)作为监控端口。
GigabitEthernet:指定千兆以太网接口(1GE)作为监控端口。
Ten-GigabitEthernet:指定十千兆以太网接口(10GE)作为监控端口
[H3C]display mirroring-group all
Mirroring group 1:
Type: Local
Status: Active
Mirroring port:
GigabitEthernet1/0/2 Both
Monitor port: GigabitEthernet1/0/3
Mirroring group 1:
表示这是编号为 1 的端口镜像组。
Type: Local:
表示这是一个本地镜像组。本地镜像组是指镜像流量和监控流量都在同一台设备上进行处理。
Status: Active:
表示该镜像组的状态是激活的,即当前正在运行并生效。
Mirroring port::
表示镜像端口,即需要被镜像的源端口。
GigabitEthernet1/0/2:指定的镜像端口为第 1 个模块的第 0 个子卡的第 2 个端口。
Both:表示该端口的双向流量(即进入端口的流量和从端口发出的流量)都会被镜像。
Monitor port: GigabitEthernet1/0/3:
表示监控端口,即镜像流量被发送到的端口。
GigabitEthernet1/0/3:指定的监控端口为第 1 个模块的第 0 个子卡的第 3 个端口。
二、交换机镜像案例:
1. local(创建本地镜像组)
场景:监控接入层交换机Gi1/0/1端口的入站流量到监控端口Gi1/0/24
system-view
mirroring-group 1 local //创建本地镜像组1
mirroring-group 1 mirroring-port GigabitEthernet1/0/1 inbound //指定被监控端口及方向
mirroring-group 1 monitor-port GigabitEthernet1/0/24 //设置监控端口
2. mirroring-port(指定镜像源端口)
场景:同时监控多个端口的双向流量
mirroring-group 1 mirroring-port GigabitEthernet1/0/2 to GigabitEthernet1/0/5 both //监控2-5号端口双向流量
3. monitor-egress(监控出口流量)
场景:仅监控核心交换机上行口Gi2/0/10的出口流量
mirroring-group 2 local
mirroring-group 2 mirroring-port GigabitEthernet2/0/10 outbound //仅监控出方向
mirroring-group 2 monitor-egress GigabitEthernet2/0/20 //指定监控端口接收出口镜像
4. monitor-port(基础监控端口绑定)
场景:将Gi1/0/15作为镜像数据接收端口
mirroring-group 1 monitor-port GigabitEthernet1/0/15 //需确保该端口不参与业务转发
5. reflector-port(远程镜像反射端口)
场景:跨交换机远程镜像时配置反射端口
mirroring-group 3 remote-source //创建远程源镜像组
mirroring-group 3 reflector-port GigabitEthernet3/0/9 //指定反射端口(需为access端口)
mirroring-group 3 remote-probe vlan 100 //使用VLAN 100承载镜像流量
6. remote-destination(远程目的镜像组)
场景:在中央交换机上接收来自分支交换机的镜像流量
mirroring-group 4 remote-destination //创建远程目的镜像组
mirroring-group 4 monitor-port GigabitEthernet4/0/8 //本地监控端口
mirroring-group 4 remote-probe vlan 200 //指定传输镜像流量的VLAN
7. remote-probe(定义镜像传输VLAN)
场景:通过VLAN 300跨三层网络传输镜像数据
mirroring-group 5 remote-source
mirroring-group 5 reflector-port GigabitEthernet5/0/12
mirroring-group 5 remote-probe vlan 300 //镜像流量通过VLAN300传递
8. remote-source(远程源镜像组)
场景:在分支机构交换机上镜像流量到总部监控服务器
mirroring-group 6 remote-source //配置远程源镜像
mirroring-group 6 mirroring-port GigabitEthernet6/0/3 inbound //监控分支机构端口
mirroring-group 6 reflector-port GigabitEthernet6/0/10 //反射端口
mirroring-group 6 remote-probe vlan 400 //通过VLAN400传输镜像流