Python Script Automates FortiGate Static Route Creation via REST API
Network engineers can automate static route provisioning on FortiGate firewalls using Python and the FortiOS REST API, eliminating manual GUI configuration. Authentication requires a Bearer token generated by creating a REST API admin account under System > Administrators. A key requirement is that the destination subnet must be submitted in space-separated netmask format rather than CIDR notation, as the API follows the underlying CMDB schema. The POST request targets the endpoint /api/v2/cmdb/router/static and returns an mkey value upon success, which is needed for any subsequent update or delete operations. The approach has been tested on FortiOS versions 7.x through 8.0 on a FortiGate-60F in a lab environment.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in