Palo Alto PAN-OS commands

Everyday PAN-OS CLI commands for Palo Alto Networks firewalls and Panorama, checked against Palo Alto's PAN-OS CLI Quick Start for PAN-OS 11.1 and later and its PAN-OS 11.1 command hierarchy. The CLI opens in operational mode; configure enters configuration mode, where changes stay in the candidate configuration until commit. Capitals stand for your own values, and ? lists the options at any point. Niche topics such as LSVPN, lockless QoS and CTD decoding are left out.

152 commands in 15 sections. Checked row by row against Palo Alto Networks on . Edited by Jay.

Modes and help 15

show commands work in configuration mode as well; any other operational command needs run in front of it there.

CommandWhat it does
configureEnter configuration modeThe prompt changes from > to #; every login starts in operational mode.
exitReturn to operational modequit does exactly the same, and the prompt switches back to >.
run COMMANDRun an operational commandKeeps you at the # prompt, as in run ping host 10.1.1.2.
find commandList every available commandWithout parameters it prints the full hierarchy for whichever mode you are in.
find command keyword KEYWORDSearch commands by keywordReturns every command whose syntax contains the word, such as username.
?Show syntax helpType it after part of a command to list the options, values and nested commands at that point.
TabComplete a commandCompletion is switched off while scripting mode is on, and so is ? help.
COMMAND | match VALUEFilter output by a valuePrints only matching lines, for example show system info | match app-version.
COMMAND | except VALUEHide lines with a valueShows everything else, as in show user group list | except ou=acme.
set cli scripting-mode onTurn on scripting modeLets long blocks of pasted commands through; Tab completion and ? help stay off meanwhile.
set cli scripting-mode offTurn off scripting modeBrings back Tab completion and ? help once pasting is done.
set cli config-output-format setShow configuration as set commandsMakes a section of configuration easy to copy and paste into another device's CLI.
set cli pager offTurn the CLI pager off
set system setting target-vsys VSYS-NAMESwitch to one virtual systemThe prompt then shows the vsys name, which is case sensitive.
set system setting target-vsys noneLeave the vsys contextAfterwards commands act on the firewall as a whole rather than on one vsys.

Editing the configuration 8

When pasting set commands from another device, configure objects such as zones, security profiles and address groups before the rules that refer to them.

CommandWhat it does
edit deviceconfig system ntp-serversMove into the NTP servers nodeThe prompt shows the new location, and set commands there need only the remaining path.
upGo up one level
topJump to the hierarchy top
delete deviceconfig system ntp-servers secondary-ntp-server ntp-server-addressDelete the secondary NTP serverUnlike the web interface, the CLI does not check whether a deleted object is still referenced.
show config runningShow the running configurationPiping it through | match finds every place an object is used before you delete it.
show config candidateShow the candidate configuration
show config diffShow configuration differences
check pending-changesCheck pending changes

Committing changes 8

CommandWhat it does
commitCommit all changesConfiguration commands take effect only after this, since they edit the proposed configuration.
commit partial device-and-network excludedCommit only policy and objectsSuits a change to Security policy alone, leaving device and network edits uncommitted.
commit partial admin jsmith vsys vsys1 device-and-network excludedCommit one administrator's changesThis example commits only what jsmith changed in vsys1 and in shared objects.
validate fullValidate the configurationOptional but recommended before a commit; it runs as a job whose result show jobs id displays.
show jobs id JOB-IDShow one job's detailsAlso works for validate jobs, listing their result and warnings such as application dependencies.
show jobs allList all jobsIncludes queue positions and job IDs for pending, running, finished and failed commits.
show jobs processedList completed jobsCovers finished commits, downloads and upgrades.
Ctrl+CFree the prompt during a commitThe commit keeps running in the background while you type other commands.

Initial setup 20

These are starting points in the configuration hierarchy. On a firewall with multiple virtual systems, vsys-specific settings go under set vsys NAME and shared ones under set shared.

CommandWhat it does
set deviceconfig system ip-addressSet the MGT interfaceTakes the address in IP/netmask form; netmask and default-gateway are separate settings beside it.
set mgt-config users admin passwordSet the admin password
set deviceconfig system dns-setting serversSet the DNS serversTakes a primary and a secondary server address.
set deviceconfig system ntp-serversSet the NTP serversHolds primary-ntp-server and secondary-ntp-server, each with its own ntp-server-address.
set deviceconfig system hostname HOSTNAMESet the hostname
set deviceconfig systemConfigure system settingsHostname, management address, DNS, NTP and SSH options all live under this node.
set network interfaceConfigure interfacesEthernet, aggregate-ethernet, loopback, tunnel and VLAN interfaces are all defined below it.
set zone NAMEConfigure a zoneThe general location; firewalls with multiple virtual systems use the vsys form instead.
set vsys NAME zone NAMEConfigure a zone in one vsys
set rulebaseConfigure policy rulesSecurity and NAT rules sit below it; a multi-vsys firewall uses set vsys vsys1 rulebase.
set profilesConfigure security profilesCovers security profiles plus HIP objects and profiles, URL Filtering and WildFire Analysis profiles.
set shared server-profileConfigure shared server profiles
set shared authentication-profileConfigure authentication profiles
set shared certificate-profileConfigure certificate profiles
set user-id-collectorConfigure User-ID collection
set deviceconfig high-availabilityConfigure high availabilityIts enabled option takes yes or no, while group and interface hold the HA settings.
set deviceconfig setting management quota-settingsSet log quotas
set deviceconfig setting autofocusConfigure AutoFocus
set deviceconfig setting wildfireConfigure WildFire settings
set deviceconfig system panorama-serverPoint the firewall to PanoramaThe PAN-OS 11.1 firewall hierarchy places this under panorama local-panorama panorama-server.

System information 8

CommandWhat it does
show system infoShow system informationLists hostname, management IP, model, serial number, PAN-OS version and content versions.
show system disk-space filesShow disk partition usageThe files option adds inode counts, which track file storage.
show system resourcesShow management-plane resourcesCovers the management plane only; show running resource-monitor reports on the dataplane.
show running resource-monitorShow dataplane resource use
show system software statusShow software process status
show system logdb-quotaShow log database quota
request license infoShow installed licenses
show ntpShow NTP status

Sessions and policy tests 12

CommandWhat it does
show session infoShow session statisticsReports session counts, table utilization, packet rate, throughput and session timeouts.
show session id SESSION-IDShow one session in detail
show session allList all sessionsAccepts filters such as source, destination, application and rule to narrow the list.
show session meterShow vsys session limitsGives maximum, current and throttled session counts for each virtual system.
show running security-policyShow running security policy
test security-policy-match application APPLICATION source-user USER destination DESTINATION destination-port PORT source SOURCE protocol PROTOCOLTest a Security rule matchPrints the rule the described traffic would match, with its full definition and action.
test authentication-policy-match from trust to untrust source SOURCE destination DESTINATIONTest an Authentication rule matchShows the matched rule and its action, such as web-form.
test decryption-policy-match category CATEGORY from trust source SOURCE destination DESTINATIONTest a Decryption rule matchChecks whether traffic to a URL category would be decrypted under your rules.
test nat-policy-matchTest a NAT rule match
show running nat-policyShow the NAT policy
show running ippoolShow NAT pool usage
show counter globalShow global countersNarrow it with | match, for example | match bfd for BFD packet counters.

Interfaces and routing 12

CommandWhat it does
show interface allShow all interfacesName one interface instead, or ask for management, hardware or logical interfaces only.
show mac allShow the MAC table
show routing routeShow the routing tableFirewalls that use Advanced Routing have show advanced-routing route instead.
show routing fib virtual-router NAMEShow forwarding entriesAdd | match with a prefix to see the route chosen for one destination.
show advanced-routing routeShow the Advanced Routing RIBOptions such as afi, destination and logical-router narrow the listing.
show advanced-routing fibShow the Advanced Routing FIB
show advanced-routing bgp summary logical-router LOGICAL-ROUTER-NAMEShow a BGP summary
show system setting arp-cache-timeoutShow the ARP cache timeout
set system setting arp-cache-timeout SECONDSSet the ARP cache timeoutAccepts 60 to 65536 seconds in place of the default 1800.
ping host IP-ADDRESSPing from the MGT interfaceAdd source with a dataplane address to send the pings from a traffic interface.
ping source IP-ADDRESS host IP-ADDRESSPing using a dataplane sourceThe source must be an IP address configured on a dataplane interface.
show netstat statistics yesShow network statistics

IPSec VPN 5

CommandWhat it does
show vpn flowShow IPSec counters
show vpn gatewayList IPSec gateways
show vpn ike-saList phase 1 IKE SAs
show vpn ipsec-saList phase 2 IPSec SAs
show vpn tunnelList auto-key tunnels

User-ID 15

CommandWhat it does
show user user-id-agent state allShow Windows User-ID agents
show user server-monitor state allCheck the integrated User-ID agent
show user server-monitor statisticsShow syslog mapping statisticsCounts log messages received from syslog senders and the entries mapped from them.
show user user-id-agent config name AGENT-NAMEShow an agent's configuration
show user group-mapping state allShow group mapping state
show user group-mapping statisticsShow group mapping statistics
show user group listList mapped groups
show user group name GROUP-NAMEShow one group's mapping
show user ip-user-mapping allShow all user mappingsPipe it through | match with a username; a domain prefix needs two backslashes before the user.
show user ip-user-mapping ip IP-ADDRESSShow the mapping for one IP
show user user-idsShow known usernames
show log userid datasourcename equal AGENT-NAME direction equal backwardShow recent mappings from an agent
show log userid datasourcetype equal kerberosShow Kerberos-learned mappingsSwap kerberos for another service type such as globalprotect, ntlm or client-cert.
clear user-cache allFlush all User-ID mappings
clear user-cache ip IP-ADDRESS/NETMASKClear mappings for an address

High availability 11

CommandWhat it does
show high-availability stateShow HA state
show high-availability allShow all HA details
request high-availability state suspendSuspend this HA peer
request high-availability state functionalMake this HA peer functional
request high-availability sync-to-remote running-configSync running config to the peer
show high-availability cluster stateShow HA cluster state
show high-availability cluster allShow HA cluster configuration
show high-availability cluster statisticsShow HA cluster statisticsIncludes received-message counts and dropped packets broken down by reason.
clear high-availability cluster statisticsReset HA cluster statistics
show high-availability cluster flap-statisticsShow HA cluster flap countsThe count resets when a device moves between suspended and functional, or when the non-functional hold time expires.
request high-availability cluster sync-fromResync the session cache

Logs 6

CommandWhat it does
show log trafficShow traffic logsFilters such as direction equal, csv-output equal and query equal follow the log type.
show log threatShow threat logs
show log systemShow system logs
show log configShow configuration logs
less mp-log authd.logRead the authentication log
show logging-statusShow log forwarding statusOn a firewall it also counts the logs forwarded; on Panorama add device and a serial number.

Panorama 11

CommandWhat it does
show system info | match system-modeShow the appliance mode
request system system-mode loggerSwitch to Log Collector modeReboots the M-Series appliance and wipes logs and all settings except management access.
request system system-mode panoramaSwitch to Panorama modeAlso moves a Panorama virtual appliance out of Legacy mode.
set panorama offDisconnect from PanoramaEntered on the firewall CLI; set panorama on restores the connection.
set panorama onReconnect to Panorama
show devicegroups name DEVICE-GROUP-NAMEShow device group statusGives commit history and Panorama connection status for each firewall in the group.
show templates name TEMPLATE-NAMEShow template statusThe template counterpart, with commit history and connection state per firewall.
show config pushed-shared-policyShow policy pushed by PanoramaRun it on the firewall to see the rules and objects Panorama has sent.
show config pushed-templateShow settings pushed by templatesAlso a firewall-side command, listing pushed network and device settings.
request batch reboot devices SERIAL-NUMBERReboot managed firewallsUse log-collectors in place of devices to reboot Dedicated Log Collectors.
debug log-collector log-collection-stats show incoming-logsShow the incoming log rate

Management access 7

CommandWhat it does
show adminsShow logged-in administratorsCovers sessions in the web interface, the CLI and the API.
show admins allShow all administrator accountsIncludes local, remote and Panorama-pushed admins, logged in or not.
set deviceconfig setting management idle-timeout VALUESet the admin idle timeoutApplies to web interface and CLI sessions alike; 0 means never, otherwise 1 to 1440.
test authentication authentication-profile PROFILE username USERNAME passwordTest an authentication profilePrompts for the password, then traces each step of the request to the authentication server.
show ssh-fingerprints format hex hash-type md5Show SSH host key fingerprintsPick the format and hash type your SSH client uses; md5 is not available in FIPS-CC mode.
set deviceconfig system ssh regenerate-hostkeys mgmt key-type ECDSA key-length 256Regenerate the SSH host keyName the default key type in use; regenerating any other type has no effect.
set ssh service-restart mgmtRestart SSH on the management portRun it in operational mode after committing SSH profile or host key changes.

Backups and file transfer 6

The Panorama virtual appliance (Panorama 6.0 and later), M-Series appliances and PA-7000 Series firewalls do not support scp export logdb or scp import logdb, because their log databases are too large.

CommandWhat it does
save config to FILENAMESave a configuration snapshotRuns in configuration mode and creates a named file that scp export configuration can copy off the device.
scp export configuration from FILE to USERNAME@HOST:PATHExport a saved configurationAsks for the SCP server password; a Windows server path needs a drive letter and colon.
scp import configuration from USERNAME@HOST:PATHImport a saved configurationRun on the receiving firewall, then load what you need from the imported file.
scp export logdb to USERNAME@HOST:PATHExport the log databasePrompts for the SCP account password; on a Windows server begin the path with a drive letter.
scp import logdb from USERNAME@HOST:PATHImport a log databaseRun it on the firewall that should receive the logs, again with the SCP password.
load config partial mode merge from-xpath SOURCE-XPATH to-xpath DESTINATION-XPATH from FILENAMELoad part of a configurationXPath formats differ for multi-vsys, single-vsys and Panorama; append and replace are the other modes.

Software and maintenance 8

CommandWhat it does
request system software checkCheck for PAN-OS updates
request system software infoShow PAN-OS software info
request system software download version VERSIONDownload a PAN-OS version
request system software install version VERSIONInstall a PAN-OS version
request content upgrade checkCheck for content updates
request content upgrade download latestDownload the latest content
request content upgrade install version latestInstall the latest content
request restart systemRestart the deviceAn operational-mode command, so give it at the > prompt rather than in configuration mode.

Questions

How do I switch between operational and configuration mode?

Type configure at the > prompt and the prompt changes to #. exit or quit takes you back. Inside configuration mode, run COMMAND runs an operational command without leaving, and show commands work in both modes.

Do these commands take effect immediately?

Operational commands such as request restart system run at once. Configuration commands such as set, edit and delete only change the candidate configuration: check it with validate full, then apply it with commit, or with commit partial device-and-network excluded to apply policy and objects alone.

How do I find a command when I only know part of it?

find command keyword KEYWORD lists every command that contains the word, and find command on its own prints the whole hierarchy of the current mode. Typing ? after a partial command shows the options at that level, and Tab completes what you have started.

Why are some pasted configuration lines cut off?

Without scripting mode the SSH buffer takes only about 20 pasted lines. set cli scripting-mode on enlarges it considerably; Tab completion and ? help stay unavailable until set cli scripting-mode off.

How do I copy configuration from one firewall to another?

For a section, run set cli config-output-format set, show that part of the configuration and paste the resulting set lines on the second device, objects before the rules that use them. For a whole snapshot, run save config to FILENAME, export it with scp export configuration from FILE to USERNAME@HOST:PATH, import it on the other firewall and load the part you need with load config partial.

Which PAN-OS version do these commands come from?

From the PAN-OS CLI Quick Start for PAN-OS 11.1 and later and its PAN-OS 11.1 command hierarchy. The guide is not fully consistent: its Jump Start gives set deviceconfig system panorama-server, while the 11.1 firewall hierarchy nests that setting under panorama local-panorama, and the Panorama cheat sheet writes config-output-mode where the hierarchy has only set cli config-output-format set.

Sources and checks

7 more source pages

Every row on this page was matched to a line in the documentation above on . A binding that could not be found there is not listed.

Found a wrong or missing key? Tell us and it gets checked against the source. How we verify describes the process and its limits.