==

Palo Alto Firewalls: CLI Commands for Troubleshooting





CLI Commands for Troubleshooting Palo Alto Firewalls

CLI Commands for Troubleshooting Palo Alto Firewalls


When troubleshooting network and security issues on many different devices I always miss some command options to do exactly what I want to do on the device I am currently working with. Therefore, I list a few commands for the Palo Alto Networks firewalls to have a short reference for myself. Maybe some other network professionals will find it useful.
However, since I am almost always using the GUI this short reference only lists commands that are useful for the console while not present in the GUI.
This blog post will be a living document. Whenever I use some “new” commands for troubleshooting issues, I will update it. If there are any useful commands missing, please send me a comment!
For a complete list of all CLI commands, use the CLI Reference Guides from PAN. Or use the official Quick Reference Guide: Helpful Commands PDF.

Standard Show Commands

The following commands are really the basics and need no further description. I list them just as a reference:

Find

Since PAN-OS 6.0, the “find” command helps searching for the needed command in case you do not fully know the whole set of commands. With “find command”, all possible commands are displayed. With “find command keyword xyz”, all commands containing “xyz” are shown.

Ping, Traceroute, and DNS

A standard ping command looks like that:
Note that this ping request is issued from the management interface! To use a data interface as the source, the option source   can be used. To use IPv6, the option is inet6 yes . For example:
A traceroute command looks like that:
The source   can be used to specify the outgoing interface. However, for IPv6, the option is dissimilar to the ping command: ipv6 yes .
To resolve DNS names, e.g., to test the DNS server that is configured on the management interface, simply ping a name:

Routing

Debugging dynamic routing protocols functions like this:
Or follow the routed.log:

Test

The Palo offers some great test commands, e.g., for testing a route-lookup, a VPN connection, or a security policy match. Use the question mark to find out more about the test commands. Here are some useful examples:

Viewing Management-Plane Logs

In order to view the debug log files, “less” or “tail” can be used. The keyword “mp-log” links to the management-plane logs (similar to “dp-log” for the dataplane-logs). The tail command can be used with “follow yes” to have a live view of all logged messages. And as always: Use the question mark in order to display all possibilities.
Examples:

Capturing Management Packets

To view the traffic from the management port at least two console connections are needed. The first one executes the tcpdump command (with “snaplen 0” for capturing the whole packet, and a filter, if desired),
while the second console follows the live capture:
Test traffic can be generated with a third console session, e.g.:
Later on, the pcap file can be moved to another computer with the following command:
Alternatively, tftp can be used:

Live Viewing of Packet Captures

When using the Packet Capture feature on the Palo Alto, the filter settings can easily be made from the GUI (Monitor -> Packet Capture). These settings as well as the current size of the running packet capture files can be examined with:
Now, the current capturing in follow mode can be viewed with:

And for a really detailed analysis, the counters for these filtered packets can be viewed. This exactly reveals how many packets traversed which way, and so on. With the “delta yes” option, only the counter values since the last execution of this command are shown. The “packet-filter yes” option uses the packet filter from the GUI (Monitor -> Packet Capture) to filter the counters:
For example, here are the delta counters after a few DNS lookups:
Or, even more interesting, filtered on “drop” severity. (Note the reasons on the right-hand side):

Examining the Session Table

If a network connection failure is not found in the traffic log, the session table can be asked for sessions in DISCARD state, filtered based on its source, or whatever. This is useful at the console because the session browser in the GUI does not store the filter options and is therefore a bit unhandy. All commands start with “show session all filter …”, e.g.:
To have an overview of the number of sessions, configured timeouts, etc.:
For investigating a single session in more detail, use:
Watch out for the: “Hardware session offloading” line. If it is “true” you might want to disable the fastpath during troubleshooting (inside the config mode):

To see whether there are some “predict” sessions in which the Palo Alto uses a ALG (appliation layer gateway) to predict dynamic ports (e.g., SIP, active FTP), use this command:
A specific session can then be cleared with:

Reason for Session Close

You cannot see the reason for a closed session in the traffic log in the GUI. For this purpose, find out the session id in the traffic log and type in the following command in the CLI (Named the “Session Tracker“). Note the last line in the output, e.g. “tracker stage firewall : Aged out” or “tracker stage firewall : TCP FIN”. This shows what reason the firewall sees when it ends a session:
Alternatively, the traffic log on the CLI can display the session tracker when used with the option “show-tracker equal yes” such as:

VPN Issues

The general show commands for VPN sessions are:
(Palo Alto: How to Troubleshoot VPN Connectivity Issues). Though you can find many reasons for not working site-to-site VPNs in the system log in the GUI, some more CLI commands might be useful. To reveal whether packets traverse through a VPN connection, use this: (it shows the number of encap/decap packets and bytes, i.e., the actual traffic flow)
Or use the counter values for ipsec issues:

And for a detailled debugging of IKE, enable the debug (without any more options)
then follow the pcap with
and do NOT forget to set the debugging off!
The complete ikemgr.pcap can be downloaded from the Palo with scp or tftp, e.g.:

GlobalProtect

Current users and flow:

Displaying the Config in Set Mode

The XML output of the “show config running” command might be unpractical when troubleshooting at the console. That’s why the output format can be set to “set” mode:
Now, enter the  configure  mode and type show . This reveals the complete configuration with “set …” commands. (Click here for more information.) Here is a sample output of a particular show command:
The pipe (|) can be used to grep certain values with the “match” keyword, such as:

To show the complete config without breaks (which is “terminal length 0” on Cisco devices), the following command can be used (BEFORE the configure mode is entered):
To omit line breaks (carriage returns), use this one:

High Availability

Some show and request commands (even though present in the GUI):

Export/Import Files

To copy files from or to the Palo Alto firewall, scp or tftp can be used. The commands have both the same structure with “export … to” or “import … from”, e.g.:

User-IDs and Groups

State of the LDAP server connections:
List the groups that are stored in the Palo Alto:
Manual group mapping refresh:
Show the group memberships for a particular user:
Show the members of a particular group:
IP to User mapping:
User-ID cache clearance:

IP Addresses of FQDN Objects

When using objects with FQDNs, the current IP addresses are not shown in the GUI. The following command displays respectively refreshes them:

IP Addresses of Dynamic Block Lists

Similar, the entries in a dynamic block list can be viewed with:

DNS Proxy

To verify the functionality of DNS proxy objects, at least two commands are useful. Both outputs should speak for themselves:

Active URL Vendor/Database

I had some issues with the two different URL databases “brightcloud” and “PAN-DB”. This is the command to show unambiguously which vendor is active on the PA (independent of the licenses):
The output is either “brightcloud” or “paloaltonetworks”. The standard URL DB up to PAN-OS 5.0 is brightcloud. Beginning with PAN-OS 6.0, the default is PAN-DB (refer to the release notes, section “Changes to Default Behavior”). To change the vendor (of course only if it is licensed), click the “Activate” link under licenses in the GUI.

PAN-DB URL Test & Cache

To show the category of a specific URL, use one of the following commands:
To display the current URL cache from the PAN-DB, two steps are required. The first one is the creation of a logfile which contains all entries and the second one is to display this logfile:

Fan Speed

Ok, this is not a troubleshooting command, but nevertheless very useful. It sets the fan speed to “auto” which immediately drops the noise of the fan, e.g. on a PA-200:


https://blog.webernetz.net/2013/11/21/cli-commands-for-troubleshooting-palo-alto-firewalls/

Defaults

Just for reference:
  • Default Management Interface IP: 192.168.1.1
  • Login: admin
  • Password: admin
To change the IP settings of the management inferface via the console:



The change in the CLI is as follows:PAN-OS 7.0 and earlier releases:

set external-list recurring hourly at
PAN-OS 7.1 and later releases:
set external-list recurring hourly
With the new ability to specify intelligence sources through a list on an external domain, you must now specify the list. Example changes in the CLI follow:PAN-OS 7.0 and earlier releases:
show profiles spyware botnet-domains action
show profiles spyware botnet-domains action alert
show profiles spyware botnet-domains action allow
show profiles spyware botnet-domains action block
show profiles spyware botnet-domains action sinkhole
PAN-OS 7.1 and later releases:
show profiles spyware botnet-domains lists action
show profiles spyware botnet-domains lists action alert
show profiles spyware botnet-domains lists action allow
show profiles spyware botnet-domains lists action block
show profiles spyware botnet-domains lists action sinkhole
With the introduction of two-factor authentication in GlobalProtect, a number of API requests have been changed. Use the CLI with the command debug cli on to see changes in the corresponding XML requests. Affected commands are within the following command hierarchy:
set global-protect global-protect-portal satellite-config
set global-protect global-protect-portal client-config
set global-protect global-protect-portal portal-config
To view the results of a query, the request format has been updated to be uniform between firewalls and Panorama:PAN-OS 7.0 and earlier releases:
show query id <1-4294967295>
PAN-OS 7.1 and later releases:
show query result id <1-4294967295> skip <0-4294967295>
With the introduction of configurable maximum segment size (MSS) adjustment sizes, the request format to enable MSS adjustment has changed:PAN-OS 7.0 and earlier releases:
set network interface ethernet layer3 adjust-tcp-mss
set network interface ethernet layer3 units adjust-tcp-mss
set network interface vlan adjust-tcp-mss
set network interface vlan units adjust-tcp-mss
set network interface loopback adjust-tcp-mss
set network interface loopback units adjust-tcp-mss
PAN-OS 7.1 and later releases:
set network interface ethernet layer3 adjust-tcp-mss enable
set network interface ethernet layer3 units adjust-tcp-mss enable
set network interface vlan adjust-tcp-mss enable
set network interface vlan units adjust-tcp-mss enable
set network interface loopback adjust-tcp-mss enable
set network interface loopback units adjust-tcp-mss enable
The maintenance mode menu for selecting the mode of operation changed:Firewall platforms —The Set CCEAL4 mode menu is renamed to Set FIPS-CC mode. Additionally, the Set FIPS mode menu is removedPanorama virtual appliances, M-Series appliances, and WF-500 appliances —The Set CCEAL4 mode menu is renamed to Set FIPS-CC mode.
If your firewall is set to FIPS mode, you must change the mode of operation to CCEAL4 mode (using Set CCEAL4 mode menu option in maintenance mode) before you upgrade to a PAN-OS 7.0. or later release. See upgrade considerations for more details on upgrading a firewall that is set to FIPS mode.
When you change from FIPS mode to CCEAL4 mode, you lose all configuration settings so it is important to back up your configuration first and re-import it after you change modes (and before you upgrade). For information on changing to FIP-CC mode, refer to Certifications.
Hardware-based and software-based decompression is supported on all Palo Alto Networks platforms (excluding VM-Series firewalls). Starting in PAN-OS 7.1, a hybrid mode (enabled by default) allows firewalls to dynamically switch from hardware-based decompression to software-based decompression when the hardware decompression engine is under a heavy load and then switch back when the load decreases. Prior to PAN-OS 7.1, you could manually switch between decompression modes but you could choose only one mode at a time: hardware (default) or software.
You can modify this new setting ( zip mode auto ) so that the firewall performs only hardware-based decompression or software-based decompression as needed.
PAN-OS 7.0 and earlier releases:
set deviceconfig setting zip sw [yes|no]
PAN-OS 7.1 and later releases:
set deviceconfig setting zip mode [sw | hw | auto]
New counters are also introduced to the show system setting zip command output to monitor the number of times that the firewall switches from hardware-based decompression to software-based decompression:
Number of SW Forced Switchovers —The number of times that the firewall forces a switchover to software-based decompression. A forced switchover can occur when the firewall is in hardware zip mode if the hardware decompression engine becomes unresponsive.Number of SW Automatic Switchovers —The number of times the firewall has dynamically switched from hardware-based to software-based decompression when in automatic zip mode.The following command now shows asterisks (*) instead of zeroes (0) when a corresponding CPU core load percentage is not currently being measured or cannot be measured:
show running resource-monitor
An asterisk may indicate potential issues such as a malfunction that causes packet processing to pause. When issues like this occur, the response repeatedly shows an asterisk instead of a number. It is normal for core 0 to always show an asterisk.
The netstat command has moved from the root level to within the request command hierarchy:PAN-OS 7.0 and earlier releases
netstat programs yes interface yes
PAN-OS 7.1 and later releases
request netstat programs yes interface yes
Additionally, use of the request netstat programs command option now requires superuser or superreader permissions.
The following User-ID configuration commands, used to retrieve the list of groups and the corresponding list of members from an LDAP server, now require you to specify the virtual system to which the LDAP server profile belongs:PAN-OS 7.0 and earlier releases:
show user group-mapping naming-context server | server-port <1-65535> use-ssl is-active-directory proxy-agent | proxy-agent-port <1-65535>
show user group-selection use-ssl base bind-dn bind-password name-attribute group-object container-object filter search-scope proxy-agent | proxy-agent-port <1-65535> force server [ ... ]
show user group-selection use-ssl base bind-dn bind-password name-attribute group-object container-object filter search-scope proxy-agent | proxy-agent-port <1-65535> force server-port [ ... ]
PAN-OS 7.1 and later releases:
show user group-mapping naming-context server | sp_vsys_id server-port <1-65535> use-ssl is-active-directory proxy-agent | proxy-agent-port <1-65535>
show user group-selection sp_vsys_id use-ssl base bind-dn bind-password name-attribute group-object container-object filter search-scope proxy-agent | proxy-agent-port <1-65535> force server [ ... ]
show user group-selection sp_vsys_id use-ssl base bind-dn bind-password name-attribute group-object container-object filter search-scope proxy-agent | proxy-agent-port <1-65535> force server-port [ ... ]
The CLI command to set the maximum number of multicast packets queued per session has changed. The new command updates the configuration instead of running an operational command. This change, which persists even if the firewall is reset, now requires you to commit your configuration changes:PAN-OS 7.0 and earlier releases:
set session max-pending-mcast-pkts-per-session <0-2000>
PAN-OS 7.1 and later releases:
set deviceconfig setting session max-pending-mcast-pkts-per-session <1-2000>
With the role-based access control enhancements, on firewalls enabled for multiple virtual systems, you must specify the target virtual system before you can view or set application status. The following commands have changed:PAN-OS 7.0 and earlier releases:
request get-disabled-applications vsys
request get-application-status vsys application
request set-application-status-recursive vsys enable-dependent-apps application status
PAN-OS 7.1 and later releases:
First set the target vsys.
set system setting target-vsys
Then enter the command to retrieve or set the application status.
request get-disabled-applications
request get-application-status application
request set-application-status-recursive enable-dependent-apps application status
PAN-OS 7.1.3 adds a configuration that allows checking for application and threat content updates hourly. Use the following commands to enable hourly checking and to verify the configuration:PAN-OS 7.1.3 and later releases:
debug management-server content hourly-check set enable
debug management-server content hourly-check show
PAN-OS 7.1.5 adds commands that allow you to restart firewall processes (bfd, cryptod, dhcpd, ikemgr, keymgr, and pppoed) that previously required root access to restart. Use the following commands to restart these processes:PAN-OS 7.1.5 and later releases:
debug software restart process bfd
debug software restart process crypto
debug software restart process dhcp
debug software restart process ikemgr
debug software restart process keymgr
debug software restart process pppoe
PAN-OS 7.1.5 adds a command that allows you to configure how the firewall handles the Priority Code Point (PCP) value in the VLAN tag field when forwarding the frame between different VLANs. By default, the firewall automatically unsets the PCP value when forwarding between VLANs for greater security. To address a requirement in a particular customer environment, you can configure the firewall to pass through the PCP value so that it is preserved on frame forwarding. Use the following command to configure this behavior, where the default value is no to disable PCP pass-through:PAN-OS 7.1.5 and later releases:
set session pass-through-1q-pcp
To view the PCP configuration, use the existing command to display VLANs:
show vlan all
The command output has the following updates associated with the PCP pass-through configuration:
pvst+ tag rewrite: enabled
pvst+ native vlan id: 1
drop stp: disabled
802.1Q PCP pass through: disabled
 

Pro Teknologi dibuat pada 22 Februari 2017. Blog ini adalah harapan saya agar dapat membagi manfaat kepada orang lain,berupa tips-tips Seputar Blog,Internet,Komputer,dan Info-Info Menarik lainnya.

0 Response to "Palo Alto Firewalls: CLI Commands for Troubleshooting "

Post a Comment