- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
05-02-2011 08:40 PM
Hi.
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?
Thanks
05-03-2011 12:23 AM
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 .
05-03-2011 06:20 AM
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
configure
# 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 1.1.1.1
[edit]
# 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 1.1.1.2
# confirm the result before commiting
Thanks
Ulli
05-03-2011 03:14 PM
tpiens wrote:
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.
Thanks.
05-03-2011 03:16 PM
ulli.volk wrote:
The following works for me in PAN-OS 4.0.2
Sorry, my bad - I didn't specify OS version. I haven't upgraded to the 4.x stream yet - running 3.1.8.
Thanks anyway.
05-06-2011 05:58 PM
Just tried it on my test box running 3.1.7, seems to works as well.
Thanks
Ulli
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!