cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
96
Views
1
Helpful
3
Replies

How to perform snmpwalk on multiple VRFs?

harisrocks
Level 1
Level 1

Hi everyone,
I am a fairly new network guy looking to make snmpwalk (SNMPv2) work on multiple VRFs in my internal lab topology as shown below:

harisrocks_0-1737478332182.pngharisrocks_1-1737478340847.png

On the RT-COMMON (Cisco IOS XE Software, Version 17.11.01a), I have configured snmp contexts (devContext & salesContext) with different communities (devPublic & salesPublic) and mapped to each VRF.
There is also a default community public which is unmapped.

Config snapshot:
-------------------------------
ip vrf DEV
snmp context devContext
!
ip vrf SALES
snmp context salesContext
!
snmp-server community public RO
snmp-server community devPublic RO
snmp-server community salesPublic RO
snmp-server context devContext
snmp-server context salesContext
snmp mib community-map devPublic context devContext
snmp mib community-map salesPublic context salesContext
!
-------------------------------

I verified that the default command worked fine from my server 10.246.84.7: snmpwalk -v 2c -c public 172.16.1.1

But how to access VRF DEV and SALES via snmpwalk command from my server 10.246.84.7?
I tried below command but it does not work
snmpwalk -v 2c -c <VRF_community>@< VRF_name> 172.16.1.1

PS: The ping works fine within each VRF and the server 10.246.84.7 is able to reach the default routes of the topology.
This is related to Cisco IOS XE Software, Version 17.11.01a.

Thanks in advance.

3 Replies 3

smilstea
Cisco Employee
Cisco Employee
You are correct that you need to use a context for different VRFs, but contexts are specific to SNMPv3.

Thanks,
Sam

Ok, let me try with SNMPv3. But what is the correct snmpwalk command, in case the one I used is incorrect?

Here is an example from IOS XR of the config and how to send an snmpwalk.
https://packetpushers.net/blog/monitoring-vrfs-on-ios-xr/

Thanks,
Sam