14-NetStream命令
本章节下载: 14-NetStream命令 (275.69 KB)
目 录
1.1.1 display ip netstream cache
1.1.2 display ip netstream export
1.1.3 display ip netstream template
1.1.5 ip netstream (interface view)
1.1.6 ip netstream (system view)
1.1.7 ip netstream export host (aggregation view)
1.1.8 ip netstream export host (system view)
1.1.9 ip netstream export rate
1.1.10 ip netstream export source
1.1.11 ip netstream export template refresh-rate
1.1.12 ip netstream export version
1.1.16 ip netstream template rfc7011
1.1.17 ip netstream timeout active
1.1.18 ip netstream timeout inactive
1.1.19 reset ip netstream statistics
display ip netstream cache命令用来查看NetStream流表项信息。
【命令】
display ip netstream cache [ verbose ] [ type { ip | ipl2 | l2 | mpls [ label-position1 label-value1 [ label-position2 label-value2 [ label-position3 label-value3 ] ] ] } ] [ destination destination-ip | destination-port destination-port | interface interface-type interface-number | protocol protocol | source source-ip | source-port source-port ] * [ arrived-time start-date start-time end-date end-time ] [ chassis chassis-number slot slot-number [ cpu cpu-number ] ]
【视图】
任意视图
【缺省用户角色】
network-admin
network-operator
mdc-admin
mdc-operator
【参数】
verbose:显示NetStream流表项的详细信息。如果未指定本参数,将显示概要信息。
type:显示的流表项类型。如果未指定本参数,则显示所有类型的流表项。
ip:显示IP流表项。
ipl2:显示二三层混合流表项。
l2:显示二层流表项。
mpls:显示MPLS流表项。
label-position1 label-value1:显示标签为指定值的MPLS流表项。label-position1表示标签位置,取值范围为1~6,其中1表示最外层标签,6表示最内层标签,以此类推。label-value1表示标签值,取值范围为0~1048575。
label-position2 label-value2:显示标签为指定值的MPLS流表项。label-position2表示标签位置,取值范围为1~6,其中1表示最外层标签,6表示最内层标签,以此类推。label-value2表示标签值,取值范围为0~1048575。
label-position3 label-value3:显示标签为指定值的MPLS流表项。label-position3表示标签位置,取值范围为1~6,其中1表示最外层标签,6表示最内层标签,以此类推。label-value3表示标签值,取值范围为0~1048575。
destination destination-ip:显示指定目的IP地址的所有NetStream流表项信息,destination-ip用于指定IP地址,格式为点分十进制。该参数不支持显示二层流表项。
destination-port destination-port:显示指定目的端口的所有NetStream流表项信息,destination-port用于指定目的端口,取值范围为0~65535。该参数不支持显示二层流表项。
interface interface-type interface-number:显示指定接口的所有流表项信息,interface-type interface-number用来指定接口的类型和编号。
protocol protocol:显示指定协议的所有NetStream流表项信息,protocol用于指定协议号或者常见协议的名称,协议号的取值范围为0~255,常见协议的名称包括GRE、OSPF、TCP、UDP等。该参数不支持显示二层流表项。
source source-ip:显示指定源IP地址的所有NetStream流表项信息,source-ip用于指定IP地址,格式为点分十进制。该参数不支持二层流表项。该参数不支持显示二层流表项。
source-port source-port:显示指定源端口的所有流表项信息,source-port用于指定源端口,取值范围为0~65535。该参数不支持显示二层流表项。
arrived-time:显示指定时间内到达的所有NetStream流表项信息。不指定该参数时,表示对流的到达时间没有限制。
start-date:指定开始日期,格式为MM/DD/YYYY(月/日/年)或者YYYY/MM/DD(年/月/日),MM的取值范围为1~12,DD的取值范围与月份有关,YYYY的取值范围为2000~2035。
start-time:指定开始时间,格式为HH:MM:SS(小时:分钟:秒),HH取值范围为0~23,MM和SS取值范围为0~59。如果要配置成整分,则可以不输入秒;如果要配置成整点,则可以不输入分和秒。比如将start-time配置为0表示零点。
end-date:指定结束日期,格式为MM/DD/YYYY(月/日/年)或者YYYY/MM/DD(年/月/日),MM的取值范围为1~12,DD的取值范围与月份有关,YYYY的取值范围为2000~2035。
end-time:指定结束时间,格式为HH:MM:SS(小时:分钟:秒),HH取值范围为0~23,MM和SS取值范围为0~59。如果要配置成整分,则可以不输入秒;如果要配置成整点,则可以不输入分和秒。比如将end-time配置为0表示零点。
chassis chassis-number slot slot-number:指定单板。chassis-number表示设备在集群中的成员编号,slot-number表示单板所在的槽位号。如果不指定本参数,则表示指定所有单板。
cpu cpu-number:指定CPU。cpu-number表示单板上CPU的编号。只有指定的slot支持多CPU时,才能配置该参数。
【举例】
# 查看NetStream流表项的详细信息。
<Sysname> display ip netstream cache verbose
IP NetStream cache information:
Active flow timeout : 60 min
Inactive flow timeout : 10 sec
Max number of entries : 1000
IP active flow entries : 1
MPLS active flow entries : 1
L2 active flow entries : 0
IPL2 active flow entries : 0
IP flow entries counted : 10
MPLS flow entries counted : 20
L2 flow entries counted : 10
IPL2 flow entries counted : 20
Last statistics resetting time : 01/01/2000 at 00:01:02
IP packet size distribution (1103746 packets in total):
1-32 64 96 128 160 192 224 256 288 320 352 384 416 448 480
.249 .694 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000
512 544 576 1024 1536 2048 2560 3072 3584 4096 4608 >4608
.000 .000 .027 .000 .027 .000 .000 .000 .000 .000 .000 .000
Protocol Total Packets Flows Packets Active(sec) Idle(sec)
Flows /sec /sec /flow /flow /flow
--------------------------------------------------------------------------
TCP-Telnet 2656855 372 4 86 49 27
TCP-FTP 5900082 86 9 9 11 33
TCP-FTPD 3200453 1006 5 193 45 33
TCP-WWW 546778274 11170 887 12 8 32
TCP-other 49148540 3752 79 47 30 32
UDP-DNS 117240379 570 190 3 7 34
UDP-other 45502422 2272 73 30 8 37
ICMP 14837957 125 24 5 12 34
IP-other 77406 5 0 47 52 27
Type DstIP(Port) SrcIP(Port) Pro ToS VNI If(Direct) Pkts
DstMAC(VLAN) SrcMAC(VLAN)
TopLblType(IP/Mask) Lbl-Exp-S-List
--------------------------------------------------------------------------
IP 11.1.1.1(1024) 11.1.1.2(21) 6 128 10 GE1/2/0/1(I) 42996
TCPFlag: 27
DstMask: 24 SrcMask: 24 NextHop: 0.0.0.0
DstAS: 0 SrcAS: 0 BGPNextHop: 0.0.0.0
InVRF: mvpn
Bgp-community1: 0
Bgp-community2: 0
Bgp-community3: 0
Bgp-community4: 0
SamplerMode:Random SamplerInt: 256
Active: 120.600 Bytes/Pkt: 152
First packet arrived: 10/28/2013, 14:10:03
Last packet arrived: 10/28/2013, 14:21:03
IP& 172.16.1.1(68) 172.16.2.1(67) 17 64 N/A GE1/2/0/3(I) 1848
MPLS LDP(4.4.4.4/24) 1:55-6-0
2:16-6-1
TCPFlag: 0
DstMask: 24 SrcMask: 24 NextHop: 172.16.2.10
DstAS: 0 SrcAS: 0 BGPNextHop: 0.0.0.0
InVRF: vpn1
Bgp-community1: 0
Bgp-community2: 0
Bgp-community3: 0
Bgp-community4: 0
SamplerMode:N/A SamplerInt: 0
Active: 5.542 Bytes/Pkt: 1426
First packet arrived: 10/28/2013, 14:12:03
Last packet arrived: 10/28/2013, 14:23:03
表1-1 display ip netstream cache命令显示信息描述表
字段 |
描述 |
IP NetStream information |
NetStream流表项信息 |
Active flow timeout |
活跃流的老化时间,单位为分钟 |
Inactive flow timeout |
不活跃流的老化时间,单位为秒 |
Max number of entries |
NetStream流缓存区中允许的最大流数 |
IP active flow entries |
NetStream流缓存区中活跃的IP流数 |
MPLS active flow entries |
NetStream流缓存区中活跃的MPLS流数 |
L2 active flow entries |
NetStream流缓存区中活跃的二层流数 |
IPL2 active flow entries |
NetStream流缓存区中活跃的二层和三层流数 |
IP flow entries counted |
已经被统计的IP流数 |
MPLS flow entries counted |
已经被统计的MPLS流数 |
L2 flow entries counted |
已经被统计的二层流数 |
IPL2 flow entries counted |
已经被统计的二层和三层流数 |
Last statistics resetting time |
上次清除统计的时间 该字段只在执行了reset ip netstream statistics命令后才会显示为时间,否则显示为Never |
IP packet size distribution (1103746 packets in total) |
IP报文按大小分布情况,括号中为IP报文总数。 分布值按占IP报文总数的比率显示,只显示3位小数,如“.027”表示占IP报文总数的0.027 |
1-32 64 96 128 160 192 224 256 288 320 352 384 416 448 480 512 544 576 1024 1536 2048 2560 3072 3584 4096 4608 |
IP报文尺寸区间(报文长度不包括二层链路层的头)。长度不超过576字节时,以32字节为单位递增,例如:“1-32”是长度为1~32个字节的报文数目,“64”是长度为33~64字节的报文数。长度超过1024字节时,以512字节为单位递增,例如“1536”是长度为1025~1536字节的报文数。长度在577~1024间的报文记录在1024项中 |
Protocol Total Flows Packets /sec Flows/sec Packets/flow Active(sec)/flow Idle(sec)/flow |
按协议分类的报文统计信息:协议类型、总流数、每秒的报文数、每秒的流数、平均每条流的报文数、平均每条流的活跃时间、平均每条流的非活跃时间 |
Type DstIP(Port) SrcIP(Port) Pro ToS VNI If(Direct) Pkts |
当前流缓存区中活跃流的IP层信息:流的类型、目的IP地址(目的端口号)、源IP地址(源端口号)、协议号、服务类型、VXLAN ID、接口名(方向)、包数 其中流的类型有五种:IP流(IP)、二层流(L2)、二三层混合流(IP&L2)、不带IP选项的MPLS流(MPLS)、带IP选项的MPLS流(IP&MPLS) 需要注意的是,对于ICMP报文只有Type和Code字段,因此用目的端口号的高8位为Type字段、低8位为Code字段,源端口号为0 对非VXLAN报文和不支持VXLAN的设备上,VNI字段显示为N/A |
DstMAC(VLAN) SrcMAC(VLAN) |
当前流缓存区中活跃流的二层信息:目的MAC地址(目的VLAN ID)、源MAC地址(源VLAN ID) |
TopLblType(IP/Mask) : Lbl-Exp-S-List |
当前流缓存区中活跃流的MPLS信息:栈顶标签的类型(栈顶标签对应的IP地址及掩码长度)、标签列表 标签列表中至多列出三层标签,mpls-position指定标签位置 |
TCPFlag: DstMask: SrcMask: NextHop: DstAS: SrcAS: BGPNextHop: OutVRF: InVRF: Bgp-community1: Bgp-community2: Bgp-community3: Bgp-community4: SamplerMode: SamplerInt: Active: Bytes/Pkt: First packet arrived: Last packet arrived: |
当前流缓存区中活跃流的其他信息:TCP标记、目的掩码、源掩码、路由下一跳、目的自治系统、源自治系统、BGP下一跳、出方向报文转发使用的VPN、入方向报文转发使用的VPN、BGP团体属性值、采样模式、采样间隔、流活跃时间、平均每个包的字节数、该流首个报文到达时间、该流最后一个报文到达时间 NetStream采样模式,目前支持三种: · N/A:表示不采样,统计所有报文 · Fixed:表示固定采样 · Random:表示随机采样 |
display ip netstream export命令用来查看NetStream统计输出报文的相关信息。
【命令】
display ip netstream export [ chassis chassis-number slot slot-number [ cpu cpu-number ] ]
【视图】
任意视图
【缺省用户角色】
network-admin
network-operator
mdc-admin
mdc-operator
【参数】
chassis chassis-number slot slot-number:指定单板。chassis-number表示设备在集群中的成员编号,slot-number表示单板所在的槽位号。如果不指定本参数,则表示指定所有单板。
cpu cpu-number:指定CPU。cpu-number表示单板上CPU的编号。只有指定的slot支持多CPU时,才能配置该参数。
【使用指导】
不同的聚合方式使用不同的模板,使用该命令显示当前配置的所有聚合方式的统计输出报文的信息。
【举例】
# 查看NetStream统计输出信息。
<Sysname> display ip netstream export
IP export information:
Flow source interface : GigabitEthernet1/2/0/1
Flow destination VPN instance : VPN1
Flow destination IP address (UDP) : 10.10.0.10 (30000)
Version 5 exported flow number : 0
Version 5 exported UDP datagram number (failed) : 0 (0)
Version 9 exported flow number : 20
Version 9 exported UDP datagram number (failed) : 2 (0)
Version 10 exported flow number : 0
Version 10 exported UDP datagram number (failed) : 0 (0)
MPLS export information:
Flow source interface : GigabitEthernet1/2/0/1
Flow destination VPN instance : VPN1
Flow destination IP address (UDP) : 10.10.0.10 (30000)
Version 9 exported flow number : 20
Version 9 exported UDP datagram number (failed) : 2 (0)
Version 10 exported flow number : 0
Version 10 exported UDP datagram number (failed) : 0 (0)
as aggregation export information:
Flow source interface : GigabitEthernet1/2/0/1
Flow destination VPN instance : VPN1
Flow destination IP address (UDP) : 10.10.0.10 (30000)
Version 8 exported flow number : 0
Version 8 exported UDP datagram number (failed) : 0 (0)
Version 9 exported flow number : 16
Version 9 exported UDP datagram number (failed) : 2 (0)
Version 10 exported flow number : 0
Version 10 exported UDP datagram number (failed) : 0 (0)
表1-2 display ip netstream export命令显示信息描述表
字段 |
描述 |
IP export information |
版本5、版本9和版本10统计输出信息 |
Flow source interface |
输出信息的源接口 |
Flow destination VPN instance |
输出信息的目的地址所在的VPN |
Flow destination IP address (UDP) |
输出信息的目的IP地址(UDP端口号) |
Version 5 exported flow number |
使用版本5格式发送的流信息数 |
Version 5 exported UDP datagram number (failed) |
使用版本5格式发送的UDP报文数(发送失败的报文数) |
Version 9 exported flow number |
使用版本9格式发送的流信息数 |
Version 9 exported UDP datagram number (failed) |
使用版本9格式发送的UDP报文数(发送失败的报文数) |
MPLS export information |
版本9的MPLS流统计输出信息 |
L2 export information |
二层流统计输出信息 |
protocol-port aggregation export information |
协议-端口聚合的版本8统计输出信息 |
Version 8 exported flow number |
使用版本8格式发送的流信息数 |
Version 8 exported UDP datagram number (failed) |
使用版本8格式发送的UDP报文数(发送失败的报文数) |
Version 10 exported flow number |
使用版本10格式发送的流信息数 |
Version 10 exported UDP datagram number (failed) |
使用版本10格式发送的UDP报文数(发送失败的报文数) |
【相关命令】
· ip netstream export host (system view)
· ip netstream export host (aggregation view)
display ip netstream template命令用来查看NetStream模板的配置和状态信息。
【命令】
display ip netstream template [ chassis chassis-number slot slot-number [ cpu cpu-number ] ]
【视图】
任意视图
【缺省用户角色】
network-admin
network-operator
mdc-admin
mdc-operator
【参数】
chassis chassis-number slot slot-number:指定单板。chassis-number表示设备在集群中的成员编号,slot-number表示单板所在的槽位号。如果不指定本参数,则表示指定Master设备主用主控板。
cpu cpu-number:指定CPU。cpu-number表示单板上CPU的编号。只有指定的slot支持多CPU时,才能配置该参数。
【使用指导】
不同的聚合方式使用不同的模板,使用该命令显示当前配置的所有聚合方式的模板信息。
【举例】
# 使能自治系统聚合,查看NetStream模板信息(以版本10为例)。
<Sysname> display ip netstream template
Flow template refresh frequency : 20
Flow template refresh interval : 30 min
Active flow templates : 2
Created flow templates : 4
L3 outbound template:
Template ID : 3282
Packets : 0
Last template export time : 12/18/2017 at 14:51:15
Field count : 28
Field type Field length (bytes)
------------------------------------------------------------------------------
Out packets 8
Out bytes 8
First forwarded 4
Last forwarded 4
Input interface index 4
Output interface index 4
Source IPv4 address 4
Destination IPv4 address 4
Next hop IPv4 address 4
Source AS 4
Destination AS 4
L4 source port 2
L4 destination port 2
IP protocol version 1
TCP flags 1
Protocol 1
Source ToS 1
Source address mask 1
Destination address mask 1
Direction 1
Forwarding status 1
Out VPN ID 2
Sampling algorithm 1
PAD 1
Sampling interval 4
VXLAN ID 4
App ID 4
Bgp-community1 4
Bgp-community2 4
Bgp-community3 4
Bgp-community4 4
VPN instance name 65535
L3 inbound template:
Template ID : 3281
Packets : 0
Last template export time : 12/18/2017 at 14:51:15
Field count : 28
Field type Field length (bytes)
------------------------------------------------------------------------------
In packets 8
In bytes 8
First forwarded 4
Last forwarded 4
Input interface index 4
Output interface index 4
Source IPv4 address 4
Destination IPv4 address 4
Next hop IPv4 address 4
Source AS 4
Destination AS 4
L4 source port 2
L4 destination port 2
IP protocol version 1
TCP flags 1
Protocol 1
Source ToS 1
Source address mask 1
Destination address mask 1
Direction 1
Forwarding status 1
In VPN ID 2
Sampling algorithm 1
PAD 1
Sampling interval 4
VXLAN ID 4
App ID 4
Bgp-community1 4
Bgp-community2 4
Bgp-community3 4
Bgp-community4 4
VPN instance name 65535
# 配置ip netstream template rfc7011后,查看NetStream模板信息(以版本10为例)。
<Sysname> display ip netstream template
Flow template refresh frequency : 1
Flow template refresh interval : 30 min
Active flow templates : 2
Created flow templates : 8
L3 outbound template:
Template ID : 3282
Packets : 0
Last template export time : Never
Field count : 29
Field type Field length (bytes)
------------------------------------------------------------------------------
Out packets 8
Out bytes 8
First forwarded 4
Last forwarded 4
Input interface index 4
Output interface index 4
Source IPv4 address 4
Destination IPv4 address 4
Next hop IPv4 address 4
Source AS 4
Destination AS 4
L4 source port 2
L4 destination port 2
IP protocol version 1
TCP flags 1
Protocol 1
Source ToS 1
Source address mask 1
Destination address mask 1
Direction 1
Forwarding status 1
Out VPN ID 2
Sampling algorithm 1
PAD 1
Sampling interval 4
VXLAN ID 4
App ID 4
Bgp-community 65535
VPN instance name 65535
L3 inbound template:
Template ID : 3281
Packets : 0
Last template export time : Never
Field count : 29
Field type Field length (bytes)
------------------------------------------------------------------------------
In packets 8
In bytes 8
First forwarded 4
Last forwarded 4
Input interface index 4
Output interface index 4
Source IPv4 address 4
Destination IPv4 address 4
Next hop IPv4 address 4
Source AS 4
Destination AS 4
L4 source port 2
L4 destination port 2
IP protocol version 1
TCP flags 1
Protocol 1
Source ToS 1
Source address mask 1
Destination address mask 1
Direction 1
Forwarding status 1
In VPN ID 2
Sampling algorithm 1
PAD 1
Sampling interval 4
VXLAN ID 4
App ID 4
Bgp-community 65535
VPN instance name 65535
表1-3 display ip netstream template命令显示信息描述表
字段 |
描述 |
Flow template refresh frequency |
模板的包刷新率 |
Flow template refresh interval |
模板的时间刷新率,单位为分钟 |
Active flow templates |
当前激活的模板数 |
Created flow templates |
创建的模板总数 |
L3 outbound template |
L3出方向模板信息 |
L3 inbound template |
L3入方向模板信息 |
Template ID |
模板ID |
Packets |
使用该模板的发送报文数 |
Last template export time |
该模板最近的一次输出时间 |
Field count |
模板的域总数 |
Field type |
域类型 |
Field length (bytes) |
域长度,单位为字节 |
Out packets |
输出的数据包个数 |
In packets |
输入的数据包个数 |
Out bytes |
输出的数据个数,单位为字节 |
In bytes |
输入的数据个数,单位为字节 |
First forwarded |
记录转发第一个报文时的系统时间,时间精确到毫秒 |
Last forwarded |
记录转发最后一个报文时的系统时间,时间精确到毫秒 |
Input interface index |
输入接口的索引 |
Output interface index |
输出接口的索引 |
Source IPv4 address |
源IP地址 |
Destination IPv4 address |
目的IP地址 |
Next hop IPv4 address |
下一跳地址 |
Source AS |
源AS号 |
Destination AS |
目的AS号 |
L4 source port |
源端口号 |
L4 destination port |
目的端口号 |
IP protocol version |
IP协议版本号 |
TCP flags |
TCP Flag |
Protocol |
四层协议类型 |
Source ToS |
源服务类型 |
Source address mask |
源地址掩码 |
Destination address mask |
目的地址掩码 |
Direction |
方向字段 |
Forwarding status |
转发状态 |
Out VPN ID |
出方向vpn索引 |
In VPN ID |
入方向vpn索引(仅版本10支持) |
Sampling algorithm |
采样算法 |
PAD |
空白占位符 |
Sampling interval |
采样率 |
VXLAN ID |
VXLAN ID(仅版本10支持) |
App ID |
应用类型 |
Bgp-community |
BGP团体属性值(仅版本10支持) 未配置ip netstream template rfc7011时,该字段显示为Bgp-community1、Bgp-community2、Bgp-community3、Bgp-community4,字段取值长度固定为4字节;配置ip netstream template rfc7011后,该字段显示为Bgp-community,为可变长字段,最大可取65535字节 |
VPN instance name |
VPN实例名称,公网实例显示为N/A |
enable命令用来开启聚合视图对应的聚合功能。
undo enable命令用来关闭聚合视图对应的聚合功能。
【缺省情况】
NetStream聚合功能处于关闭状态。
【缺省用户角色】
network-admin
mdc-admin
[Sysname] ip netstream aggregation as
[Sysname-ns-aggregation-as] enable
【相关命令】
ip netstream命令用来在接口视图下开启NetStream功能。
undo ip netstream命令用来在接口视图下关闭NetStream功能。
【命令】
ip netstream { inbound | outbound }
undo ip netstream { inbound | outbound }
【视图】
接口视图
【缺省情况】
NetStream功能处于关闭状态。
【缺省用户角色】
network-admin
mdc-admin
【参数】
inbound:对入方向的流量进行NetStream统计。
outbound:对出方向的流量进行NetStream统计。
【使用指导】
本功能仅支持在物理接口下配置,逻辑接口下不支持配置本命令。对于聚合接口、子接口等逻辑接口,如果需要统计NetStream数据,则需要在其成员端口或主接口等物理接口上开启NetStream功能。设备将按照逻辑接口显示NetStream的统计信息。
【举例】
# 在接口GigabitEthernet1/2/0/1的入方向上开启NetStream功能。
<Sysname> system-view
[Sysname] interface gigabitethernet 1/2/0/1
[Sysname-GigabitEthernet1/2/0/1] ip netstream inbound
ip netstream命令用来在系统视图下开启NetStream功能。
undo ip netstream命令用来在系统视图下关闭NetStream功能。
【命令】
ip netstream
undo ip netstream
【视图】
系统视图
【缺省情况】
NetStream功能处于关闭状态。
【缺省用户角色】
network-admin
mdc-admin
【使用指导】
在系统视图下开启NetStream功能并不会开启所有接口的NetStream功能,用户仍需要在指定接口下开启NetStream功能。
当接口下使用NetStream镜像功能时,需要在系统视图下开启NetStream功能,才能使NetStream功能生效。
【举例】
# 在系统视图下开启NetStream功能。
<Sysname> system-view
[Sysname] ip netstream
ip netstream export host命令用来配置NetStream统计输出报文的目的地址和目的UDP端口号。
undo ip netstream export host命令用来删除指定NetStream统计输出报文的目的地址或配置的所有地址。
【命令】
ip netstream export host ip-address udp-port [ vpn-instance vpn-instance-name ]
undo ip netstream export host [ ip-address [ vpn-instance vpn-instance-name ] ]
【缺省情况】
未配置NetStream统计输出报文的目的地址和目的UDP端口号。
【视图】
NetStream聚合视图
【缺省用户角色】
network-admin
mdc-admin
【参数】
ip-address:NetStream统计输出报文的目的IP地址。
udp-port:NetStream统计输出报文的目的UDP端口号,取值范围为0~65535。
vpn-instance vpn-instance-name:指定NetStream统计输出报文的目的地址所属的VPN。vpn-instance-name表示MPLS L3VPN的VPN实例名称,为1~31个字符的字符串,区分大小写。如果未指定本参数,则表示NetStream统计输出报文的目的地址位于公网中。
【使用指导】
若没有使能某类聚合功能,则无法通过display ip netstream export命令查看它的相关信息(包括目的地址的目的UDP端口号)。
若聚合视图下未通过本命令配置目的地址和目的UDP端口号,则使用系统视图下的配置;若聚合视图下通过本命令配置了目的地址和目的UDP端口号,则优先使用聚合视图下的配置。
不同聚合视图下可以配置相同的目的地址和目的UDP端口号。同一个聚合视图下最多可以配置4组目的地址,设备会同时向多个已配置的目的地址发送NetStream报文,实现目的主机的备份。当多次执行本命令时:
· 如果指定的VPN参数不同,则不管IP地址和UDP端口号是否相同,均会配置成功,表示配置了不同组的目的地址。
· 如果指定的VPN参数相同或均未指定VPN参数,但IP地址不同,则均会配置成功,表示配置了不同组的目的地址。如果IP地址相同,但UDP端口号不同,则后配置的UDP端口号生效。
聚合流统计输出报文会发给聚合类型对应的聚合视图下配置的所有目的地址。
【举例】
# 配置自治系统聚合流的输出报文的目的IP地址为172.16.105.48,UDP端口号为5000。
<Sysname> system-view
[Sysname] ip netstream aggregation as
[Sysname-ns-aggregation-as] ip netstream export host 172.16.105.48 5000
【相关命令】
· ip netstream aggregation
· ip netstream export source
· ip netstream export host (system view)
· display ip netstream export
ip netstream export host命令用来配置NetStream统计输出报文的目的地址和目的UDP端口号。
undo ip netstream export host命令用来删除指定NetStream统计输出报文的目的地址或配置的所有地址。
【命令】
ip netstream export host ip-address udp-port [ vpn-instance vpn-instance-name ] [ chassis chassis-number slot slot-number [ cpu cpu-number ] ]
undo ip netstream export host [ ip-address [ vpn-instance vpn-instance-name ] ] [ chassis chassis-number slot slot-number [ cpu cpu-number ] ]
【缺省情况】
未配置NetStream统计输出报文的目的地址和目的UDP端口号。
【视图】
系统视图
【缺省用户角色】
network-admin
mdc-admin
【参数】
ip-address:NetStream统计输出报文的目的IP地址。
udp-port:NetStream统计输出报文的目的UDP端口号,取值范围为0~65535。
vpn-instance vpn-instance-name:指定NetStream统计输出报文的目的地址所属的VPN。vpn-instance-name表示MPLS L3VPN的VPN实例名称,为1~31个字符的字符串,区分大小写。如果未指定本参数,则表示NetStream统计输出报文的目的地址位于公网中。
chassis chassis-number slot slot-number:指定单板。chassis-number表示设备在集群中的成员编号,slot-number表示单板所在的槽位号。如果不指定本参数,则表示指定所有单板。
cpu cpu-number:指定CPU。cpu-number表示单板上CPU的编号。只有指定的slot支持多CPU时,才能配置该参数。
【使用指导】
若聚合视图下未配置目的地址和目的UDP端口号,则使用系统视图下的配置;若聚合视图下配置了目的地址和目的UDP端口号,则优先使用聚合视图下的配置。
多次执行本命令(无论指定的IP地址和UDP端口号是否一样),带slot参数的配置和不带slot参数的配置都可以同时存在。对于同一单板,设备会优先采用带slot参数的配置。对于没有单独配置的单板,设备会采用不带slot参数的配置。
系统视图下最多配置4组目的地址,设备会同时向多个已配置的目的地址发送NetStream报文,实现目的主机的备份。当多次执行本命令时:
· 如果指定的VPN参数不同,则不管IP地址和UDP端口号是否相同,均会配置成功,表示配置了不同组的目的地址。
· 如果指定的VPN参数相同或均未指定VPN参数,而IP地址不同,则均会配置成功,表示配置了不同组的目的地址。如果IP地址相同,但UDP端口号不同,则后配置的UDP端口号生效。
相同slot最多指定四组目的地址。
【举例】
# 配置全局NetStream统计输出报文的目的IP地址为172.16.105.48,UDP端口号为5000。
<Sysname> system-view
[Sysname] ip netstream export host 172.16.105.48 5000
【相关命令】
· ip netstream aggregation
· ip netstream export source
· ip netstream export host (aggregation view)
· display ip netstream export
ip netstream export rate命令用来配置输出速率限制。
undo ip netstream export rate命令用来恢复缺省情况。
【命令】
ip netstream export rate rate
undo ip netstream export rate
【缺省情况】
NetStream统计输出报文的输出速率不受限制。
【视图】
系统视图
【缺省用户角色】
network-admin
mdc-admin
【参数】
rate:NetStream统计输出报文的输出速率限制,取值范围为1~1000,单位为每秒最多允许输出的报文个数。
【使用指导】
配置输出速率限制,即限制每秒钟输出的最多报文数。
当设备每秒生成的NetStream报文数量超过限制,设备会将这些报文保存到缓冲区稍候发送。如果设备生成NetStream报文速率过快,会导致缓冲区被占满。此时,为避免NetStream报文丢失,该命令将暂时失效,设备会尽力发送NetStream报文,直到缓冲区能正常工作为止。
【举例】
# 设置每秒最多允许10个报文被输出。
<Sysname> system-view
[Sysname] ip netstream export rate 10
ip netstream export source命令用来配置NetStream统计输出报文的源接口。
undo ip netstream export source命令用来恢复缺省情况。
【命令】
ip netstream export source interface interface-type interface-number
undo ip netstream export source
【缺省情况】
采用统计输出报文的出接口IP地址作为源接口的IP地址。
【视图】
系统视图
NetStream聚合视图
【缺省用户角色】
network-admin
mdc-admin
【参数】
interface-type interface-number:NetStream统计输出报文的源接口,由接口类型和接口编号组成。
【使用指导】
通过本命令配置源接口后,会将NetStream统计输出报文的源IP地址设置为该接口的IP地址。
不同聚合视图下可以配置不同的源接口。
聚合视图下若未配置源接口,则使用系统视图下的配置。
【举例】
# 将NetStream统计输出报文源接口设置为GigabitEthernet1/2/0/1。
<Sysname> system-view
[Sysname] ip netstream export source interface gigabitethernet 1/2/0/1
# 将NetStream自治系统聚合统计输出报文源接口设置为GigabitEthernet1/2/0/2。
<Sysname> system-view
[Sysname] ip netstream aggregation as
[Sysname-ns-aggregation-as] ip netstream export source interface gigabitethernet 1/2/0/2
【相关命令】
· ip netstream aggregation
ip netstream export template refresh-rate 命令用来配置NetStream统计输出报文版本9或版本10模板的刷新率。
undo ip netstream export template refresh-rate 命令用来恢复缺省情况。
【命令】
ip netstream export template refresh-rate { packet packets | time minutes }
undo ip netstream export template refresh-rate { packet | time }
【缺省情况】
每隔20个包设备刷新一次版本9或版本10模板。
每隔30分钟设备刷新一次版本9或版本10模板。
【视图】
系统视图
【缺省用户角色】
network-admin
mdc-admin
【参数】
packet packets:NetStream统计输出报文版本9或版本10模板的包刷新率,取值范围为1~600,单位为包数,即每隔多少个包刷新一次模板,并通知NetStream服务器最新的模板格式。
time minutes:NetStream统计输出报文版本9或版本10模板的时间刷新率,取值范围为1~3600,单位为分钟,即每隔多少分钟刷新一次模板,并通知NetStream服务器最新的模板格式。
【使用指导】
版本9和版本10是基于模板方式的、支持自定义格式,由于NetStream服务器不会永久保存模板,所以设备需要定期通知NetStream服务器最新版本9或版本10模板格式。用户可以根据实际情况,配置版本9或版本10模板的包刷新率和时间刷新率,及时更新模板。
可以同时配置包刷新率和时间刷新率,只要满足任意一个刷新条件,设备就会将符合条件的模板发送给NetStream服务器。
【举例】
# 将NetStream统计输出报文版本9或版本10模板的包刷新率设为100。
<Sysname> system-view
[Sysname] ip netstream export template refresh-rate packet 100
ip netstream export version 5命令用来配置NetStream版本5的自治系统选项。
ip netstream export version 9命令用来配置NetStream版本9的自治系统选项和BGP下一跳选项。
ip netstream export version 10命令用来配置NetStream版本10的自治系统选项和BGP下一跳选项。
undo ip netstream export version命令用来恢复缺省情况。
【命令】
ip netstream export version 5 { origin-as | peer-as }
ip netstream export version { 9 | 10 } { origin-as | peer-as } [ bgp-nexthop ]
undo ip netstream export version
【缺省情况】
NetStream统计输出报文使用版本9,记录邻接自治系统(peer-as)信息,不记录BGP下一跳信息。
【视图】
系统视图
【缺省用户角色】
network-admin
mdc-admin
【参数】
origin-as:流信息中记录的自治系统号为起始自治系统号。
peer-as:流信息中记录的自治系统号为邻接自治系统号。
bgp-nexthop:流信息中记录BGP下一跳。
【使用指导】
NetStream流信息中会记录流的源IP地址及其对应的自治系统号;目的IP地址及其对应的自治系统号。设备会根据用户实际配置的自治系统参数来确定记录的自治系统号。版本9和版本10还可以配置是否记录BGP下一跳信息。
同一时间,Netstream只能使用一个版本输出报文,所以,多次执行本命令,最后一次执行的命令生效。
当设备上配置了聚合时,如果配置输出报文为版本5,则流统计信息采用版本8输出;如果配置输出为版本9,则流统计信息采用版本9输出;如果配置输出为版本10,则流统计信息采用版本10输出。
【举例】
# 将NetStream统计输出报文为版本5,并设置流信息中记录的自治系统号为起始自治系统号。
<Sysname> system-view
[Sysname] ip netstream export version 5 origin-as
ip netstream max-entry命令用来配置NetStream流缓存区中流表项达到最大数目时的处理方式。
undo ip netstream max-entry命令用来恢复缺省情况。
【命令】
ip netstream max-entry { aging | disable-caching }
undo ip netstream max-entry
【缺省情况】
缺省情况下,NetStream流缓存区中流表项达到最大数目时的处理方式为aging。
【视图】
系统视图
【缺省用户角色】
network-admin
mdc-admin
【参数】
aging:达到流表项的最大数目时,强制老化部分流表项。
disable-caching:达到流表项的最大数目时,禁止新建流表项。
【使用指导】
多次执行本命令,最后一次执行的命令生效。
【举例】
# 设置NetStream在达到流表项的最大数目时,禁止新建流表项。
<Sysname> system-view
[Sysname] ip netstream max-entry disable-caching
# 设置NetStream在达到流表项的最大数目时,强制老化部分流表项。
<Sysname> system-view
[Sysname] ip netstream max-entry aging
ip netstream mpls命令用来开启MPLS报文统计功能。
undo ip netstream mpls命令用来关闭MPLS报文统计功能。
【命令】
ip netstream mpls [ label-positions label-position1 [ label-position2 [ label-position3 ] ] ] [ no-ip-fields ]
undo ip netstream mpls
【缺省情况】
MPLS报文统计功能处于关闭状态。
【视图】
系统视图
【缺省用户角色】
network-admin
mdc-admin
【参数】
label-positions:统计的MPLS报文的标签位置。
label-position1:指定统计的MPLS报文的第一个标签位置,取值范围为1~6。
label-position2:指定统计的MPLS报文的第二个标签位置,取值范围为1~6。
label-position3:指定统计的MPLS报文的第三个标签位置,取值范围为1~6。
no-ip-fields:不统计IP选项。
【使用指导】
该命令不仅开启IPv4 NetStream对MPLS报文的统计功能,同时也开启了IPv6 NetStream对MPLS报文的统计功能。
若未指定任何参数,表示基于MPLS报文的首标签并且带有IP选项进行统计。
当需要统计MPLS报文的多个标签时,指定的标签位置不允许重复,最终统计的多个标签的位置依据从小到大的顺序取指定值。
【举例】
# 开启MPLS报文统计功能,基于MPLS报文的首标签并且不带IP选项进行统计。
<Sysname> system-view
[Sysname] ip netstream mpls no-ip-fields
ip netstream sampler命令用来开启NetStream采样功能。
undo ip netstream sampler命令用来关闭NetStream采样功能。
【命令】
ip netstream { inbound | outbound } sampler sampler-name
undo ip netstream { inbound | outbound } sampler
【缺省情况】
设备未引用采样器,自动按照8000:1的采样比对流量进行采样。
【视图】
接口视图
【缺省用户角色】
network-admin
mdc-admin
【参数】
inbound:对入方向的报文进行采样。
outbound:对出方向的报文进行采样。
sampler sampler-name:采样器名称,为1~31个字符的字符串,不区分大小写。
【使用指导】
通过配置NetStream采样功能,可在满足NetStream收集到的统计信息能基本反映整个网络的状况的前提下,减少网络的流量,避免网络中的大流量对设备转发性能造成影响。采样率越低对设备性能的影响越小。
【举例】
# 在接口GigabitEthernet1/2/0/1上开启NetStream采样功能,使用名为abc的采样器对入方向的报文进行采样,Netstream根据采样结果进行报文统计。
<Sysname> system-view
[Sysname] interface gigabitethernet 1/2/0/1
[Sysname-GigabitEthernet1/2/0/1] ip netstream inbound
[Sysname-GigabitEthernet1/2/0/1] ip netstream inbound sampler abc
ip netstream template rfc7011命令用来配置模板格式与RFC协议一致。
undo ip netstream template rfc7011命令用来恢复缺省情况。
【命令】
ip netstream template rfc7011
undo ip netstream template rfc7011
【缺省情况】
设备采用H3C私有的NetStream的模板格式。
【视图】
系统视图
【缺省用户角色】
network-admin
mdc-admin
【使用指导】
缺省情况下,设备采用H3C私有的NetStream的模板格式。配置该命令后,NetStream将使用RFC7011协议定义的模板格式输出报文。设备端选用的模板格式必须和服务器端选用的模板格式保持一致。
该命令对IPv4和IPv6 NetStream模板格式同时生效。
【举例】
# 配置模板格式与RFC7011协议一致。
<Sysname> system-view
[Sysname] ip netstream template rfc7011
ip netstream timeout active命令用来配置流的活跃老化时间。
undo ip netstream timeout active命令用来恢复缺省情况。
【命令】
ip netstream timeout active minutes
undo ip netstream timeout active
【缺省情况】
流的活跃老化时间为1分钟。
【视图】
系统视图
【缺省用户角色】
network-admin
mdc-admin
【参数】
minutes:流的活跃老化时间,取值范围为1~60,单位为分钟。
【使用指导】
从采集到的第一个报文开始,该流在指定的时间内能被采集到,则该流属于活跃的流,指定的时间称为流的活跃老化时间。
【举例】
# 将流的活跃老化时间设置为60分钟。
<Sysname> system-view
[Sysname] ip netstream timeout active 60
【相关命令】
· ip netstream timeout inactive
ip netstream timeout inactive命令用来配置流的不活跃老化时间。
undo ip netstream timeout inactive命令用来恢复缺省情况。
【命令】
ip netstream timeout inactive seconds
undo ip netstream timeout inactive
【缺省情况】
流的不活跃老化时间为30秒。
【视图】
系统视图
【缺省用户角色】
network-admin
mdc-admin
【参数】
seconds:流的不活跃老化时间,取值范围为10~600,单位为秒。
【使用指导】
从采集到的最后一个报文开始,该流在指定的时间内没有被采集到,则该流属于不活跃的流,指定的时间称为流的不活跃老化时间。
【举例】
# 将流的不活跃老化时间设置为60秒。
<Sysname> system-view
[Sysname] ip netstream timeout inactive 60
【相关命令】
reset ip netstream statistics命令用来将流缓存区中所有流强制老化,输出报文信息,并清空NetStream缓冲区的状态信息。
【命令】
reset ip netstream statistics
【视图】
用户视图
【缺省用户角色】
network-admin
mdc-admin
【使用指导】
在执行清空缓冲区中老化流的动作时,命令行会给出提示,告知用户这个动作可能要持续几分钟,在这段时间内不能统计。
【举例】
# 将流缓存区中所有流老化,输出报文信息,并清空NetStream缓冲区的状态信息。
<Sysname> reset ip netstream statistics
This process may take a few minutes.
Netstream statistic function is disabled during this process.
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!