How to shutdown an interface using SNMP remotely

Latest reply: Apr 1, 2017 14:28:28 1135 1 0 0
Let's consider a S5700 switch with version V200R005C00SPC500 for which we are trying to shutdown one of its interfaces remotely using SNMP. It's possible? Yes, let's see how to do it.
  • x
  • convention:

Created Apr 1, 2017 14:28:28 Helpful(0) Helpful(0)

Firstly we will need a tool to generate SET request SNMP packets to query the switch. You will have to choose one from the many tools available on the internet.

c7b5dbf87a1347c9b4b1a0bfd4cd3dfd

Next, we will need to find a OID. This is the correct one.

 1.3.6.1.2.1.2.2.1.7.14

What this string means:

 1.3.6.1.2.1.2.2.1 is the ifEntry table which describes different characteristics of an interface. Check below more relevant subtables:

•1.3.6.1.2.1.2.2.1.1 - ifIndex 
•1.3.6.1.2.1.2.2.1.2 - ifDescr 
•1.3.6.1.2.1.2.2.1.3 - ifType 
•1.3.6.1.2.1.2.2.1.4 - ifMtu 
•1.3.6.1.2.1.2.2.1.5 - ifSpeed 
•1.3.6.1.2.1.2.2.1.6 - ifPhysAddress 
•1.3.6.1.2.1.2.2.1.7 - ifAdminStatus 
•1.3.6.1.2.1.2.2.1.8 - ifOperStatus 
•1.3.6.1.2.1.2.2.1.9 - ifLastChange 
•1.3.6.1.2.1.2.2.1.10 - ifInOctets 
•1.3.6.1.2.1.2.2.1.11 - ifInUcastPkts 
•1.3.6.1.2.1.2.2.1.12 - ifInNUcastPkts 
•1.3.6.1.2.1.2.2.1.13 - ifInDiscards 
•1.3.6.1.2.1.2.2.1.14 - ifInErrors 
•1.3.6.1.2.1.2.2.1.15 - ifInUnknownProtos 
•1.3.6.1.2.1.2.2.1.16 - ifOutOctets 
•1.3.6.1.2.1.2.2.1.17 - ifOutUcastPkts 
•1.3.6.1.2.1.2.2.1.18 - ifOutNUcastPkts 
•1.3.6.1.2.1.2.2.1.19 - ifOutDiscards 
•1.3.6.1.2.1.2.2.1.20 - ifOutErrors 
•1.3.6.1.2.1.2.2.1.21 - ifOutQLen 
•1.3.6.1.2.1.2.2.1.22 - ifSpecific 

The one  we are interested it's subtable 7, ifAdminStatus [7] which defines the status of the interface.

The last number for the string is 14 and it defines the interface index. To see the index of the interface please insert the below command :
[sw]diagnose 
[sw]display ifnet index-map

then we can see that interface g0/0/10 has index 14 associated.

9b6ab375eb8444e08e73273d3ad4e431

What value 2 of  ”ASN1_INT” represents?  it's the SET request integer value that it's used to trigger a specific interface state. It has 3 possible states {up (1),down (2),testing (3)}. We will pick 2 for this.

Finally this is how the set-request packet should look like.

b18c341a14b846719f145f8f9f52fcbd

The result:

aa145e23fa114a889eeb64c1486365cb

Don't forget to enable write community rights in order for the switch to respond to set-request SNMP requests.


  • x
  • convention:

Reply

Reply
You need to log in to reply to the post Login | Register

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " Privacy."
If the attachment button is not available, update the Adobe Flash Player to the latest version!

Login and enjoy all the member benefits

Login
Fast reply Scroll to top