The following code is an example configuration for a cisco device using SNMP (v2c) showing how to configure and access list, a view, read-only access and read-write access. If you would prefer to use SNMP V3 see our guide here.
The first command in the code below allows any device from 192.168.1.X to connect to it via SNMP and names the list 42.
The configuration then creates a view of the SNMP tree named NMIS8RO that allows the whole tree (iso is the root) to be visible (this could be changed so only the ifTable was accessible for example), a community string NMISreadView is then attached to the view NMIS8RO and added as read-only to the access list 42.
The next line does almost the same thing, granting full access (no view specified) as read-only to our 42 access list.
If read-write access is required, NMISwrite is configured as a community string that has full access to the snmp tree when connecting from access list 42.
Next location and contact details are configured.
! Access list to limit servers which can do SNMP access-list 42 permit 192.168.1.0 0.0.0.255 ! ! SNMP View to ensure entire SNMP Tree is available (optional) snmp-server view NMIS8RO iso included ! ! Read only Community String with view and Access List snmp-server community NMISreadView view NMIS8RO RO 42 ! ! Read only Community String and Access List snmp-server community NMISread RO 42 ! ! Read write community with access list (needed for IPSLA) snmp-server community NMISwrite RW 42 ! ! Set the location (optional) snmp-server location Brisbane, Queensland, Australia ! ! Set the contact (optional) snmp-server contact NMIS Dudes, +617 3555 5558
That should be all that is required to get basic SNMP access to your router configured. If you haven't already, add your cisco device to NMIS, instructions to do that are here.
For more information, commands and sample configurations see the cisco configuration guide: http://www.cisco.com/en/US/docs/ios/12_2/configfun/configuration/guide/fcf014.html