Description | This article describes how to poll FortiManager API for reserved subnets for FortiSwitch VLANs. |
Scope | FortiManager. |
Solution |
FortiManager allows users to retrieve reserved subnets used by FortiSwitch VLANs via API. This information is not contained on FortiSwitch Manager, but on Device Manager, so FortiManager API will need to be polled for device-level config.
Attached is a sample Python script which will first loop through the list of FortiGate's available interfaces for ones with FortiLink enabled (as there may be cases where FortiSwitch devices are connected to a non-default FortiLink interface:
The script will then poll for the subnets of all VLANs associated with each FortiLink-enabled interface with the following function:
The following is the output of the script:
|
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.