Kernel Debug Procedure

Alternatively, use the Kernel Debug Procedure with Connection Life Cycle.

Important:

Step

Instructions

1

Connect to the command line on the Security Gateway / each Cluster Member over SSH, or console.

Note - On Scalable Platforms (Maestro and Chassis), you must connect to the applicable Security Group.

2

Log in to the Expert mode.

3

Reset the kernel debug options.

  • On the Security Gateway / each Cluster Member, run:

    fw ctl debug 0

  • On the Scalable Platform Security Group, run:

    g_fw ctl debug 0

4

Reset the kernel debug filters.

  • On the Security Gateway / each Cluster Member, run:

    fw ctl set int simple_debug_filter_off 1

  • On the Scalable Platform Security Group, run:

    g_fw ctl set int simple_debug_filter_off 1

5

Configure the applicable kernel debug filters.

See Kernel Debug Filters.

6

Allocate the kernel debug buffer for each CoreXLClosed Performance-enhancing technology for Security Gateways on multi-core processing platforms. Multiple Check Point Firewall instances are running in parallel on multiple CPU cores. Firewall instance.

  • On the Security Gateway / each Cluster Member, run:

    fw ctl debug -buf 8200

  • On the Scalable Platform Security Group, run:

    g_fw ctl debug -buf 8200

7

Make sure the kernel debug buffer was allocated.

  • On the Security Gateway / each Cluster Member, run:

    fw ctl debug | grep buffer

  • On the Scalable Platform Security Group, run:

    g_fw ctl debug | grep buffer

8

Enable the applicable debug flags in the applicable kernel modules.

  • On the Security Gateway / each Cluster Member, run:

    fw ctl debug -m <module> {all | + <flags>}

  • On the Scalable Platform Security Group, run:

    g_fw ctl debug -m <module> {all | + <flags>}

See Kernel Debug Modules and Debug Flags.

Important - The CPU load increases at this point because the Firewall kernel starts to write some debug messages to the /var/log/messages file and the dmesg buffer.

9

Examine the list of the debug flags that are enabled in the specified kernel modules.

  • On the Security Gateway / each Cluster Member, run:

    fw ctl debug -m <module>

  • On the Scalable Platform Security Group, run:

    g_fw ctl debug -m <module>

10

Save the kernel debug output to a file.

  • On the Security Gateway / each Cluster Member, run:

    fw ctl kdebug -T -f > /var/log/kernel_debug.txt

  • On the Scalable Platform Security Group, run:

    g_fw ctl kdebug -T -f > /var/log/kernel_debug.txt

Important - The CPU load increases even more at this point because the Firewall starts to write all debug messages to the output file.

11

Replicate the issue, or wait for the issue to occur.

12

Stop the kernel debug output:

Press the CTRL+C keys.

Important - This does not stop all CPU load yet because the Firewall kernel continues to write some debug messages to the /var/log/messages file and the dmesg buffer.

13

Reset the kernel debug options.

  • On the Security Gateway / each Cluster Member, run:

    fw ctl debug 0

  • On the Scalable Platform Security Group, run:

    g_fw ctl debug 0

Important - This stops all CPU load from the kernel debug.

14

Reset the kernel debug filters.

  • On the Security Gateway / each Cluster Member, run:

    fw ctl set int simple_debug_filter_off 1

  • On the Scalable Platform Security Group, run:

    g_fw ctl set int simple_debug_filter_off 1

15

Transfer this file from the Security Gateway / each Cluster Member / each Security Group Member to your computer:

/var/log/kernel_debug.txt

Best Practice - Compress this file with the "tar -zxvf" command and transfer it from the Security Gateway / each Cluster Member / each Security Group Members to your computer. If you transfer to an FTP server, do so in the binary mode.

16

Analyze the debug output file.

Example - Connection 192.168.20.30:<Any> --> 172.16.40.50:80

[Expert@GW:0]# fw ctl debug 0
Defaulting all kernel debugging options
Debug state was reset to default.
[Expert@GW:0]#
[Expert@GW:0]# fw ctl set int simple_debug_filter_off 1
[Expert@GW:0]#
[Expert@GW:0]# fw ctl set str simple_debug_filter_saddr_1 "192.168.20.30"
[Expert@GW:0]#
[Expert@GW:0]# fw ctl set str simple_debug_filter_daddr_2 "192.168.20.40"
[Expert@GW:0]#
[Expert@GW:0]# fw ctl set int simple_debug_filter_dport_1 80
[Expert@GW:0]#
[Expert@GW:0]# fw ctl debug -buf 8200
Initialized kernel debugging buffer to size 8192K
[Expert@GW:0]#
[Expert@GW:0]# fw ctl debug | grep buffer
Kernel debugging buffer size: 8192KB
[Expert@GW:0]#
[Expert@GW:0]# fw ctl debug -m fw + conn drop
Updated kernel's debug variable for module fw
Debug flags updated.
[Expert@GW:0]#
[Expert@GW:0]# fw ctl debug -m fw
Kernel debugging buffer size: 8192KB
Module: fw
Enabled Kernel debugging options: error warning conn drop
Messaging threshold set to type=Info freq=Common
[Expert@GW:0]#
[Expert@GW:0]# fw ctl kdebug -T -f > /var/log/kernel_debug.txt

... ... Replicate the issue, or wait for the issue to occur ... ...

... ... Press CTRL+C ... ...

[Expert@GW:0]#
[Expert@GW:0]# fw ctl debug 0
Defaulting all kernel debugging options
Debug state was reset to default.
[Expert@GW:0]#
[Expert@GW:0]# fw ctl set int simple_debug_filter_off 1
[Expert@GW:0]#
[Expert@GW:0]# ls -l /var/log/kernel_debug.txt
-rw-rw---- 1 admin root 1630619 Apr 12 19:49 /var/log/kernel_debug.txt
[Expert@GW:0]#