linux nat span镜像,端口镜像 SPAN && RSPAN

RSPAN(Remote Switched Port Analyzer,远程交换端口分析),即远程端口镜像,突破了被镜像端口和镜像端口必须在同一台交换机上的限制,使被镜像端口和镜像端口可以跨越网络中的多个设备,从而方便网管人员对远程交换机设备进行管理。

实现了RSPAN功能的交换机分为三种:

a.源交换机:被监测的端口所在的交换机,负责将需要镜像的流量在Remote-probe VLAN上做二层转发,转发给中间交换机或目的交换机。

b.中间交换机:网络中处于源交换机和目的交换机之间的交换机,通过Remote-probe VLAN把镜像流量传输给下一个中间交换机或目的交换机。如果源交换机与目的交换机直接相连,则不存在中间交换机。

c.目的交换机:远程镜像目的端口所在的交换机,将从Remote-probe VLAN接收到的镜像流量通过镜像目的端口转发给监控设备。

为了实现远程端口镜像功能,需要定义一个特殊的VLAN,称之为Remote-probe VLAN。所有被镜像的报文通过该VLAN从源交换机传递到目的交换机的镜像端口,实现在目的交换机上对源交换机的远程端口的报文进行监控的功能。Remote-probe VLAN具有以下特点:

建议将该VLAN中的设备互连端口都配置为Trunk端口;

不能将缺省VLAN、管理VLAN设置成Remote-probe VLAN;

需要通过配置保证Remote-probe VLAN从源交换机到目的交换机的二层互通性;

交换机作为中间设备或者目的设备的时候,不能支持双向(both)镜像。

案例一:本地端口镜像

如图所示,PC1的ip 地址为 192.168.1.1 ,PC2的ip 地址为 192.168.1.2 。管理员通过该交换机来监控pc1 和pc2之间的通信。

拓扑图:

94cce52f51bc355d510db1b3cdd344c6.png

配置步骤:

[SW3]mirroring-group 1 local ## 创建本地端口镜像组 1

[SW3]interface Ethernet 1/0/5

[SW3-Ethernet1/0/5]mirroring-group 1 monitor-port ##定义当前端口为镜像组1的监控端口(目的端口)

[SW3]interface Ethernet 1/0/1

[SW3-Ethernet1/0/1]mirroring-group 1 mirroring-port both ##配置镜像源端口,同时指定被监控报文的方向

[SW3]interface Ethernet 1/0/2

[SW3-Ethernet1/0/2]mirroring-group 1 mirroring-port both ##配置镜像源端口,同时指定被监控报文的方向

sniffer配置:

a1b418f41a71de3196bff151a60ea624.png

1e5485846fcc05c6b7d3664fe2b2ea4d.png

9c26186f31f1bd87a11e5eeef58ccc68.png

8141a35bf4ba0320d42587995ddadc29.png

3bcf0e92cd335df9081ccbce98651a44.png

4f90811f4eb37360d767786696d1b093.png

b11f0fedd0e9ce1f60dfc7857188313f.png

测试结果:

ea3d1e7ba56daf342b6d1262f16102ed.png

案例二:

如图所示,三台交换机SW4 SW3,SW6 分别为目的交换机,中间交换机,源交换机。

管理员在交换机SW4上监控远端的交换机SW6 上连接的两个用户之间的通信。

拓扑图:

c5f8dc8e1ffd7400d0eb0bece3663ad7.png

配置步骤:

目的交换机上SW4 :

[SW4]vlan 10 ##创建Remote-probe VLAN,并进入VLAN视图

[SW4-vlan10]remote-probe vlan enable ##定义当前VLAN为Remote-probe VLAN

[SW4]interface Ethernet 1/0/1

[SW4-Ethernet1/0/1]port link-type trunk ##配置当前端口类型为Trunk

[SW4-Ethernet1/0/1]port trunk permit vlan 10 ##配置TRUNK端口允许Remote-probe VLAN的报文通过

[SW4]mirroring-group 1 remote-destination ## 配置远程目的镜像组

[SW4]mirroring-group 1 monitor-port Ethernet 1/0/5 ##配置远程镜像目的端口

[SW4]mirroring-group 1 remote-probe vlan 10 ##配置远程目的镜像组的remote-probe VLAN

中间交换机SW3:

[SW3]vlan 10 ##创建Remote-probe VLAN,并进入VLAN视图

[SW3-vlan10]remote-probe vlan enable ##定义当前VLAN为Remote-probe VLAN

[SW3]interface Ethernet 1/0/2

[SW3-Ethernet1/0/2]port link-type trunk ##配置当前端口类型为Trunk

[SW3-Ethernet1/0/2]port trunk permit vlan 10 ##配置TRUNK端口允许Remote-probe VLAN的报文通过

[SW3-Ethernet1/0/2]interface Ethernet 1/0/1

[SW3-Ethernet1/0/1]port link-type trunk ##配置当前端口类型为Trunk

[SW3-Ethernet1/0/1]port trunk permit vlan 10 ##配置TRUNK端口允许Remote-probe VLAN的报文通过

源交换机 SW6

[SW6]vlan 10 ##创建Remote-probe VLAN,并进入VLAN视图

[SW6-vlan10]remote-probe vlan enable ##定义当前VLAN为Remote-probe VLAN

[SW6]interface Ethernet 1/0/2

[SW6-Ethernet1/0/2]port link-type trunk ##配置当前端口类型为Trunk

[SW6-Ethernet1/0/2]port trunk permit vlan all ##配置TRUNK端口允许Remote-probe VLAN的报文通过

[SW6]mirroring-group 1 remote-source ##配置远程源镜像组1

[SW6]mirroring-group 1 mirroring-port Ethernet 1/0/3 inbound ##配置远程镜像源端口,监控报文方向为进入方向

[SW6]mirroring-group 1 mirroring-port Ethernet 1/0/4 outbound ####配置远程镜像源端口,监控报文方向为出方向

[SW6]mirroring-group 1 reflector-port Ethernet 1/0/5 ##配置远程反射端口

[SW6]mirroring-group 1 remote-probe vlan 10 ##配置远程源镜像组的remote-probe VLAN

sniffer配置:

49b4dab95a872d0478c439676db801fa.png

e78e19901f11f454e33b69ec28013e75.png

019d43ec83ae7b08634f1ccf3a27cc57.png

c85268777decaa0041dc6755f657b396.png

397eff2cd52338985689ebc7dc68935d.png

a7842a6dc3faff4f2f03080f0a57da46.png

01099fb9906e1bb0dae823217b1f577f.png

3a1fe3162e43231168ee2b7791a0baac.png

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值