snmp context-name
Use snmp context-name to configure an SNMP context for a VPN instance.
Use undo snmp context-name to restore the default.
Syntax
snmp context-name context-name
undo snmp context-name
Default
No SNMP context is configured for a VPN instance.
Views
VPN instance view
Predefined user roles
network-admin
Parameters
context-name: Specifies an SNMP context, a case-sensitive string of 1 to 32 characters.
Usage guidelines
VPN-aware features such as AAA and NAT do not know the VPN instance to which a managed MIB node belongs. To resolve this issue, configure different SNMP contexts for different VPN instances.
The device selects a MIB for an SNMP packet according to the context (for SNMPv3) or community name (for SNMPv1/v2c) in the following ways:
For an SNMPv3 packet:
The device selects the public MIB if the packet does not carry a context.
The device selects the MIB of a VPN instance if the packet meets the following conditions:
Carries a context that was configured with the snmp-agent context command in system view.
Matches the context of the VPN instance.
The device does not process any MIBs in other situations.
For an SNMPv1/v2c packet:
The device selects the public MIB if no SNMP community to SNMP context mapping was configured with the snmp-agent community-map command in system view.
The device selects the MIB of a VPN instance if the SNMP community is mapped to an SNMP context and the context matches the context of the VPN instance.
The device does not process any MIBs in other situations.
For more information about SNMP context and community name, see Network Management and Monitoring Configuration Guide.
Do not configure the same SNMP context for different VPN instances.
If you execute this command multiple times, the most recent configuration takes effect.
Examples
# Configure SNMP context vpna for VPN instance vpna.
<Sysname> system-view [Sysname] snmp-agent context vpna [Sysname] ip vpn-instance vpna [Sysname-vpn-instance-vpna] route-distinguisher 22:33 [Sysname-vpn-instance-vpna] snmp context-name vpna
Related commands
snmp-agent community-map (Network Management and Monitoring Command Reference)
snmp-agent context (Network Management and Monitoring Command Reference)