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 where the next hop is at
A gNMI set call to the firewall:
gnmic -a -u username -p password --skip-verify -e JSON_IETF set --update /local-routes/static-routes/static[prefix=]/next-hops/next-hop[index=14598]/next-hop:::string::: --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=]/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 -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":"", "set-tag":"" }, "next-hops":{ "next-hop":[ { "config":{ "index":"14598", "metric":10, "next-hop":"", "recurse":true }, "index":"14598", "state":{ "index":"14598", "metric":10, "next-hop":"", "recurse":true } } ] }, "prefix":"", "state":{ "description":"", "prefix":"", "set-tag":"" } } ] } }

Recommended For You