I have a situation on my PAN where I need to replace all instances of a given IP address (it's a "Next Hop" address in the virtual router) with a different IP address.
Through the GUI, I can only delete and re-enter all the access routes - time consuming, given there are about 35 of them concernedf with this change.
Is there a command from the CLI will is the equivalent of Juniper's "replace" command which allows you to do a search/replace for all given instances of a string int he current running configuration?
I've searched the CLI guide but can't seem to find anything obvious.
Failing that, is tehre a way via the GUI to edit/replace all instances of a next-hop address other than deleting each access-route and re-entering it?
The following works for me in PAN-OS 4.0.2
# change the output format of the CLI
set cli config-output-format set
# change to configure mode
# display the current routing table
show network virtual-router default routing-table ip static-route
set network virtual-router default routing-table ip static-route network-192 destination 192.168.222.0/24
set network virtual-router default routing-table ip static-route network-192 nexthop ip-address 184.108.40.206
# copy the output to a text editor and replace the IP
# paste the 'nexthop' lines into CLIset network virtual-router default routing-table ip static-route network-192 nexthop ip-address 220.127.116.11
# confirm the result before commiting
To do a mass replace you could export the config file from the device tab, open the file in any text editor, replace all instances you want to replace and reimport the file back onto the device .
Yeah, I was hoping to avoid doing that. 🙂
The "replace" keyword is one of JunOS's most useful CLI editing features, and since PanOS appears to be at least based on JunOS I was hoping it'd have something similar in CLI.
Guess I'll do it the hard way.
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!