Friday, October 7, 2016

use snmp 3 to restart mikrotik router

mikrotik ip: 192.168.56.4


*** on mikrotik
/ snmp community add name="publicrw" addresses=0.0.0.0/0 security
=authorized read-access=yes write-access=yes authentication-protocol=SHA1 encryption-protocol=DES authentication-password="12345678" encryption-password="12345678"


/snmp set trap-community=publicrw trap-version=3 enabled=yes


*** on client there are three utilities that we can interact with snmp v3
- snmpwalk
- snmpset
- snmpgetnext

- walk through all the community strings
$ snmpwalk -v 3 -n "" -u publicrw -a SHA -x DES -A "12345678" -X "12345678" -l authPriv 192.168.56.4

- get snmp value
$ snmpgetnext -v 3 -n "" -u publicrw -a SHA -x DES -A "12345678" -X "12345678" -l authPriv 192.168.56.4 .
iso.3.6.1.2.1.1.1.0 = STRING: "RouterOS x86"


 - reboot the mikrotik router
$ snmpset -v 3 -n "" -u publicrw -a SHA -x DES -A "12345678" -X "12345678" -l authPriv 192.168.56.4  1.3.6.1.4.1.14988.1.1.7.1.0 s 1


No comments:

Post a Comment