Cheat sheet de Palo Alto (PAN-OS)
Referencia de comandos CLI de PAN-OS con búsqueda: política de seguridad, NAT, VPN y diagnóstico, con cada parámetro explicado.
Se ejecuta en tu navegador · no se envía nadaNuevo
28 comandos
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.
> (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.
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.
Ejemplo
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.
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.
Ejemplo
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.
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.
Opciones
set cli config-output-format xml | Switch 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.
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.
Opciones
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.
<command> | match "<pattern>"Filter the output of any show/show-style command to lines containing a pattern.Ejemplo
show | match "rule1"
System
show system infoShow hostname, management IP, PAN-OS version, model and serial number.
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.
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).
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).Opciones
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.
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.
request restart systemReboot the firewall.
request restart systemReboot the firewall.request tech-support dumpGenerate a tech-support file bundling logs, configuration and system state for a Palo Alto support case.
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.
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.
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.
Ejemplo
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).
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.
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.Ejemplo
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).
ping host <ip-or-host>
traceroute host <ip-or-host>Run ping or traceroute from the firewall itself (operational mode).Opciones
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.
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.Ejemplo
set rulebase security rules allow-web from L3-Trust to L3-Untrust source any destination any application web-browsing service application-default action allow
Opciones
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. |
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.
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.Ejemplo
move rulebase security rules allow-web before block-all
Opciones
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 ... bottom | Move 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).
delete rulebase security rules <name>Remove a security policy rule from the candidate configuration (requires "commit" to take effect).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.
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.
Ejemplo
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
Opciones
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-all | Show 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.
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.
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.
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.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.
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.
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.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.
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.
Opciones
debug dataplane packet-diag set filter match source <ip> destination <ip> | Set the capture filter criteria. |
|---|---|
debug dataplane packet-diag clear filter-marked-session all | Clear 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).
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.
Las descripciones de esta referencia están por ahora en inglés.
Explicación
Busca o filtra por grupo y copia un comando con un clic. Abre un comando para ver qué hace, un ejemplo y cada parámetro que acepta, con avisos para todo lo que pueda exponer un acceso amplio tras el commit.
🔒 Tu entrada se queda en tu navegador y no se envía a ningún sitio.
Preguntas frecuentes
¿Cómo compruebo qué regla de seguridad coincide con un paquete sin enviar tráfico real?
Usa "test security-policy-match" con protocolo, zonas, origen, destino y puerto de destino. Muestra la primera regla que coincide, o "No rule matched".
Qué hacer después
¿Has encontrado un problema o tienes una sugerencia? Cuéntanoslo