FAQ - Shut down an interface using SNMP

Publication Date:  2017-01-25 Views:  667 Downloads:  0
Issue Description

How to administratively shut down an interface using SNMP

Solution

You need to configure SNMP Agent  on your switch:

    1  Enable the SNMP agent.

[HUAWEI] snmp-agent

2.     Set the SNMP version on the switch to SNMPv1.

[HUAWEI] snmp-agent sys-info version v1/v2c/v3

Please be aware that you need to select the same version on the below application.

3.     Set the access right for the NMSs.

(Optional) # Configure an ACL that allows NMS2 to manage the switch and prevents NMS1 from managing the switch.

[HUAWEI] acl 2001

[HUAWEI-acl-basic-2001] rule 5 permit source 1.1.1.2 0.0.0.0

[HUAWEI-acl-basic-2001] rule 6 deny source 1.1.1.1 0.0.0.0

[HUAWEI-acl-basic-2001] quit

          # Configure the MIB view to allow NMS2 to manage objects except HGMP objects on the switch.

[HUAWEI] snmp-agent mib-view excluded allexthgmp 1.3.6.1.4.1.2011.6.7

# Configure a community name and reference the ACL and MIB view for the community.

[HUAWEI] snmp-agent community write adminnms2 mib-view allexthgmp acl 2001

[HUAWEI] snmp-agent community read adminnms2 mib-view allexthgmp acl 2001

The next step is to find the correct OID for your requirements. For this situation the OID is:  1.3.6.1.2.1.2.2.1.   


You can use a software to configure SNMPSET function.  (example SNMP GET /SET tool by Carsten Schmidt) . 

         

 The value number represents {up (1),down (2),testing (3)} , and in the Value type please selec ”ASN1_INT”:

 

The OID number 1.3.6.1.2.1.2.2.1.7.14 is formed of the OID of the table where 7 is  ifAdminStatus [7] and 14 represents: the index of the interface g0/0/10.

To see the index of the interface please insert the below command :

[sw]diagnose

[sw]display ifnet index-map 


Below we can see how the interface has changed from UP to DOWN. 

Hope my explication was helpful for you!

END