Oracle® Switch ES2-72 和 Oracle Switch ES2-64 配置指南

退出打印视图

更新时间: 2015 年 4 月
 
 

配置端口镜像

端口镜像可用于在另一个端口上监视特定端口的数据包。以下示例显示了如何将端口 25 上的所有传入数据包镜像到端口 26。

有关此任务的拓扑,请参见Basic SEFOS Topology。在 SEFOS-1 交换机上键入以下命令。

  1. 连接到 SEFOS。

    请参见Connect to SEFOS

  2. 将交换机的 IP 地址配置为 12.0.0.1。
    SEFOS-1# configure terminal
    SEFOS-1(config)# interface vlan 1
    SEFOS-1(config-if)# shutdown
    SEFOS-1(config-if)# ip address 12.0.0.1  255.0.0.0
    SEFOS-1(config-if)# no shutdown
    SEFOS-1(config-if)# end
    
  3. 查看主机和交换机之间的 ping 操作。
    SEFOS-1# ping 12.0.0.100
     
    Reply Received From :12.0.0.100, TimeTaken : 60 msecs
    Reply Received From :12.0.0.100, TimeTaken : 100 msecs
    Reply Received From :12.0.0.100, TimeTaken : 90 msecs
     
    --- 12.0.0.100 Ping Statistics ---
    3 Packets Transmitted, 3 Packets Received, 0% Packets Loss
    

    端口 26 未捕获主机 A 对交换机的 ping 回复,该端口在配置端口镜像之前连接到数据包捕获设备。

  4. 在 SEFOS-1 交换机上键入以下命令,以便将端口 25 上的传入数据包镜像到端口 26:
    1. 进入全局配置模式。
      SEFOS-1# configure terminal
      
    2. 将镜像的目标接口配置为端口 26。
      SEFOS-1(config)# monitor session destination interface xl-ethernet 0/26
      
    3. 将镜像的源接口配置为端口 25,并对传入数据包应用镜像。
      SEFOS-1(config)# monitor session source interface xl-ethernet 0/25 rx
      
    4. 退出全局配置模式。
      SEFOS-1(config-if)# end
      
    5. 查看配置详细信息。
      SEFOS-1# show port-monitoring
       
      Port Monitoring  is enabled
      Monitor Port : X10/26
       
      Port        Ingress-Monitoring    Egress-Monitoring
      ----        ------------------    -----------------
      X10/25 Enabled               Disabled
      ...
      
  5. 对 12.0.0.100 执行 Ping 并验证端口 26 是否收到了 ICMP 回复。
    SEFOS-1# ping 12.0.0.100
    
  6. 在主机 B 上或使用数据包捕获设备(如 IXIA 或 SmartBits)验证是否捕获了从主机 A 到 SEFOS-1 的 ping 回复。
    # tcpdump -xx -n -i eth3 icmp
    ...
    listening on eth3, link-type EN10MB (Ethernet), capture size 96 bytes 
    17:09:58.595583 IP 12.0.0.100 > 12.0.0.1: ICMP echo reply, id 0, seq 1, length 40
    ...
    0x0010:  003c 68e6 4000 ff01 fa75 0c00 0064 0c00
    17:09:58.617899 IP 12.0.0.100 > 12.0.0.1: ICMP echo reply, id 0, seq 2, length 40...
    0x0030:  a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5
    17:09:58.698280 IP 12.0.0.100 > 12.0.0.1: ICMP echo reply, id 0, seq 3, length 40...
    

相关信息