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

"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

12 Replies
Highlighted
Explorer

Hi Heiko,

That's super interesting!

Are there any other "fw ctl zdebug" commands?

Highlighted
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
Highlighted
Admin
Admin

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

Highlighted

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

Highlighted
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.

Highlighted

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
Highlighted
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

Highlighted
Admin
Admin

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

Participant

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

Highlighted
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
Highlighted
Participant

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

0 Kudos
Highlighted
Explorer

so helpful,thanks.
0 Kudos