简介

    本文档介绍如何在Nexus 7000系列交换机上配置远程交换端口分析器(RSPAN)会话,该会话监控两个不同Nexus 7000系列交换机上以太网端口之间的流量。

    先决条件

    要求

    尝试进行此配置之前,请确保满足以下要求:

    使用的组件

    本文档中的信息基于Nexus 7000系列NX-OS设备。

    本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您使用的是真实网络,请确保您已经了解所有命令的潜在影响。

    规则

    有关文档约定的更多信息,请参考 Cisco 技术提示约定。

    背景信息

    您可以使用交换端口分析器(SPAN)来分析通过交换机端口或VLAN的网络流量,这些流量会将流量副本发送到网络分析器连接到交换机的目标端口。

    为了扩展SPAN,RSPAN支持对网络中的多台交换机进行远程监控。Nexus 7000系列交换机在RSPAN的功能上受到限制。RSPAN VLAN不能用作SPAN目标。因此,Nexus 7000交换机只能将RSPAN用作中转VLAN或源VLAN,并从RSPAN VLAN中提取数据。您不能将任何内容从Nexus 7000交换机放入RSPAN VLAN。

    配置

    此配置示例使用两台不同Nexus 7000系列交换机上的源端口和一台网络分析器连接的Nexus 7000交换机上的目标端口。两台设备之间设置了单独的以太网1/1链路:一条链路作为SPAN目的地,另一条链路作为RSPAN VLAN的访问。

    注意:使用命令查找工具(限注册客户)可获取有关本节中使用的命令的详细信息。

    网络图

    本文档使用以下网络设置:

    rspan-nexus-7000-01.jpg

    本示例使用下表中列出的端口:

    设备 源端口 目标端口
    Nexus 1 以太网2/15和2/16 Ethernet 1/1
    Nexus 2 以太网1/1、2/26至2/28 以太网2/37到2/40

    从Nexus 1交换机,源的SPAN流量将传输到目的端口并复制到RSPAN VLAN。然后,流量通过链路转发到Ethernet 1/1接口上的Nexus 2交换机。接下来,RSPAN VLAN流量被发送到目的端口,设备(如SwitchProbe设备或其他远程监控(RMON)探测或安全设备)可以在该端口接收和分析数据包。

    配置

    本文档使用以下配置:

    Nexus 1
    Nexus1#configure terminal
    
    
    !--- Configure the interface VLAN 15 as RSPAN VLAN.
    
    Nexus1(config)#vlan 15 
    Nexus1(config-vlan)#remote-span
    Nexus1(config-vlan)#exit
    
    
    
    !--- Configure the switchport interface as a SPAN destination.
    
    Nexus1(config)#interface ethernet 1/1
    Nexus1(config-if)#switchport monitor
    Nexus1(config-if)#no shutdown
    Nexus1(config-if)#exit
    
    
    
    !--- Configure the SPAN session.
    
    Nexus1(config)#monitor session 1
    
    
    !---Configure the source port.
    
    Nexus1(config-monitor)#source interface ethernet 2/15-16
    
    
    !--- Configure the destination port.
    
    Nexus1(config-monitor)#destination interface ethernet 1/1
    
    
    !--- Enable the SPAN session (by default the session is in shutdown state).
    
    Nexus1(config-monitor)#no shut
    Nexus1(config-monitor)#exit
    

    Nexus 2
    Nexus2#configure terminal
    
    
    !--- Configuration of interface VLAN 15 as RSPAN VLAN.
    
    Nexus2(config)#vlan 15 
    Nexus2(config-vlan)#remote-span
    Nexus2(config-vlan)#exit
    
    
    !--- Configure the switchport interface to access in RSPAN VLAN.
    
    Nexus2(config)#interface ethernet 1/1
    Nexus2(config-if)#switchport mode access
    Nexus2(config-if)#switchport access vlan 15
    Nexus2(config-if)#no shutdown
    Nexus2(config-if)#exit
    
    
    
    !--- Configure the switchport interfaces as a SPAN destination.
    
    Nexus2(config)#interface ethernet 2/37-40
    Nexus2(config-if)#switchport monitor
    Nexus2(config-if)#exit
    
    
    
    !--- Configure the SPAN session.
    
    Nexus2(config)#monitor session 1
    
    
    !--- Configure the source port.
    
    Nexus2(config-monitor)#source interface ethernet 2/26-28
    Nexus2(config-monitor)#source vlan 15
    
    
    !--- Configure the destination port.
    
    Nexus2(config-monitor)#destination interface ethernet 2/37-40
    
    
    !--- Enable the SPAN session (by default the session is in shutdown state).
    
    Nexus2(config-monitor)#no shut
    Nexus2(config-monitor)#exit
    

    验证

    使用本部分可确认配置能否正常运行。

    命令输出解释程序(仅限注册用户)(OIT) 支持某些 show 命令。使用 OIT 可查看对 show 命令输出的分析。

    以下是一些SPAN和RSPAN验证命令:

    Nexus 1:

    Nexus 2:

    相关信息