Example for Configuring RMON2
Networking Requirements
In Figure 2-2, a LAN is connected to GE1/0/1. IP packet statistics collection needs to be configured on VLANIF10.
Configuration Roadmap
Run RMON2 to remotely monitor traffic on networks using the NMS or command line. The following example describes using the command line:
- Configure IP addresses for switch interfaces.
- Configure the host control table and protocol directory table so that RMON2 collects traffic statistics.
Procedure
- Configure a VLAN and add GE1/0/1 to it.
<HUAWEI> system-view [HUAWEI] sysname Switch [Switch] vlan 10 [Switch-vlan10] quit [Switch] interface gigabitethernet 1/0/1 [Switch-GigabitEthernet1/0/1] port link-type hybrid [Switch-GigabitEthernet1/0/1] port hybrid pvid vlan 10 [Switch-GigabitEthernet1/0/1] port hybrid untagged vlan 10 [Switch-GigabitEthernet1/0/1] quit
- Create a VLANIF interface and assign an IP address to the VLANIF interface.
[Switch] interface vlanif 10 [Switch-Vlanif10] ip address 10.1.1.1 24 [Switch-Vlanif10] quit
- Configure RMON2 traffic statistics collection.
# Configure the host control table. Set the index to 123 and the maximum number of entries in the table to 100.
[Switch] rmon2 hlhostcontroltable index 123 datasource interface vlanif 10 maxentry 100 owner china status active
# Configure the protocol directory table. The protocol ID is fixed at 8.0.0.0.1.0.0.8.0, the parameter is fixed at 2.0.0, and the host value is fixed at supportedon (collecting statistics on these protocol packets).
[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
- Verify the configuration.
# View information on the host table.
<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)
# Set the time filter to display only the entries meeting filtering conditions.
<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)
# View information on the host control table, such as the number of added entries and deleted entries, and the total number of entries on the interface.
<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
Configuration Files
Switch configuration file
# sysname Switch # vlan batch 10 # interface Vlanif10 ip address 10.1.1.1 255.255.255.0 # interface GigabitEthernet1/0/1 port link-type hybrid 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