02-19-2024 01:06 PM
Hello Everyone,
I have searched high and low, on Cisco.com, Google.com and developer.cisco.com for any python or DNA Center API that will list the VLANS associated with all switches across the enterprise. We are trying to see what VLANS are used where and on what switches those VLANS exist upon. I can definitely use Postman to query each switch independently, but that only scales on a switch-per-switch basis. I would like to see if anyone out there has had to query their enterprise for all VLANS (VlanId, Vlan Name and Switch IP address) and where they live?
So far the DNA API only gives me the names and the ID of all the VLANS, but not where those VLANS are seen across the enterprise or what switch the VLAN is assigned to.
Please advise if you have any examples or assistance in how i can quickly obtain the list of VLANS and where those VLANS are associated to within the enterprise.
Thank you,
JCD
02-19-2024 11:20 PM
Hi JCD,
Does the 'VLAN' report template for Network Devices provide you with the information you need?
02-19-2024 11:28 PM
Hello Dan,
Unfortunately, it does not. It only doesnt fully provide all the VLANS that are in use across the trunks. We discovered through some review and analysis that the report doesnt capture the VLANS that are not directly assigned as Native or Access VLANS. That is why I thought of going down the python path or the API path of DNAC. The DNAC API's don't provide the depth required either, that would provide the list of VLANS assigned to the switch and where the VLAN(s) are in use. We are trying to find the VLANS that are sporadically in use so that we can identify their usage assignment and maybe re-align the assignment with a different VLAN ID, thus eliminating the VLANS that are less globally used across the enterprise. This would aid us in getting a smaller VLAN footrprint prior to implementing Secure Group Tagging/trustsec, not to mention clean things up a bit.
Thank you,
Juan
02-20-2024 08:14 AM
Juan,
You can use the Command Runner Tool to accomplish this task:
Here is an example of getting the VLANs configured, but in can add multiple commands to accomplish your customized needs.
Example:
02-20-2024 10:14 AM
Tomas,
Thank you for the suggestion, let me give that a shot and let you all know if that solution suffices that outcomes we are looking for.
Thank you,
Juan D
02-21-2024 07:33 AM - edited 02-21-2024 07:33 AM
Tom,
I attempted the suggestion, but unfortunately the command runner doesnt allow "Select All" and has a maximum limit of 20 switches. This is not going to capture all the devices at once and would require several iterations of the execution and also would require us to concatenate of all the collections from those iterations. I am looking for a more automated scripting method if possible, but i do appreciate the suggestion and could work for other smaller tasks in the future.
Thank you,
Juan D
10-08-2024 06:49 AM
@jdomin01sa - Did you ever find a solution to this via DNA (Cisco Catalyst Center)?
10-08-2024 08:44 AM
10-08-2024 08:49 AM
Okay - I appreciate the reply. It would be a valuable capability.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide