A single SNMP agent can support multiple instances of the same MIB module by mapping the context name to a virtual routing and forwarding (VRF) instance created within the device. The SNMP context name is used to identify the VRF and fetch the MIB details of the mapped VRF from the underlying modules.
Note
For SNMPv3, use the snmp-server context command only. The SNMPv3 request PDU itself has the provision for the context name as input.Important
SNMP SET requests work only on the default VRF.device# configure terminal
device(config)# snmp-server community public groupname admin
device(config)# snmp-server context mycontext vrf myvrf
device(config)# snmp-server mib community-map public context mycontext
device# show running-config snmp-server ... snmp-server community public groupname admin snmp-server context mycontext vrf myvrf ... snmp-server mib community-map public context mycontext
The following example shows the previous steps for the configuration.
device# configure terminal device(config)# snmp-server community public groupname admin device(config)# snmp-server context mycontext vrf myvrf device(config)# snmp-server mib community-map public context mycontext