点滴技术

SPAN那些事

2019-04-03  本文已影响0人  点滴技术
image.png

1.SPAN概述

SPAN(Switched Port Analyzer)就是我们常说的端口镜像技术,当网络管理源需要分析设备端口上流入或流出数据时,就可以利用SPAN技术来复制到IPS等分析器。

SPAN可以从一个或多个端口、EtherChannels、vlan完整复制一份数据流到目的网络分析器。SPAN不会影响现有业务数据交互,但必须预留目的端口(不能用于传输业务);

SPAN可以分为3种类型:Local SPAN、Remote SPAN、Encapsulation Remote SPAN。

image image image

关于镜像源:

关于镜像目的:

2.Local SPAN约束与配置

常用部分配置

#全局配置模式:
monitor session 1 source interface Et0/0  //指定源端口
monitor session  1 filter vlan 1 , 2  //指定过滤vlan,可选
monitor session 1 destination interface Et0/1  //指定目的端口

#SPAN配置模式:
monitor session 1 type local
  source interface Et0/0  //指定源端口  
  filter 1 , 2  //指定过滤vlan,可选
  destination interface Et0/1  //指定目的端口
  no shutdown  //SPAN配置模式下一定要no shutdown

说明:针对高版本可以支持source可以带CPU/SP/RP

高级部分配置

#抓trunk流量,需要dot1q封装
monitor session 1 source interface Et0/0
monitor session 1 destination interface Et0/1 encapsulation replicate

#抓vlan流量,并且通过dot1q来区分vlan
monitor session 1 source vlan 1,2,3 rx
monitor session 1 destination interface Et0/1 encapsulation dot1q

#使用ingress注入数据
monitor session 1 source vlan 1,2,3 rx
monitor session 1 destination interface Et0/1 encapsulation dot1q ingress dot1q vlan 1  //dot1q 1为native vlan

3.RSPAN约束与配置

#以下演示全局配置模式:
#源交换机
vlan 100   //每台交换机都要创建RSPAN VLAN
 remote-span
monitor session 1 source interface Et0/0
monitor session 1 destination remote vlan 100

#中间交换机(如源、目的直连则跳过此步骤)
vlan 100  //每台交换机都要创建RSPAN VLAN
 remote-span
monitor session 1 destination remote vlan 100

#目标交换机
vlan 100  //每台交换机都要创建RSPAN VLAN
 remote-span
monitor session 1 source remote vlan 100
monitor session 1 destination interface ethernet 0/2

4.ERSPAN约束与配置

#源路由器
monitor session 1 type erspan-source
 source interface e0/0
 no shutdown
 destination
  erspan-id 101  //erspan-id 源和目的要一致,标识同隧道
  ip address 2.2.2.2  //指定目的交换机IP
  origin ip address  1.1.1.1  //指定源交换机IP

#目标路由器
monitor session 1 type erspan-destination
 destination interface e0/2  //指定目的交换机端口
 no shutdown
 source
  erspan-id 101  //erspan-id 源和目的要一致,标识同隧道
  ip address 2.2.2.2  //指定目的交换机IP

5.验证命令

show monitor session all  //查看所有会话
show monitor session <id>  //单独查看某个会话
show monitor session <id> detail  //详细查看某个会话

上一篇 下一篇

猜你喜欢

热点阅读