Evil_TTL> show | s


Category:Cisco Systems -> Routing and Switching

How to get running configuration via SNMP

First, you need a special utility software like Net-SNMP. It works under MS Windows. Net-SNMP is a freeware tool. You can download it from the official web-site or right from here: File:net snmp 1.win32.zip

Place the files from the archive into a folder and add a system path to it by going to My Computer - System Properties - Advanced - Environment Variables.

Create a file with the extension of .bat or .cmd. For example you made getcfg.cmd file. Now you need to place the following lines into it:

snmpset -v 1 -c write %1 . i 1
-v 1 -c write %1 . i 4
-v 1 -c write %1 . i 1
-v 1 -c write %1 . a //tftp server address
snmpset -v 1 -c write %1 . s "%1-cfg" // Filename
snmpset -v 1 -c write %1 . i 1
// Where "write" is the community name. It MUST have write privileges!
// %1 is a variable for the device IP address. The variable is announced after the batch file in CLI, see below. 

Here is how to use it. Run tftpd32 or whatever you are using to start a TFTP service. Then type in the command line (cmd.exe) the following, for example: getcfg.cmd The script will create a new file with the actual configuration retrieved from the device.

Basic commands to configure community with Read/Write access:

access-list 10 permit
snmp-server community write RW 10 // Don't use "write" for the community name ever in real! 

SNMPv3 configuration example:

!* Configure target SNMP server SNMPv3 AES
-server view <nameiso included
-server group <group_namev3 priv read <namenotify <name>
snmp-server user <name> <group_namev3 auth sha <auth-keypriv aes 128 <enc-key>
snmp-server host ver 3 priv <name>
snmp-server host ver 3 priv <name
By privilege15