Documentation > Miscellaneous > Logging

Logging

If Jool has something to say, it will do so in the kernel logs (just like any other kernel component). Typical ways to find this include

Thankfully, Linux is generally silent after booting, so Jool’s latest messages should be found at the very bottom.

Jool uses four levels in the severity spectrum (see dmesg --help):

  1. err: “Your configuration cannot be applied, user”. This only happens during module insertion/removal and as a response of userspace application requests. These messages are also sent over to the userspace application so it can print them in stderr.
  2. warn: “Are you sure this configuration is sane? I’m going to keep doing this, but it doesn’t look like it’s going places”. Only happens during packet translations.
  3. info: “The kernel module was inserted”, “the kernel module was removed”. Also logging-bib and logging-session’s exploits.
  4. debug: “And now I’m doing this”. “I couldn’t translate this packet because X, and I think it’s normal”.

Debug messages are normally compiled out of Jool’s binaries because they are lots and can slow things down. If you are testing or troubleshooting however, they can be of help.

If you want Jool to print debug messages, follow these steps:

1. Uninstall your current modules

Do one of the following:

  • If you used some package, just remove the package (eg. apt remove jool-dkms).
  • If you used DKMS, follow these steps.
  • If you used Kbuild, follow these steps. (At the bottom.)

2. Recompile, including the -DDEBUG flag

Go to the dkms.conf file found in the root of the source package.

tarball git clone
user@T:~$ cd jool-4.0.9/
user@T:~$ nano dkms.conf
user@T:~$ cd Jool/
user@T:~$ nano dkms.conf

Change

MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/src/mod/common modules \
      && make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/src/mod/nat64 modules \
      && make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/src/mod/siit modules"

Into

MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/src/mod/common JOOL_FLAGS=-DDEBUG modules \
      && make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/src/mod/nat64 JOOL_FLAGS=-DDEBUG modules \
      && make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/src/mod/siit JOOL_FLAGS=-DDEBUG modules"

Then install the module via DKMS:

user@T:~# dkms install .

3. Restart and reconfigure you Jool instance(s)

jool jool_siit
modprobe -r jool
modprobe jool
jool instance add ...
modprobe -r jool_siit
modprobe jool_siit
jool_siit instance add ...

4. Notice the log noise

$ dmesg | tail -5
[ 3465.639622] ===============================================
[ 3465.639655] Catching IPv4 packet: 192.0.2.16->198.51.100.8
[ 3465.639724] Translating the Packet.
[ 3465.639756] Address 192.0.2.16 lacks an EAMT entry and there's no pool6 prefix.
[ 3465.639806] Returning the packet to the kernel.

These messages quickly add up. If your computer is storing them, make sure you revert the binaries (by removing -DDEBUG and reinstalling) when you’re done so they stop flooding your disk.

If dmesg is not printing the messages, try tweaking its --console-level. Have a look at man dmesg for details.