Example for Configuring an SNMP Query Test Instance
Networking Requirements
As shown in Figure 4-6, SNMP agent is enabled on SwitchA and SwitchC. An NQA SNMP query test needs to be performed to obtain the time from when SwitchA sends an SNMP query packet to when SwitchA receives an Echo packet.
Configuration Roadmap
The configuration roadmap is as follows:
Configure SwitchA as an NQA client.
Enable SNMP agent on SwitchA.
Create and start an SNMP query test instance on SwitchA.
Enable the SNMP agent on SwitchC.
Procedure
- Configure an IP address for each interface and ensure reachable routes between switches, as shown in Figure 4-6.
<Quidway> system-view
[Quidway] sysname SwitchA
[SwitchA] vlan 100
[SwitchA-vlan100] quit
[SwitchA] interface ethernet 0/0/1
[SwitchA-Ethernet0/0/1] port hybrid pvid vlan 100
[SwitchA-Ethernet0/0/1] port hybrid untagged vlan 100
[SwitchA-Ethernet0/0/1] quit
[SwitchA] interface Vlanif 100
[SwitchA-Vlanif100] ip address 10.1.1.1 24
[SwitchA-Vlanif100] quit
[SwitchA] ip route-static 10.2.1.0 255.255.255.0 10.1.1.2
For configurations of SwitchB and SwitchC, see the configuration files.
- Enable SNMP agent on SwitchC.
<SwitchC> system-view
[SwitchC] snmp-agent
- Enable SNMP agent on SwitchA.
[SwitchA] snmp-agent
- Create an SNMP query test instance on SwitchA.
[SwitchA] nqa test-instance admin snmp
[SwitchA-nqa-admin-snmp] test-type snmp
[SwitchA-nqa-admin-snmp] destination-address ipv4 10.2.1.2
- Start the test instance.
[SwitchA-nqa-admin-snmp] start now
- Check the configuration.
# Check NQA test results on SwitchA.
[SwitchA-nqa-admin-snmp] display nqa results test-instance admin snmp
NQA entry(admin, snmp) :testflag is inactive ,testtype is snmp 1 . Test 1 result The test is finished Send operation times: 3 Receive response times: 3 Completion:success RTD OverThresholds number: 0 Attempts number:1 Drop operation number:0 Disconnect operation number:0 Operation timeout number:0 System busy operation number:0 Connection fail number:0 Operation sequence errors number:0 RTT Stats errors number:0 Destination ip address:10.2.1.2 Min/Max/Average Completion Time: 63/172/109 Sum/Square-Sum Completion Time: 329/42389 Last Good Probe Time: 2012-07-25 15:33:49.1 Lost packet ratio: 0 %
Configuration Files
Configuration file of SwitchA
# sysname SwitchA # vlan batch 100 # snmp-agent snmp-agent local-engineid 800007DB03020000510162 snmp-agent sys-info version v3 # interface Vlanif100 ip address 10.1.1.1 255.255.255.0 # interface Ethernet0/0/1 port hybrid pvid vlan 100 port hybrid untagged vlan 100 # ip route-static 10.2.1.0 255.255.255.0 10.1.1.2 # nqa test-instance admin snmp test-type snmp destination-address ipv4 10.2.1.2 # return
Configuration file of SwitchB
# sysname SwitchB # vlan batch 100 110 # interface Vlanif100 ip address 10.1.1.2 255.255.255.0 # interface Vlanif110 ip address 10.2.1.1 255.255.255.0 # interface Ethernet0/0/1 port hybrid pvid vlan 100 port hybrid untagged vlan 100 # interface Ethernet0/0/2 port hybrid pvid vlan 110 port hybrid untagged vlan 110 # return
Configuration file of SwitchC
# sysname SwitchC # vlan batch 110 # snmp-agent snmp-agent local-engineid 800007DB03000011110126 snmp-agent sys-info version v3 # interface Vlanif110 ip address 10.2.1.2 255.255.255.0 # interface Ethernet0/0/1 port hybrid pvid vlan 110 port hybrid untagged vlan 110 # ip route-static 10.1.1.0 255.255.255.0 10.2.1.1 # return