SPAN技术可以让交换机上某些需要被监控(sniffer,ids,ips)的数据流镜像到指定的端口上
SPAN技术主要是用来监控交换机上的数据流,大体分为两种类型,本地SPAN和远程SPAN.
----Local Switched Port Analyzer (SPAN) and Remote SPAN (RSPAN),实现方法上稍有不同。
按下面的topo设置实验环境
SPAN 交换机端口镜像的设置_镜像
相关IP地址
监控PC 192.168.1.6/24
R1 F0/0 192.168.1.1/24
R2 F0/0 192.168.1.2/24
 
R1设置IP地址
en
conf ter
inter fa 0/0
ip address 192.168.1.1 255.255.255.0
no shut
exit
line vty 0 4
login
password cisco
exit
enable password cisco
R2同R1 IP地址为.2
 
首先,不设置SPAN,监控PC Sniffer R1与R2的telnet通信
SPAN 交换机端口镜像的设置_镜像_02
结果不能获得telnet的数据包,原因就是交换机是二层设备,广播帧能在每个端口都接收到 但是单播就不行了
那么我们要在SW1上设置SPAN,让交换机的F0/2端口上监控PC能sniffer到R1和R2的通信
SW1的设置
en
conf ter
no monitor session 1
monitor session 1 source interface fastEthernet 0/0 - 1
monitor session 1 destination interface fastEthernet 0/2
 
OK
你可以这样查看你的session
SW1#show monitor session 1
Session 1
---------
Source Ports:
    RX Only:       None
    TX Only:       None
    Both:          Fa0/0-1
Source VLANs:
    RX Only:       None
    TX Only:       None
    Both:          None
Destination Ports: Fa0/2
Filter VLANs:      None
 
现在再来sniffer看看
SPAN 交换机端口镜像的设置_镜像_03
 
 
哈哈 有了吧  
 
这就是最简单 最常用的SPAN