Update a Virtual Router (REST API)
Table of Contents
Expand all | Collapse all
-
- Upgrade a Firewall to the Latest PAN-OS Version (API)
- Show and Manage GlobalProtect Users (API)
- Query a Firewall from Panorama (API)
- Upgrade PAN-OS on Multiple HA Firewalls through Panorama (API)
- Automatically Check for and Install Content Updates (API)
- Enforce Policy using External Dynamic Lists and AutoFocus Artifacts (API)
- Configure SAML 2.0 Authentication (API)
- Quarantine Compromised Devices (API)
- Manage Certificates (API)
-
- Asynchronous and Synchronous Requests to the PAN-OS XML API
- Run Operational Mode Commands (API)
- Apply User-ID Mapping and Populate Dynamic Groups (API)
- Get Version Info (API)
-
- PAN-OS REST API
- Access the PAN-OS REST API
- Resource Methods and Query Parameters (REST API)
- PAN-OS REST API Request and Response Structure
- PAN-OS REST API Error Codes
- Work With Objects (REST API)
- Create a Security Policy Rule (REST API)
- Work with Policy Rules on Panorama (REST API)
- Create a Tag (REST API)
- Configure a Security Zone (REST API)
- Configure an SD-WAN Interface (REST API)
- Create an SD-WAN Policy Pre Rule (REST API)
- Configure an Ethernet Interface (REST API)
- Update a Virtual Router (REST API)
- Work With Decryption (APIs)
Update a Virtual Router (REST API)
REST API requests for a virtual router
A virtual router allows the firewall to route
traffic from one network to another through its Layer 3 interfaces
or static routes. Each Layer 3 interface, loopback interface, and
VLAN interface defined on the firewall must be associated with a
virtual router. Each interface can belong to only one virtual router.
The
following steps show how to add an existing Ethernet interface to
the predefined virtual router,default.
- Retrieve the existing virtual router named default.Before you update an existing virtual router by adding a new interface, you should retrieve the virtual router to identify interfaces that are already assigned to that virtual router.curl -X GET 'https://<firewall>/restapi/v11.0/Network/VirtualRouters' --header 'X-PAN-KEY: <api-key>’A successful response returns a list of existing virtual routers and includes detailed information for each one. The response object for this request is large, so the example response below shows a partial response object. You can see the list of existing interfaces, which will be necessary to include as request body parameters if you are updating the interface list in the virtual router. If the router were to include other configuration items such as protocol information or routes, you would need to include these in the update as well.{ "@status": "success", "@code": "19", "result": { "@count": "1", "entry": [ { "@name": "default", "@location": "panorama-pushed", "interface": { "member": [ "ethernet1/4" ], "routing-table": {}, "protocol": {}, "admin-dists": {}, "ecmp": {} } } ] } }
- Update the existing virtual router nameddefault.
Update the virtual router default with a new L3 Ethernet interface,ethernet1/3, through a PUT request. Include all information that currently exist as well as any new information in the default Virtual Router in your PUT request.curl --location --request PUT 'https://<firewall>/restapi/v11.0/Network/VirtualRouters?name=default' --header 'X-PAN-Key:<api-key> --data '{ "entry": { "@name": "default", "interface": { "member": [ "ethernet1/3", "ethernet1/4" ] } } }' - Update the existing virtual router nameddefault.