netconsole is a kernel module that sends all kernel log messages (i.e. dmesg) over the network to another computer, without involving user space (e.g. syslogd). Name “netconsole” is a misnomer because it’s not really a “console”, more like a remote logging service.
It can be used either built-in or as a module. Built-in netconsole initializes immediately after NIC cards and will bring up the specified interface as soon as possible. The module is mainly used for capturing kernel panic output from a headless machine, or in other situations where the user space is no more functional.


Sender configuration

Built-in Configuration

Netconsole can be configured via the netconsole kernel parameter in the following format:


where the fields have the following meaning:

  • src-port — source for UDP packets (defaults to 6665)
  • src-ip — source IP to use (interface address)
  • dev — network interface (eth0)
  • tgt-port — port for logging agent (6666)
  • tgt-ip — IP address for logging agent
  • tgt-macaddr — ethernet MAC address for logging agent (broadcast)

For example:

Note: MAC address is optional, but the slash must stay: ...,6666@

The logging level can be set with the loglevel kernel parameter, e.g.:


Runtime configuration

Netconsole can be loaded as kernel module manually after boot or automatically during boot depending on the module configuration (see Kernel modules for details).

To load the netconsole module manually any time after boot:

# set log level for kernel messages
dmesg -n 8

modprobe configfs
modprobe netconsole
mount none -t configfs /sys/kernel/config

# 'netconsole' dir is auto created if the module is loaded 
mkdir /sys/kernel/config/netconsole/target1
cd /sys/kernel/config/netconsole/target1

# set local IP address
echo > local_ip
# set destination IP address
echo > remote_ip
# find destination MAC address
arping $(cat remote_ip) -f | grep -o ..:..:..:..:..:.. > remote_mac

echo 1 > enabled

Netconsole should now be configured. To verify, run dmesg | tail and you should see “netconsole: network logging started”. Check available log levels by running dmesg -h.