思科交换机配置端口镜像(mirroring)

SPAN:本地设备端口监控,当所有被监听的源端口与目的端口同处于一台交换机上,SPAN会话被称为本地SPAN。

Switch(config)#monitor session 1 source interface fastEthernet 0/0 tx   //后面参数tx意思是监控0/0接口发送的流量,默认为both,即监控收发的流量

Switch(config)#monitor session 1 destination interface fastEthernet 0/1   //把session 1里面接口(fastEthernet 0/0)的流量复制一份发送到fastEthernet 0/1,destination fa0/1接口不能正常收发流量,只能接收镜像过来的流量

 

RSPAN:远端的设备端口口监控;源端口和目的端口不在同一台交换机上。

 

在源端口交换机上配置:

Switch1(config)#vlan100   //vlan号必须独立于现网使用的vlan,不能和业务vlan相同,

Switch1(config-vlan)#name SPAN-VLAN   //为vlan 100名字配置为SPAN-VLAN

Switch1(config-vlan)#remote-span   //模式改成RSPAN,特殊vlan用来做端口镜像

Switch1(config)#monitor session 2 source interface Gig 0/1   //配置要抓取原端口的流量

Switch1(config)#monitor session 2 destination remote vlan 100   //目的端口配置为SPAN的vlan

 

在目的端口交换机上配置:

Switch2(config)#vlan100   //vlan要和被抓取流量端口的交换机vlan要一致

Switch2(config-vlan)#name SPAN-VLAN   //为vlan 100名字配置为SPAN-VLAN

Switch2(config-vlan)#remote-span   //模式改成RSPAN,特殊vlan用来做端口镜像

Switch2(config)#monitor session 3 destination interface Gig 0/2   //配置要抓取原端口的流量,这里的session 号不需要和Switch1的一致

Switch1(config)#monitor session 3 source remote vlan 100   //目的端口配置为SPAN的vlan号

 

Switch#show monitor   //查看端口镜像配置

 

参考思科官网:https://www.cisco.com/c/zh_cn/support/docs/switches/catalyst-6500-series-switches/10570-41.html

  • 13
    点赞
  • 92
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值