2009年3月5日星期四

Cisco设备做流量监控方法汇总


方法一:HUB(方法太简单。。。略)
方法二:TAP(太专业了。。还要另外投资)
方法三:SPAN(就是大家常说得Port Mirror或者Port Monitor)
1。Cat2900XL/3500XL
2900XL(config)#interface fastethernet 0/24 //进入接口配置模式下
2900XL(config)#port monitor fastethernet 0/1 //配置f0/1为被监视得端口
2900XL(config)#port monitor fastethernet 0/2 //配置f0/2为被监视得端口

通过上面得配置就可以把进出f0/1和f0/2两个端口得流量镜像到f0/24

通过
show port monitor可以参看交换机得SPAN配置情况

2。Cat2950/3550/3750
3550(config)#monitor session 1 source interface f0/1 - 3 rx
//指定SPAN session组号为1,源端口为f0/1-f0/3,对进这三个端口的流量
//rx-->指明是进端口得流量,tx-->出端口得流量 both 进出得流量
3550(config)#monitor session 1 destination interface f0/4
//指定监视端口为f0/4


3。Cat4000/6500 with CatOS
set span命令
cat4k#set span 1/2 1/3
//把1/2得流量镜像到1/3

4。Cat4500/6500 with IOS
同2--Cat2950/3550/3750

方法四:VACL
VACL=VLAN ACL=Security ACL
只能在Cat6500上使用

CatOS:
c6509 (enable) set security acl ip MyCap permit tcp any any eq 443
c6509 (enable) set security acl ip MyCap permit tcp any eq 443 any
c6509 (enable) set security acl ip MyCap permit ip any any capture
//排除所有访问443端口的流量,其他流量都是感兴趣的
c6509 (enable) commit security acl MyCap
//定义一个security ACL的name
c6509 (enable) set security acl map MyCap 100,101
//把security ACL应用到vlan 100和101上
c6509 (enable) set security acl capture-ports 3/1
//把capture的流量镜像到3/1端口上


IOS:

c6509(config)# access-list 100 permit ip any any
c6509(config)# vlan access-map MyCap 10
c6509(config-access-map)# match ip address 100
c6509(config-access-map)# action forward capture
c6509(config)# vlan filter MyCap vlan-list 200 , 201
c6509(config)# interface gi3/1
c6509(config-if)# switchport capture

0 评论:

发表评论