• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

H3C SR6600 SR6600-X系列路由器 典型配置案例集-R8128-6W101

40-H3C SR6600_SR6600-X路由器 Sampler结合IPv4 Netstream典型配置举例

本章节下载  (185.00 KB)

docurl=/cn/Service/Document_Software/Document_Center/Home/Routers/00-Public/Configure/Typical_Configuration_Example/H3C_SR6600_SR6600-X_CE(V7)-R7607-2683/202208/1674332_30005_0.htm

40-H3C SR6600_SR6600-X路由器 Sampler结合IPv4 Netstream典型配置举例

H3C SR6600/SR6600-X系列路由器

Sampler结合IPv4 NetStream使用配置举例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright © 2022 新华三技术有限公司 版权所有,保留一切权利。

非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部,并不得以任何形式传播。

除新华三技术有限公司的商标外,本手册中出现的其它公司的商标、产品标识及商品名称,由各自权利人拥有。

本文档中的信息可能变动,恕不另行通知。



1  简介

本文档介绍通过Sampler结合IPv4 NetStream使用的典型配置举例。

2  配置前提

本文档不严格与具体软、硬件版本对应,如果使用过程中与产品实际情况有差异,请参考相关产品手册,或以设备实际情况为准。

本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。

本文档假设您已了解Sampler特性和IPv4 NetStream特性。

3  配置举例

3.1  组网需求

图1所示,路由器作为局域网内主机访问外网的网关,现要求通过NetStream功能使用采样器对路由器上GigabitEthernet2/0/0出方向和GigabitEthernet2/0/2入方向的流量进行统计,再将统计的信息输出到Netstream服务器上。具体应用需求如下:

·     在接口GigabitEthernet2/0/2的入方向上配置固定采样,每100个报文中抽取一个报文进行NetStream统计。

·     在接口GigabitEthernet2/0/0的出方向上配置随机采样,每200个报文中抽取一个报文进行NetStream统计。

图1 Sampler结合IPv4 NetStream使用配置组网图

 

3.2  使用版本

本举例是在R8128版本上进行配置和验证的。

3.3  配置步骤

(1)     创建Sampler采样器。

# 创建一个名为samplerin的采样器,采用固定采样方式,设置采样率为100,即100个报文中抽取第一个报文。

<Device> system-view

[Device] sampler samplerin mode fixed packet-interval 100

# 创建一个名为samplerout的采样器,采用随机采样方式,设置采样率为200,即200个报文中抽取任意一个报文。

[Device] sampler samplerout mode random packet-interval 200

(2)     使能路由器NetStream功能。

# 配置GigabitEthernet2/0/2 IP地址,在此接口的入方向开启NetStream功能,使用samplerin采样器对该接口的流量进行采样。

[Device] interface gigabitethernet 2/0/2

[Device-GigabitEthernet2/0/2] ip address 10.0.0.1 24

[Device-GigabitEthernet2/0/2] ip netstream inbound

[Device-GigabitEthernet2/0/2] ip netstream inbound sampler samplerin

[Device-GigabitEthernet2/0/2] quit

# 配置GigabitEthernet2/0/0 IP地址,在此接口的出方向开启NetStream功能,使用samplerout采样器对该接口的流量进行采样。

[Device] interface gigabitethernet 2/0/0

[Device-GigabitEthernet2/0/0] ip address 192.168.0.1 24

[Device-GigabitEthernet2/0/0] ip netstream outbound

[Device-GigabitEthernet2/0/0] ip netstream outbound sampler samplerout

[Device-GigabitEthernet2/0/0] quit

# 配置GigabitEthernet2/0/1 IP地址。

[Device] interface gigabitethernet 2/0/1

[Device-GigabitEthernet2/0/1] ip address 192.168.1.1 24

[Device-GigabitEthernet2/0/1] quit

# 配置NetStream普通流统计信息输出的目的地址为192.168.1.2和目的UDP端口号为5000。

[Device] ip netstream export host 192.168.1.2 5000

3.4  验证配置

(1)     通过display sampler查看采样器的配置信息。

[Device] display sampler

 Sampler name: samplerin

  Mode: fixed;  Packet-interval: 100;  IsNpower : N

 Sampler name: samplerout

  Mode: random;  Packet-interval: 200;  IsNpower : N

(2)     路由器运行一段时间后,查看NetStream普通流的统计信息。

# 通过display ip netstream cache命令来查看NetStream流缓存区的配置和状态信息。

[Device] display ip netstream cache

IP NetStream cache information:

  Active flow timeout               : 30 min

  Inactive flow timeout             : 30 sec

  Max number of entries             : 10000

  IP active flow entries            : 1

  MPLS active flow entries          : 0

  L2 active flow entries            : 0

  IPL2 active flow entries          : 0

  IP flow entries counted           : 7

  MPLS flow entries counted         : 0

  L2 flow entries counted           : 0

  IPL2 flow entries counted         : 0

  Last statistics resetting time    : Never

 

IP packet size distribution (157 packets in total):

 

 1-32   64   96  128  160  192  224  256  288  320  352  384  416  448  480

 .000 .929 .031 .006 .000 .006 .000 .000 .000 .000 .025 .000 .000 .000 .000

 

  512  544  576 1024 1536 2048 2560 3072 3584 4096 4608 >4608

 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000

 

 Protocol          Total  Packets    Flows  Packets Active(sec) Idle(sec)

                   Flows  /sec       /sec   /flow   /flow       /flow

---------------------------------------------------------------------------

 TCP-other             3        0        0       26           7        30

 ICMP                  1        0        0        1           0        30

 UDP-BOOTP             1        0        0        4          15        30

 TCP-Telnet            2        0        0       35          24        30

 

Type DstIP(Port)            SrcIP(Port)            Pro ToS If(Direct)  Pkts

     DstMAC(VLAN)           SrcMAC(VLAN)

     TopLblType(IP/MASK)    Lbl-Exp-S-List

---------------------------------------------------------------------------

IP   192.168.0.1(23)       192.168.0.2(56839)      6   0   GE2/0/0(I)    1

# 通过display ip netstream export命令来查看NetStream统计输出报文的信息。

[Device] display ip netstream export

IP export information:

  Flow source interface                           : Not specified

  Flow destination VPN instance                   : Not specified

  Flow destination IP address (UDP)               : 192.168.1.2 (5000)

  Version 5 exported flows number                 : 0

  Version 5 exported UDP datagrams number (failed): 0 (0)

  Version 9 exported flows number                 : 8

  Version 9 exported UDP datagrams number (failed): 6 (6)

3.4.2  配置文件

#

 sampler samplerout mode random packet-interval 200

 sampler samplerin mode fixed packet-interval 100

#

 ip netstream export host 192.168.1.2 5000

#

interface GigabitEthernet2/0/0

 port link-mode route

 ip address 192.168.0.1 255.255.255.0

 ip netstream outbound

 ip netstream outbound sampler samplerout

#

interface GigabitEthernet2/0/1

 port link-mode route

 ip address 192.168.1.1 255.255.255.0

#

interface GigabitEthernet2/0/2

 port link-mode route

 ip address 10.0.0.1 255.255.255.0

 ip netstream inbound

 ip netstream inbound sampler samplerin

#

4  相关资料

·     H3C SR6600 SR6600-X 路由器 网络管理和监控配置指导-R7607

·     H3C SR6600 SR6600-X 路由器 网络管理和监控命令参考-R7607

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们