Manage Local Routes
Table of Contents
Expand all | Collapse all
Manage Local Routes
Examples of managing local routes with OpenConfig on
PAN-OS firewalls.
Set a Local Route
You can set
a local route in your routing table by sending this example call.
This call would set the local route for 13.13.13.0/24 where the
next hop is at 100.100.100.100.
A gNMI set call to the firewall:
gnmic -a 10.1.1.1:9339 -u username -p password --skip-verify -e JSON_IETF set --update /local-routes/static-routes/static[prefix=13.13.13.0/24]/next-hops/next-hop[index=14598]/next-hop:::string:::100.100.100.100 --timeout 300s
A successful update response returns: Set Response: { "timestamp": 1614407795067600530, "time": "2021-02-26T22:36:35.06760053-08:00", "results": [ { "operation": "UPDATE", "path": "local-routes/static-routes/static[prefix=13.13.13.0/24]/next-hops/next-hop[index=14598]/next-hop" } ]
Retrieve Local Routes
You can retrieve
a list of local routes using a gNMI call with this example call:
gnmic -a 10.1.1.1:9339 -u username -p password --skip-verify -e JSON_IETF get --path /local-routes --timeout 300s
The following
result confirms a successful get request:
{ "static-routes":{ "static":[ { "config":{ "description":"", "prefix":"13.13.13.0/24", "set-tag":"" }, "next-hops":{ "next-hop":[ { "config":{ "index":"14598", "metric":10, "next-hop":"100.100.100.100", "recurse":true }, "index":"14598", "state":{ "index":"14598", "metric":10, "next-hop":"100.100.100.100", "recurse":true } } ] }, "prefix":"99.99.99.99/32", "state":{ "description":"", "prefix":"13.13.13.0/24", "set-tag":"" } } ] } }