Palo Alto (PAN-OS) cheatsheet

Doorzoekbare PAN-OS CLI-commandoreferentie: security policy, NAT, VPN en diagnose, met elke parameter uitgelegd.

Draait in je browser · er wordt niets verstuurdNieuw

28 commando’s

CLI basics

> (operational mode) configure # (configuration mode)PAN-OS has two CLI modes: operational mode (prompt ends in >) for show/test/request commands, and configuration mode (prompt ends in #, entered with "configure") for set/delete/edit commands that change the config.

Use "exit" to leave configuration mode back to operational mode. Changes made in configuration mode are only applied firewall-wide after "commit".

set <path> <value> delete <path>The two core configuration-mode verbs: "set" creates or updates a configuration node, "delete" removes one.

Unlike a strictly hierarchical "edit" style, most of the config can be set in a single flat command by spelling out the full path, as shown in the example.

Voorbeeld

set rulebase security rules allow-web from L3-Trust to L3-Untrust source any destination any application web-browsing service application-default action allow
edit <path>Move the configuration context into a specific branch of the config tree, so following commands can use a shorter relative path.

"exit" (inside configuration mode) moves back up one level in the config tree; it does not leave configuration mode entirely unless already at the top.

Voorbeeld

edit rulebase security rules allow-web
set action allow
exit
set cli config-output-format set configure showSwitch the CLI to display the configuration as a flat list of "set" commands (instead of nested XML-style output), then view it.

This "set" format is the easiest to read, copy and reapply elsewhere. "show <partial-path>" (for example "show rulebase security") limits the output to one branch.

Opties

set cli config-output-format xmlSwitch back to the default nested XML-style display.
commitValidate and apply the candidate configuration (every uncommitted set/delete since the last commit) to the running configuration.

A commit that fails validation is rejected entirely; nothing is partially applied. Use "commit force" only to override a stale-lock situation, not validation errors.

Opties

commit description "<text>"Attach a note to this commit, visible later in the config audit/history.
commit partial ...Commit only a subset of the configuration, for example a specific virtual system, in a multi-admin or multi-vsys environment.
<command> | match "<pattern>"Filter the output of any show/show-style command to lines containing a pattern.

Voorbeeld

show | match "rule1"

System

show system infoShow hostname, management IP, PAN-OS version, model and serial number.

The first command to run to identify an unfamiliar firewall, and what support will ask for first.

show system resourcesShow CPU, memory and process usage (a top-style view) for the management plane.

Covers the management plane only; dataplane CPU and session load are shown separately with "show running resource-monitor".

show session info show session all"show session info" gives session table counters and limits; "show session all" lists every active session (can be very long on a busy firewall).

Opties

show session all filter <field> <value>Restrict the session listing, for example "show session all filter destination 10.0.0.5".
request system software check request system software download version <version> request system software install version <version>Check available PAN-OS releases, download a specific version, and then install it.

A reboot ("request restart system") is required after installing a new PAN-OS version. On an HA pair, upgrade and reboot the passive/secondary unit first.

Let op: Installing a new PAN-OS version and rebooting interrupts traffic on a standalone firewall. On HA, confirm the pair is healthy with "show high-availability state" before upgrading either member.
request restart systemReboot the firewall.
Let op: All traffic through the firewall stops until it finishes booting.
request tech-support dumpGenerate a tech-support file bundling logs, configuration and system state for a Palo Alto support case.

The resulting file can be retrieved via the web UI (Device > Support) or SCP/TFTP for upload to a support case.

Network

show interface all show interface <name>Show the status (link state, IP, zone assignment) of all interfaces, or one specific interface.

An interface showing no zone here cannot pass traffic yet, even if it has a valid IP address.

set network interface ethernet <port> layer3 ip <ip>/<prefix> set zone <zone-name> network layer3 <port>Assign an IP address to a Layer 3 interface and put that interface into a security zone.

An interface with no zone assignment cannot pass traffic: zones, not interfaces, are what security policies match on.

Voorbeeld

set network interface ethernet1/3 layer3 ip 192.168.1.1/24
set zone L3-Trust network layer3 ethernet1/3
show routing routeShow the full routing table (static and dynamically learned routes).

On a firewall with multiple virtual routers, add "virtual-router <name>" to scope the output to one of them.

set network virtual-router default routing-table ip static-route <name> destination <network>/<prefix> nexthop ip-address <ip>Add a static route to a virtual router.

Voorbeeld

set network virtual-router default routing-table ip static-route default destination 0.0.0.0/0 nexthop ip-address 203.0.113.1
ping host <ip-or-host> traceroute host <ip-or-host>Run ping or traceroute from the firewall itself (operational mode).

Opties

ping source <ip> host <ip>Choose which local interface/IP the ping is sourced from.

Security policy

set rulebase security rules <name> from <zone> to <zone> source <addr> destination <addr> application <app> service <svc> action <allow|deny>Create or update a security policy rule, PAN-OS's equivalent of a firewall rule, in a single flat set command.

Voorbeeld

set rulebase security rules allow-web from L3-Trust to L3-Untrust source any destination any application web-browsing service application-default action allow

Opties

from / to <zone>Source and destination security zone(s) the rule applies to. Use "any" to match every zone.
source / destination <address-or-object>Source and destination address, address object or group. "any" matches every address.
application <app-id>App-ID application(s) this rule matches, for example web-browsing, ssl. "any" matches every application.
service <service-or-object>Allowed service/port. "application-default" (the common choice) restricts the rule to each application's standard ports instead of any port.
action [allow|deny|drop]allow passes traffic; deny sends a response then blocks; drop silently discards without a response.
log-end [yes|no]Whether to log traffic matching this rule when the session ends.
Let op: A rule with source/destination/application/service all set to "any" and action allow matches everything between the given zones. Scope these fields before enabling a broad rule in production.
set rulebase security rules <name> ... move rulebase security rules <name> before <other-name>Rules are evaluated top to bottom; the first matching rule wins. "move" changes a rule's position.

Voorbeeld

move rulebase security rules allow-web before block-all

Opties

move ... before <name>Move the rule directly above another named rule.
move ... after <name>Move the rule directly below another named rule.
move ... top / move ... bottomMove the rule to the very top or bottom of the rulebase.
delete rulebase security rules <name>Remove a security policy rule from the candidate configuration (requires "commit" to take effect).
Let op: Deleting a rule that is currently matching production traffic, once committed, means that traffic falls through to whatever rule matches next, which may be a broader deny.
test security-policy-match from <zone> to <zone> source <ip> destination <ip> destination-port <port> protocol <proto> [application <app>]Simulate a packet through the policy engine and show exactly which rule would match it, without sending any real traffic.

Prints the full matched rule definition, or "No rule matched" if nothing applies.

Voorbeeld

test security-policy-match protocol 6 from L3-Trust to L3-Untrust source 192.168.52.1 destination 74.125.225.69 destination-port 80 application web-browsing

Opties

protocol <number>IP protocol number: 6 = TCP, 17 = UDP, 1 = ICMP, 50 = ESP. Required.
from / to <zone>Source/destination zone. Strongly recommended when many rules share the same source/destination zones, otherwise the test can match the wrong rule.
source / destination <ip>Required source and destination IP address for the simulated packet.
destination-port <port>Required destination port for the simulated packet.
application <app-id>Optional; restrict the simulation to a specific App-ID.
show-allShow every rule that could potentially match, not just the first hit.
test nat-policy-match from <zone> to <zone> source <ip> destination <ip> destination-port <port> protocol <proto>Same idea as test security-policy-match, but for NAT rules: shows which NAT rule would translate the simulated packet, and the resulting translated address.

Run this before test security-policy-match when troubleshooting NAT'd traffic: the security policy evaluates against post-NAT (destination NAT) or pre-NAT (source NAT) addresses depending on direction, which often confuses rule matching.

VPN

show vpn ike-sa show vpn ipsec-saShow active phase 1 (IKE) and phase 2 (IPsec) security associations for site-to-site VPN tunnels.

Phase 1 up but no phase 2 SA usually points at a mismatched proxy ID or local/remote subnet selector between the two VPN peers.

set network ike gateway <name> authentication pre-shared-key key <key> set network ike gateway <name> peer-address ip <ip> set network ike gateway <name> local-address interface <intf>Configure the phase 1 (IKE gateway) side of a site-to-site IPsec VPN.
Let op: The pre-shared key is stored in the configuration. Treat exported configuration files as sensitive; they are not automatically redacted.
test vpn ike-sa gateway <name> test vpn ipsec-sa tunnel <name>Manually trigger phase 1 or phase 2 negotiation for a configured tunnel, useful when a tunnel should be up but has not initiated yet.

Many tunnels only negotiate on-demand when matching traffic arrives; this command forces negotiation without needing real traffic to trigger it.

Diagnose

debug ike global on debug ike global offEnable or disable verbose IKE negotiation logging, written to the system log, for troubleshooting a VPN tunnel that will not come up.
Let op: Remember to turn debugging back off; leaving verbose debug logging enabled affects performance and fills logs on a busy firewall.
debug dataplane packet-diag set filter match <criteria> debug dataplane packet-diag set capture on debug dataplane packet-diag set capture offConfigure a filter and capture packets matching it directly on the dataplane, PAN-OS's equivalent of a tcpdump/packet capture workflow.

View captured packets afterwards with "view-pcap" commands or by exporting the capture file through the web UI.

Opties

debug dataplane packet-diag set filter match source <ip> destination <ip>Set the capture filter criteria.
debug dataplane packet-diag clear filter-marked-session allClear previously marked sessions from a filter before starting a new capture.
show counter global filter severity dropShow global packet/session counters, filtered to ones related to drops, which is often the fastest way to see why traffic is being discarded (e.g. a specific drop reason counter incrementing).

Add "delta yes" to only show counters that have changed since the last time the command was run, which makes it much easier to spot what is actively incrementing right now.

De omschrijvingen in dit naslagwerk zijn voorlopig in het Engels.

Uitleg

Zoek of filter op groep en kopieer een commando met één klik. Open een commando voor uitleg, een voorbeeld en elke parameter die het accepteert, met waarschuwingen bij alles dat na commit brede toegang kan blootstellen.

🔒 Je invoer blijft in je browser en wordt nergens naartoe gestuurd.

Veelgestelde vragen

Hoe controleer ik welke security-regel een pakket matcht zonder echt verkeer te sturen?

Gebruik "test security-policy-match" met protocol, zones, bron, bestemming en bestemmingspoort. Het toont de eerst gematchte regel, of "No rule matched".

Wat nu?

Meer in dit onderdeel

  • FortiGate (FortiOS) cheatsheetDoorzoekbare FortiGate CLI-commandoreferentie: systeem, netwerk, firewallbeleid, VPN en diagnose, met elke parameter uitgelegd.
  • Cisco IOS cheatsheetDoorzoekbare Cisco IOS/IOS-XE-referentie: interfaces, VLAN’s, routering, access lists, port security, STP, EtherChannel, SNMP en NAT, met elke parameter uitgelegd.
  • Nmap cheatsheetDoorzoekbare Nmap-commandoreferentie: host discovery, scantypes, service/OS-detectie, NSE-scripts en timing, met elke optie uitgelegd.

Ook handig

Een probleem gevonden of een suggestie? Laat het ons weten