Enable wireguard module debug logging

Hi,

Is any way to enable a "module" debug log, i want it to log wireguard activity in a opnsense(freebsd).
I am noob at FreeBSD so that why i ask it.


Analog commands in Linux:
sudo modprobe wireguard
echo module wireguard +p | sudo tee /sys/kernel/debug/dynamic_debug/control
dmesg -wT | grep wireguard' >> /var/log/wireguard-dyndbg.log

regards.
 
I am leaving this comment for future documentation.
Apparently, it's as easy as adding a "debug" flag to ifconfig, ex:

ifconfig wg0 debug

Ref:
line 70:
#define DPRINTF(sc, ...) if (if_getflags(sc->sc_ifp) & IFF_DEBUG) if_printf(sc->sc_ifp, ##__VA_ARGS__)

ifnet(9) describes "debug" as an Interface Flags, and TIL I discovered that this is a standard way to enable debug on network interfaces:

It's so different from Linux!!! Anyway, it's a pity I didn't find much documentation apart from reading the source code.
 
opnsense(freebsd)
 
Back
Top