DOTW: Import IP Addresses In Bulk To Your Firewall Using CLI

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Community Team Member

 

jforsythe_0-1640181387986.png

 

What would you do if you were asked to add 1,000 IP address objects to your firewall using the CLI? Will you add them line by line typing each line out? Ain't nobody got time for that! Instead, be smart about it and with some preparation you can add configuration in bulk to your firewall.

 

This week, I saw a question in the discussions area that I've definitely seen before. This particular user wanted to know how he could add IP addresses in bulk onto the device using the CLI. I've seen similar questions in the past of users asking how they can add a large chunk of configuration (not limited to IP address objects) onto the firewall using the CLI.

 

Before you start, I'd recommend getting a good text editor. Some editors may add weird formatting that could cause issues when adding the configuration to the firewall, so you might have to experiment to find one that doesn't do that. The goal is to remove all the weird formatting that may have been added by the editor and keep a clean line-by-line configuration. This is required for the copy/paste to work as intended.

 

In scripting mode, you can copy and paste commands from a text file directly into the CLI. You can also do this without scripting-mode enabled but then you'll be buffered after about 20 lines:

 
username@hostname# set cli scripting-mode on
<paste all the lines from your notepad here>
username@hostname# set cli scripting-mode off

 

Note: When in scripting-mode, it's not possible to use "Tab" to auto-complete commands or use the "?" to get help on command syntax. Don't forget to switch back to regular mode when you're done pasting your commands as shown in the example above.

 

Additional information:

How to Import and Export Address and Address Objects 

Customize the CLI 

 

Similar discussions on the topic:

How to Import Address Objects in CSV to PA Firewall 

Increase Paste Buffer on PAN (or other import methods) 

Bulk Upload of Set Commands in PAN-OS 

Palo Alto CLI Scripting Mode Limitation 

 

Feel free to share your questions, comments and ideas in the section below.

 

Thank you for taking time to read this blog.

Don't forget to hit the Like (thumbs up) button and to Subscribe to the LIVEcommunity Blog area.

 

Kiwi out!

 
1 Comment
  • 5512 Views
  • 1 comments
  • 1 Likes
Register or Sign-in
Labels