The following example shows how to enable SNMPv1. The configuration permits any SNMP manager to access all objects with read-only permissions using the community string named public. This configuration does not cause the router to send traps.
Device(config)# snmp-server community public
The following example shows how to permit SNMP access to all objects with read-only permission using the community string named public. The router also will send BGP traps to the hosts 172.16.1.111 and 172.16.1.33 using SNMPv1. The community string named public is sent with the traps.
Device(config)# snmp-server community public
Device(config)# snmp-server enable traps bgp
Device(config)# snmp-server host 172.16.1.111 version 1 public
Device(config)# snmp-server host 172.16.1.33 public
The following example shows how to send the SNMP and Cisco environmental monitor enterprise-specific traps to address 172.30.2.160:
Device(config)# snmp-server enable traps
Device(config)# snmp-server host 172.30.2.160 public snmp envmon
The following example shows how to enable the router to send all traps to the host example.com using the community string public:
Device(config)# snmp-server enable traps
Device(config)# snmp-server host example.com public
The following example shows a configuration in which no traps are sent to a host. The BGP traps are enabled for all hosts, but only the OSPF traps are enabled to be sent to a host.
Device(config)# snmp-server enable traps bgp
Device(config)# snmp-server host host1 public ospf
The following example shows how to enable a router to send all informs to the host example.com using the community string named public:
Device(config)# snmp-server enable traps
Device(config)# snmp-server host example.com informs version 2c public
The following example shows how to enable the SNMP manager and set the session timeout to a value greater than the default:
Device(config)# snmp-server manager
Device(config)# snmp-server manager session-timeout 1000
The following example shows how to enable the SNMP manager to access all objects with read-only permissions. The user is specified as
abcd and the authentication password is
abcdpasswd. To obtain the automatically generated default local engine ID, use the
show
snmp
engineID command.
Device(config)# snmp-server view readview internet included
Device(config)# snmp-server view readview iso included
Device(config)# snmp-server group group1 v3 noauth read readview
Device(config)# snmp-server user abcd group1 v3 auth md5 abcdpasswd