配置RMON2示例
配置思路
通过配置RMON2流量统计功能实现接口基于IP协议包的流量统计。RMON2可以通过SNMP网管工作站进行远程监视,也可以通过命令行配置方式进行流量监视。本例通过命令行配置来进行流量监视。
采用如下的思路配置RMON2:
- 配置Router接口的IP地址。
- 配置主机控制表和协议目录表,实现RMON2流量统计功能。
操作步骤
- 配置Router接口的IP地址
<Huawei> system-view [Huawei] sysname Router [Router] interface gigabitethernet 2/0/0 [Router-GigabitEthernet2/0/0] ip address 10.3.3.3 24 [Router-GigabitEthernet2/0/0] quit
- 配置RMON2流量统计功能
# 配置主机控制表。设置索引为123,并将主机表的最大条目数设为100。
[Router] rmon2 hlhostcontroltable index 123 datasource interface gigabitethernet 2/0/0 maxentry 100 owner china status active
# 配置协议目录表。协议ID目前只支持8.0.0.0.1.0.0.8.0,parameter只支持2.0.0,host的值设置为suppurtedon(即对该协议进行流量统计)。
[Router] rmon2 protocoldirtable protocoldirid 8.0.0.0.1.0.0.8.0 parameter 2.0.0 descr IP host supportedon owner china status active
- 验证配置结果
# 指定IP地址来查看特定主机的流量。
<Router> display rmon2 nlhosttable hostcontrolindex 123 hostaddress 10.3.3.10 Abbreviation: HIdx - hlHostControlIndex Addr - nlHostAddress InPkts - nlHostInPkts OutPkts - nlHostOutPkts InOctes - nlHostInOctets OutOctes - nlHostOutOctets OutMac - nlHostOutMacNonUnicastPkts HIdx Addr InPkts OutPkts InOctes OutOctes OutMac 123 10.3.3.10 0 78 0 1046 78
# 查看主机控制表信息,可以看到该接口上的增加主机条目数、删除的主机条目数和主机表的最大条目数。
<Router> display rmon2 hlhostcontroltable Abbreviation: index - hlhostcontrolindex datasource - hlhostcontroldatasource droppedfrm - hlhostcontrolnldroppedframes inserts - hlhostcontrolnlinserts Deletes - hlHostControlNlDeletes maxentries - hlhostcontrolnlmaxdesiredentries status - hlhostcontrolstatus index datasource droppedfrm inserts Deletes maxentries status 123 GE2/0/0 0 19 0 100 active
配置文件
Router的配置文件
# sysname Router # interface GigabitEthernet2/0/0 ip address 10.3.3.3 255.255.255.0 # rmon2 protocoldirtable protocoldirid 8.0.0.0.1.0.0.8.0 parameter 2.0.0 descr IP host supportedon owner china status active rmon2 hlhostcontroltable index 123 datasource interface GigabitEthernet2/0/0 maxentry 100 owner china status active # return