Configuring an SNMP server context to a VRF

To configure an SNMP server context to a VRF for SNMPv1 or SNMPv2, perform the following steps.
Note

Note

For SNMPv3, use the snmp-server context command only. The SNMPv3 request PDU itself has the provision for the context name as input.
  1. In privileged EXEC mode, enter global configuration mode.
    device# configure terminal
  2. Map the context with the community.
    device(config)# snmp-server community public groupname admin
  3. Create a context and map it with a VRF.
    device(config)# snmp-server context mycontext vrf myvrf
  4. Map the community to the context.
    device(config)# snmp-server mib community-map public context mycontext
  5. Verify the configuration.
    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

Example

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