Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
HeikoAnkenbrand
Champion Champion
Champion

"fw ctl zdebug" Helpful Command Combinations

"fw ctl zdebug" is a powertool that is not exhausted from being used with "fw ctl zdebug drop". There is not much to be found in Check Point KB or in the documentation. "fw ctl zdebug" is an R&D tool for testing software in development. Therefore, the insert should be used with care. It starts a debugging in the background until it is aborted with CTRL+C. On productive systems it can have a high performance impact. Furthermore, the debug buffer is not the largest.

 

 

What happens when you execute! It is a macro that executes the following commands:

 

fw ctl debug -buf 1024
fw ctl debug [The option behind "fw ctl zdebug"]
fw ctl kdebug -f
       [Wait until CTRL+C is pressed]
fw ctl debug 0

 

Node:

A current list with kernel debug flags can be found here.

Kernel Debug Flags R80.10

Kernel Debug Flags R77

 
Here are some good examples for debugging:

 

fw ctl zdebug + packet
fw ctl zdebug + packet | grep -B 1 TCP |grep -B 1 "(SYN)"      <<< change SYN-ACK,ACK,FIN,... and/or UDP,TCP...
fw ctl zdebug + all |grep -A 1 "Monitor" | grep "1.1.1.1"            <<< change IP address
fw ctl zdebug + all |grep -A 2 "Monitor"
fw ctl zdebug + sync                     
fw ctl zdebug + conn |grep "After  VM:" |grep "(SYN)"
fw ctl zdebug + xlate
fw ctl zdebug + monitorall                                                     <<< use with host IP "| grep 1.1.1.1" or network range "| grep 1.1."
fw ctl zdebug + monitor                                                            <<< use with host IP "| grep 1.1.1.1" or network range "| grep 1.1."
fw ctl zdebug + filter conn | grep -A 8 "rule 1"                          <<< change rule number - show connetions to rule xyz
fw ctl zdebug + filter monitor  | grep -A 8 "rule 2"                     <<< change rule number - show connetions to rule xyz

   
Attention, if you turn on debugging, this will affect the performance of the firewall.

 

Regards,

Heiko

➜ CCSM Elite, CCME, CCTE
14 Replies
Ariel_Soller
Explorer

Hi Heiko,

That's super interesting!

Are there any other "fw ctl zdebug" commands?

GG27
Contributor

Hello mates,

That's very useful post, but I don't understand what the reason is why there's no official documentation in SK

Thanks Heiko for your post

0 Kudos
PhoneBoy
Admin
Admin

fw ctl zdebug options are documented in the topic-specific ATRGs in SecureKnowledge.

HeikoAnkenbrand
Champion Champion
Champion

Principle all debug modules are possible for debugging with „fw ctl zdebug“. 

„fw ctl debug -h“ shows all current kernel debugging options for modules and instances.

You can use various combinations.

Unfortunately, the commands are only mentioned in few SK's.  Try it out here.  I have described the most important ones above. 

 

I would be pleased about new interesting combinations.

Regards,

Heiko

➜ CCSM Elite, CCME, CCTE
Kai_O_
Participant

It's a great tool. I didn't know you could do so much with it. I have only worked with "fw ctl zdebug drop" and did not recognize the potentiality.

Thanks for the info.

JozkoMrkvicka
Mentor
Mentor

fw ctl zdebug drop = debug of IPv4 connections

fw6 ctl zdebug drop = debug of IPv6 connections.

all flags and options listed here should be also valid for IPv6 (fw6).

Kind regards,
Jozko Mrkvicka
Don_Paterson
Advisor

Nice post. Thanks Heiko.

In the original post there is this line:

fw ctl debug [The option behind "fw ctl zdebug"]

Is that not more like a fw ctl debug -m fw [options/flags] ?

I think I remember the zdebug  focuses on the fw kernel module but I think I also remember that some other kernel module debug flags may also be set.

I know that the (DON'T DO THIS IN PRODUCTION) option of 'fw ctl zdebug all' adds debug flags to three or four other kernel modules but not all.

The fw module gets all debug flags set in that case.

fw ctl zdebug -m CPAS all would be required if, for example, the CPAS module was interesting for a full debug. The command above would not then be of use.

What is the monitorall option doing?

Regards,

Don

PhoneBoy
Admin
Admin

I think it's just turning up the debug level a bit.

Achilles_Tagg
Participant

This is very useful! Thanks for sharing... .

Maarten_Sjouw
Champion
Champion

Very nice Heiko.
I think that the most useful part of using the command is that when you stop the debug you are running it really stops all debugging, so you cannot forget to turn it off again.
Regards, Maarten
Yoel_Maaravi
Participant

fw ctl zdebug + monitorall  -> shows many fw chain modules

0 Kudos
Solo
Participant

so helpful,thanks.
0 Kudos
Mike_Jensen
Advisor

I am currently running R80.30 with JHFA take 237.  I used to be able to run fw ctl zdebug + drop | grep 10.x.x.x , but that hasn't worked in a while.  When I try to grep for a ip address it is as if the debug never loads and hangs there.  This is true on all of my gateways.  Has something changed in regards to this?

0 Kudos
Zolo
Contributor
Contributor

You can use "-F" option instead of "grep".

fw ctl zdebug -F '10.x.x.x,0,0,0,0' -F '0,0,10.x.x.x,0,0' + drop

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events