The following example shows how to enable SNMPv1, SNMPv2c, and SNMPv3. 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 device
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 device will also send ISDN traps to the hosts 172.16.1.111 and 172.16.1.33 using SNMPv1 and to the host
172.16.1.27 using SNMPv2c. The community string named public is sent with the traps.
Device(config)# snmp-server community public
Device(config)# snmp-server enable traps isdn
Device(config)# snmp-server host 172.16.1.27 version 2c public
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 allow read-only access for all objects to members of access list 4 that specify the comaccess
community string. No other SNMP managers have access to any objects. SNMP Authentication Failure traps are sent by SNMPv2c
to the host example.com using the community string named public.
Device(config)# snmp-server community comaccess ro 4
Device(config)# snmp-server enable traps snmp authentication
Device(config)# snmp-server host example.com version 2c public
The following example shows how to configure a remote user to receive traps at the noAuthNoPriv security level when the SNMPv3
security model is enabled:
Device(config)# snmp-server group group1 v3 noauth
Device(config)# snmp-server user remoteuser1 group1 remote 10.12.8.4
Device(config)# snmp-server host 10.12.8.4 informs version 3 noauth remoteuser config
The following example shows how to configure a remote user to receive traps at the authNoPriv security level when the SNMPv3
security model is enabled:
Device(config)# snmp-server group group2 v3 auth
Device(config)# snmp-server user AuthUser group2 remote 10.12.8.4 v3 auth md5 password1
The following example shows how to configure a remote user to receive traps at the priv security level when the SNMPv3 security
model is enabled:
Device(config)# snmp-server group group3 v3 priv
Device(config)# snmp-server user PrivateUser group3 remote 10.12.8.4 v3 auth md5 password1 priv access des56
The following example shows how to send Entity MIB inform notifications to the host example.com. The community string is
restricted. The first line enables the device to send Entity MIB notifications in addition to any traps or informs previously
enabled. The second line specifies that the notifications should be sent as informs, specifies the destination of these informs,
and overwrites the previous
snmp-server
host commands for the host example.com.
Device(config)# snmp-server enable traps entity
Device(config)# snmp-server host informs example.com restricted entity
The following example shows how to send SNMP and Cisco environmental monitor enterprise-specific traps to the 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 device 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 ISDN traps are enabled to be sent to a host.
Device(config)# snmp-server enable traps bgp
Device(config)# snmp-server host host1 public isdn
The following example shows how to enable a device 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
In the following example, the SNMP manager is enabled and the session timeout is set to a value greater than the default:
Device(config)# snmp-server manager
Device(config)# snmp-server manager session-timeout 1000