一、用于局域网监控环境下交换机镜像端口建立方法 1、Cisco CATALYST交换机端口监听配置 Cisco CATALYST交换机分为两 种,在CATALYST家族中称侦听端口为分析端 口(analysis port)。 1、Catalyst 2900XL/3500XL/2950系列交换机端口监听配置 (基于CLI); 以下命令配置端口监听:port monitor; 例 如,F0/1和F0/2、F0/3同属VLAN1,F0/1监听F0/2、F0/3端口:; interface FastEthernet0/1 port monitor FastEthernet0/2 port monitor FastEthernet0/3 port monitor VLAN1 2、Catalyst 4000,5000 and 6000系列交换机端口监听配 置 (基于IOS) 以下命令配置端口监听: set span 例如,模块1中端口1和端口2同属VLAN1,端口3在VLAN2,端口4和5在VLAN2,端口2监听端 口1和3、4、5, set span 1/1,1/3-5 1/2 2950/3550/3750格式如下: #monitor session number source interface mod_number/port_number both #monitor session number destination interface mod_mnumber/port_number //rx–>指明是进端口得流量,tx–>出端口得流量 both 进出得流量 for example: 第一条镜像,将第一模块中的源端口为1-10的镜像到端口12上面; #monitor session 1 source interface 1/1-10 both #monitor session 1 destination interface 1/12 第二条镜像,将第二模块中的源端口为13-20的镜像到端口24上面; #monitor session 2 source interface 2/13-20 both #monitor session 2 destination interface 2/24 当有多条镜像、多个模块时改变其中的参数即可。 Catalyst 2950 3550不支持port monitor C2950#configure terminal C2950(config)# C2950(config)#monitor session 1 source interface fastEthernet 0/2 !— Interface fa 0/2 is configured as source port. C2950(config)#monitor session 1 destination interface fastEthernet 0/3 !— Interface fa0/3 is configured as destination port. 2、华为交换机端口镜像配置简单介绍 『环境配置参数』 1. PC1接在交换机E0/1端口,IP地址1.1.1.1/24 2. PC2接在交换机E0/2端口,IP地址2.2.2.2/24 3. E0/24为交换机上行端口 4. Server接在交换机E0/8端口,该端口作为镜像端口 『组网需求』 1.通过交换机端口镜像的功能使用server对两台pc的业务报文进行监控。 2.按照镜像的不同方式进行配置: 1)基于端口的镜像 2)基于流的镜像 二、数据配置步骤『端口镜像的数据流程』 基于端口的镜像是把被镜像端口的进出数据报文完全拷贝一份到镜像端口,这样来进行局域网流量观测或者故障定位。 【3026等交换机镜像】 S2008/S2016/S2026/S2403H/S3026等交换机支持的都是基于端口的镜像,有两种方法: 方法一 1. 配置镜像(观测)端口 [SwitchA]monitor-port e0/8 2. 配置被镜像端口 [SwitchA]port mirror Ethernet 0/1 to Ethernet 0/2 方法二 1. 可以一次性定义镜像和被镜像端口 [SwitchA]port mirror Ethernet 0/1 to Ethernet 0/2 observing-port Ethernet 0/8 【8016交换机端口镜像配置】 1.假设8016交换机镜像端口为E1/0/15,被镜像端口为E1/0/0,设置端口1/0/15为端口镜像的观测端口。 [SwitchA] port monitor ethernet 1/0/15 2.设置端口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/15 2.设置端口1/0/0为被镜像端口,分别使用E1/0/15和E2/0/0对输入和输出数据进行镜像。 [SwitchA] port mirroring gigabitethernet 1/0/0 ingress ethernet 1/0/15 [SwitchA] port mirroring gigabitethernet 1/0/0 egress ethernet 2/0/0 『基于流镜像的数据流程』 基于流镜像的交换机针对某些流进行镜像,每个连接都有两个方向的数据流,对于交换机来说这两个数据流是要分开镜像的。 【3500/3026E/3026F/3050】 〖基于三层流的镜像〗 1. 定义一条扩展访问控制列表 [SwitchA]acl num 100 2. 定义一条规则报文源地址为1.1.1.1/32去往所有目的地址 [SwitchA-acl-adv-101]rule 0 permit ip source 1.1.1.1 0 destination any 3. 定义一条规则报文源地址为所有源地址目的地址为1.1.1.1/32 [SwitchA-acl-adv-101]rule 1 permit ip source any destination 1.1.1.1 0 4.将符合上述ACL规则的报文镜像到E0/8端口 [SwitchA]mirrored-to ip-group 100 interface e0/8 〖基于二层流的镜像〗 1.定义一个ACL [SwitchA]acl num 200 2.定义一个规则从E0/1发送至其它所有端口的数据包 [SwitchA]rule 0 permit ingress interface Ethernet0/1 egress interface Ethernet0/2 3.定义一个规则从其它所有端口到E0/1端口的数据包 [SwitchA]rule 1 permit ingress interface Ethernet0/2 egress interface Ethernet0/1 4.将符合上述ACL的数据包镜像到E0/8 [SwitchA]mirrored-to link-group 200 interface e0/8 【5516/6506/6503/6506R】 目前该三款产品支持对入端口流量进行镜像 1.定义镜像端口 [SwitchA]monitor-port Ethernet 3/0/2 2.定义被镜像端口 [SwitchA]mirroring-port Ethernet 3/0/1 inbound 【补充说明】 1. 镜像一般都可以实现高速率端口镜像低速率端口,例如1000M端口可以镜像100M端口,反之则无法实现 2. 8016支持跨单板端口镜像 三、 测试验证在观测端口上通过工具软件可以看到被镜像端口的相应的报文,可以进行流量观测或者故障定位 注意!在此提醒一下各位,相同型号不同版本的设备,配置方法有时是有差异的,最终还是要以版本对应的操作手册为准。其它品牌的交换机如何镜像参照相关的交换机说明文档配置正确即可,在此就不一一列出来了。 有效正确的配置好交换机的端口镜像才可以正常的使用AnyView(网络警)网络监控软件上网监控管理软件,一般配置镜像只要把总出口的数据镜像到对应的AnyView(网络警)网络监控软件服务器所连交换机的那个口就可以了,即我们说的一对一的端口镜像,如果没有特殊的需要,大家不要做多对一的端口镜像,即把多个源端口的数据镜像到一个口上,因为一般情况下,只要把总出口的数据镜像到AnyView(网络警)网络监控软件上就可以实现对整个网络监控管理了。
|