CLI - invalid syntax errors when pasting in config

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CLI - invalid syntax errors when pasting in config

L1 Bithead

Good evening

 

I often have to configure a hundred new address objects at a time and then add them to an address group.

 

I prepare the config by using Excel to combine columns with different values until I have the string of txt that I can paste into the CLI to add these objects to the PA.

 

 

Here is an example of some of the lines of code I end up with:

set vsys vsys11 address net_1.2.3.0 ip-netmask 1.2.3.0/24

set vsys vsys11 address net_2.2.3.0 ip-netmask 2.2.3.0/24

set vsys vsys11 address net_3.2.3.0 ip-netmask 3.2.3.0/24

 

Each line of code is formatted in the same way and I know this is the correct format for adding an address object.

 

However, when I copy and paste multiple lines of CLI code into the configure prompt - I get invalid syntax errors with some lines of code.

 

Sometimes the PA does not include the whole string or misses off the /24 netmask at the end so the PA throws an invalid syntax error.

 

If I paste each line of code in individually, I do not get any errors but I'm trying to save time here so want to be able to paste in 100+lines of code at once with confidence that there will not be any errrors.

 

 

I'm wondering if it is the text editor I'm using or perhaps my copy of Secure CRT doesn't seem to interpret the CLI copied from the clipboard properly.

 

Has anyone else ever come across this type of issue or can anyone give any advice on best practices when entering 100's of lines of code onto the CLI.

 

Any advice or feedback would be greatly appreciated.

 

1 accepted solution

Accepted Solutions

L4 Transporter
4 REPLIES 4

Cyber Elite
Cyber Elite

Hello,

While i havent tried to perform this on a PAN, I know in switches and routers when I do this i always have to double check since the paste operation isnt always perfect. This is with different vendors. I usually end up just copying smaller groups to get what I need accomplished. Perhaps the following links may help?

 

https://live.paloaltonetworks.com/t5/Configuration-Articles/How-to-Import-and-Export-Address-and-Add...

 

https://live.paloaltonetworks.com/t5/Documentation-Articles/Dynamic-Address-Objects/ta-p/61300

 

Hope this helps!

L4 Transporter

Thanks a lot!  Done the ACE but it doesn't mention this at all!

 

I love cli scripting-mode!

Thanks for the suggestion!

  • 1 accepted solution
  • 8785 Views
  • 4 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!