How do I enumerate the VRFs on a device?

Document created by cdnadmin on Jan 25, 2014
Version 1Show Document
  • View in full screen mode
This document was generated from CDN thread

Created by: Brett Kugler on 27-09-2013 10:27:02 AM
I'm using the Java SDK v1.0 currently and am trying to figure out how to extract from the device the list of VRFs configured.  Since the VRF is a parameter in the L3UnicastScope used to get RIB table information, I would like to be able to query by each VRF configured in the device, but I can't seem to find a way to get that information from the API.

Thank you in advance for any guidance in this matter.

Subject: RE: How do I enumerate the VRFs on a device?
Replied by: Joseph Clarke on 27-09-2013 10:38:46 AM
You can iterate over all interfaces on the device and call getVRFName().  That will give you all VRFs bound to interfaces and thus could be routable.

Subject: RE: How do I enumerate the VRFs on a device?
Replied by: Brett Kugler on 27-09-2013 10:53:15 AM
Joseph Clarke:
You can iterate over all interfaces on the device and call getVRFName().  That will give you all VRFs bound to interfaces and thus could be routable.


That did the trick.  I didn't think of trying to go through the interfaces.  Thanks!

Subject: RE: How do I enumerate the VRFs on a device?
Replied by: Joseph Clarke on 01-10-2013 11:25:20 AM
It appears to be a limitation in the scope of the API.  I haven't heard of plans to add such an API, but I filed an enhancement request: CSCuj56621 asking for it.  Can you let me know which customer/partner you represent?

Subject: RE: How do I enumerate the VRFs on a device?
Replied by: Brett Kugler on 01-10-2013 11:01:16 AM
As a follow up question, my understanding is that when first creating a VRF via the CLI, it will exist in the devices' global space and only after formation can it be assigned to an interface.  There are instances where you might not even want to attach a VRF to an interface, especially in an orchestration type environment, there may be use cases where this would be beneficial.

Is the current restriction of limiting VRF enumeration to interfaces just a deficiency of the current onePK library?  Is there going to be more robust support for VRF features in later revisions of the SDK?

Subject: RE: How do I enumerate the VRFs on a device?
Replied by: Brett Kugler on 01-10-2013 11:36:57 AM
Thanks Joseph - I'm with Cisco partner General DataTech (GDT) in Dallas, TX.

Attachments

    Outcomes