配置RMON2示例
配置思路
通过配置RMON2流量统计功能实现接口基于IP协议包的流量统计。RMON2可以通过NMS进行远程监视,也可以通过命令行配置方式进行流量监视。本例通过命令行配置来进行流量监视。
采用如下的思路配置RMON2:
- 配置Switch接口的IP地址。
- 配置主机控制表和协议目录表,实现RMON2流量统计功能。
操作步骤
- 配置VLAN,并且将GE1/0/1接口加入VLAN
<Quidway> system-view [Quidway] sysname Switch [Switch] vlan 10 [Switch-vlan10] quit [Switch] interface gigabitethernet 1/0/1 [Switch-GigabitEthernet1/0/1] port hybrid pvid vlan 10 [Switch-GigabitEthernet1/0/1] port hybrid untagged vlan 10 [Switch-GigabitEthernet1/0/1] quit
- 配置VLANIF接口,并且配置VLANIF接口的IP地址
[Switch] interface vlanif 10 [Switch-Vlanif10] ip address 10.1.1.1 24 [Switch-Vlanif10] quit
- 配置RMON2流量统计功能
# 配置主机控制表。设置索引为123,并将主机表的最大条目数设为100。
[Switch] rmon2 hlhostcontroltable index 123 datasource interface vlanif 10 maxentry 100 owner china status active
# 配置协议目录表。协议ID目前只支持8.0.0.0.1.0.0.8.0,parameter只支持2.0.0,host的值设置为supportedon(即对该协议进行流量统计)。
[Switch] rmon2 protocoldirtable protocoldirid 8.0.0.0.1.0.0.8.0 parameter 2.0.0 descr IP host supportedon owner china status active [Switch] quit
- 检验配置结果
# 查看整个主机表的信息。
<Switch> display rmon2 nlhosttable hostcontrolindex 123 Abbreviation: HIdx - hlHostControlIndex PIdx - ProtocolDirLocalIndex Addr - nlHostAddress InPkts - nlHostInPkts OutPkts - nlHostOutPkts InOctes - nlHostInOctets OutOctes - nlHostOutOctets OutMac - nlHostOutMacNonUnicastPkts ChgTm - nlHostTimeMark CrtTm - nlHostCreateTime HIdx PIdx Addr InPkts OutPkts InOctes OutOctes OutMac ChgTm CrtTm 123 1 10.1.1.1 0 78 0 10046 78 0 days 00h:01m:29s.09th(8909) 0 days 00h:01m:01s.13th(6113) 123 1 10.1.1.4 78 0 10046 0 0 0 days 00h:01m:29s.09th(8909) 0 days 00h:01m:01s.13th(6113)
# 设置时间过滤器的值,只查看符合过滤条件的条目。
<Switch> display rmon2 nlhosttable hostcontrolindex 123 timemark 1000 hostaddress 10.1.1.1 Abbreviation: HIdx - hlHostControlIndex PIdx - ProtocolDirLocalIndex Addr - nlHostAddress InPkts - nlHostInPkts OutPkts - nlHostOutPkts InOctes - nlHostInOctets OutOctes - nlHostOutOctets OutMac - nlHostOutMacNonUnicastPkts ChgTm - nlHostTimeMark CrtTm - nlHostCreateTime HIdx PIdx Addr InPkts OutPkts InOctes OutOctes OutMac ChgTm CrtTm 123 1 10.1.1.1 0 78 0 10046 78 0 days 00h:01m:29s.09th(8909) 0 days 00h:01m:01s.13th(6113)
# 查看主机控制表信息,可以看到该接口上的增加主机条目数、删除的主机条目数和主机表的最大条目数。
<Switch> 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 Vlanif10 0 19 0 100 active
配置文件
Switch的配置文件
# sysname Switch # vlan batch 10 # interface Vlanif10 ip address 10.1.1.1 255.255.255.0 # interface GigabitEthernet1/0/1 port hybrid pvid vlan 10 port hybrid untagged vlan 10 # 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 Vlanif10 maxentry 100 owner china status active # return