enable dynamic debug for wg
Description
Description
Details
Details
- Difficulty level
- Normal (likely a few hours)
- Version
- -
- Why the issue appeared?
- Will be filled on close
- Is it a breaking change?
- Perfectly compatible
- Issue type
- Unspecified (please specify)
Event Timeline
Comment Actions
output looks then like below and is being logged to ringbuffer as well as systemd-journald:
[ 982.676054] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <[email protected]>. All Rights Reserved. [ 2249.407569] wireguard: wg01: Receiving handshake initiation from peer 1 (10.100.100.1:12345) [ 2249.407577] wireguard: wg01: Sending handshake response to peer 1 (10.100.100.1:12345) [ 2249.408422] wireguard: wg01: Keypair 2 created for peer 1
Jan 09 19:35:57 r02 kernel: wireguard: wg01: Receiving handshake initiation from peer 1 (10.100.100.1:12345) Jan 09 19:35:57 r02 kernel: wireguard: wg01: Sending handshake response to peer 1 (10.100.100.1:12345) Jan 09 19:35:57 r02 kernel: wireguard: wg01: Keypair 3 created for peer 1 Jan 09 19:35:57 r02 kernel: wireguard: wg01: Receiving keepalive packet from peer 1 (10.100.100.1:12345)
Not too sure where to place the debug option, since it's enabled for the entire module and we don't have a debug command as far as I know.
set system debug wireguard might be anoption
Comment Actions
Sounds good, syslog needs to be set to level debug for kernel facility, so it's per default only visible in the journal logs. Tested with a few tunnels, it's not very noisy, even with 20 tunnels.
Comment Actions
Just in case someone wants to implement this: debugging must not be enabled by default, only on demand or via config.
Comment Actions
Proposed CLI:
set system syslog global service wireguard
Expected command for debug
echo "module wireguard +p" | sudo tee /sys/kernel/debug/dynamic_debug/control
To disable
echo "module wireguard -p" | sudo tee /sys/kernel/debug/dynamic_debug/control