Some basic info of my machine:
# uname -a
Linux iZ2zeirtviyt9b8s96ery2Z 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:16:3e:3d:fb:0d brd ff:ff:ff:ff:ff:ff
altname enp0s5
altname ens5
inet 172.25.37.57/18 metric 100 brd 172.25.63.255 scope global dynamic eth0
valid_lft 1887925919sec preferred_lft 1887925919sec
inet6 fe80::216:3eff:fe3d:fb0d/64 scope link
valid_lft forever preferred_lft forever
In session 1, I run modprobe netconsole netconsole=@/,@127.0.0.1/ , and the dmesg show:
[4235827.031716] netpoll: netconsole: local port 6665
[4235827.031724] netpoll: netconsole: local IPv4 address 0.0.0.0
[4235827.031726] netpoll: netconsole: interface 'eth0'
[4235827.031727] netpoll: netconsole: remote port 6666
[4235827.031729] netpoll: netconsole: remote IPv4 address 127.0.0.1
[4235827.031730] netpoll: netconsole: remote ethernet address ff:ff:ff:ff:ff:ff
[4235827.031734] netpoll: netconsole: local IP 172.25.37.57
[4235827.031794] printk: legacy console [netcon0] enabled
[4235827.031797] netconsole: network logging started
In session 2, I run
# nc -u -l -v 127.0.0.1 6666
Bound on localhost 6666
So I think the setup is done.
Then I send some logs to dmesg:
# dmesg -n 8 && echo "NETCONSOLE SUCCESS" | sudo tee /dev/kmsg
NETCONSOLE SUCCESS
# dmesg | tail
[4235827.031729] netpoll: netconsole: remote IPv4 address 127.0.0.1
[4235827.031730] netpoll: netconsole: remote ethernet address ff:ff:ff:ff:ff:ff
[4235827.031734] netpoll: netconsole: local IP 172.25.37.57
[4235827.031794] printk: legacy console [netcon0] enabled
[4235827.031797] netconsole: network logging started
[4235853.405638] NETCONSOLE SUCCESS
[4235864.247827] NETCONSOLE SUCCESS
[4235901.736691] NETCONSOLE SUCCESS
[4235902.538482] NETCONSOLE SUCCESS
But in session 2, I cannot see any received log. I expect I could see received log in Session 2. Could anyone help me how to further debug this?
Note: Why use one machine? I just want to learn how netconsole work for demo.