Running Debian 10 on a LXC container:
# apt-get -y install nftables
# nft --version
nftables v0.7 (Scrooge McDuck)
# nft flush ruleset
# nft add table inet filter
# nft add chain inet filter input
# nft add rule inet filter input log
# nft list ruleset
table inet filter {
chain input {
log
}
}
Then, I go to /var/log/syslog
, create some network traffic and... I see no message from nftables at all.
I also tried (unsuccessfully) to define the rule this way:
nft add rule inet filter input log prefix \"FINDME \" counter
More tests:
# logger test && tail -1 /var/log/syslog
Aug 18 20:39:53 my-server root: test
# echo "test2" | systemd-cat && tail -1 /var/log/syslog
Aug 18 20:40:52 my-server cat[1907]: test2
# uname -v
#1 SMP PVE 5.4.34-2 (Thu, 07 May 2020 10:02:02 +0200)
Why is nftables not writing to my syslog ?
As a bonus question: would there be any way to trigger an action when a match occurs? For example store blocked IPs on a database.