In scripting mode, you can copy and paste
commands from a text file directly into the CLI. This is a quick
and easy way to copy several configuration settings from one Palo
Alto Networks device to another.
On the device from which you want to copy configuration
commands, set the CLI output mode to set:
set cli config-output-format set
Show the part of the configuration you want to copy.
For example, to copy the SNMP configuration you would enter the
show deviceconfig system snmp-setting
set deviceconfig system snmp-setting snmp-system location Headquarters
set deviceconfig system snmp-setting snmp-system contact firstname.lastname@example.org
set deviceconfig system snmp-setting access-setting version v2c snmp-community-string public
When pasting commands into the command line,
make sure you are entering them in the proper order to avoid errors.
Sometimes commands shown in the CLI are not the order in which they
must be configured on the device (for example, if you are pasting
a configuration from a firewall into Panorama). If you see errors,
check whether the command that generated the error is dependent
on a later command. In these cases, you can usually just reenter
the command. Also make sure you are pasting sections of a configuration
in a logical order. For example, you should not copy security policy
rules if you have not yet configured the objects the rules rely
on, such as zones, security profiles, or address groups.
Copy the commands to a text editor such as Notepad and
edit the settings as desired.
On the second device, paste the commands into the command
There is a limit to the amount of text that can be
copied into the SSH buffer (approximately 20 lines). If you cut-and-paste
a large block of text into the CLI, examine the output of the lines
you pasted. If you see lines that are truncated or generate errors,
you may have to re-paste a smaller section of text, or switch to scripting
mode using the
set cli scripting-mode on
mode command, which increases the buffer significantly.