Manage Network Instances
Table of Contents
Expand all | Collapse all
Manage Network Instances
How to automate virtual router configuration on PAN-OS with openconfig models.
Adding an interface and creating a virtual router using the Network Instances Model
You can send
a request that adds ethernet1/5 to the openconfig-test virtual router:
gnmic -a localhost --port 9339 -u test -p test -e JSON_IETF --timeout 300s set --update "/network-instances/network-instance[name=openconfig-test2]/interfaces/interface[id=ethernet1/5]/id:::string:::ethernet1/5"
A
successful response returns:
{ "results": [ { "operation": "UPDATE", "path": "network-instances/network-instance[name=openconfig-test2]/interfaces/interface[id=ethernet1/5.1]/id" } ], "time": "2021-06-23T10:24:45.485769495-07:00", "timestamp": 1624469085485769495 }
The following command adds ethernet1/5 to the
virtual router using a JSON file.
gnmic -a localhost --port 9339 -u test -p test -e JSON_IETF --timeout 300s set --update-path "/" --update-file virtual-router.json
The
contents of virtual-router.json are as follows:
{ "network-instances": { "network-instance": [ { "config": { "name": "openconfig-test2" }, "interfaces": { "interface": [ { "config": { "id": "ethernet1/5.0" }, "id": "ethernet1/5.0" } ] }, "name": "openconfig-test2" } ] } }
A successful response returns:
{ "results": [ { "operation": "UPDATE" } ], "time": "2021-06-23T10:38:11.894585804-07:00", "timestamp": 1624469891894585804 }