[MEGOLDVA] nftables hiba - mnl.c:45: Unable to initialize Netlink socket: Protocol not supported

Fórumok

Üdvözlet!

Az nftables a címben feltüntetett hibát dobja. Sajnos a Google most nem segített. :(

Debian 11.5

uname -ar
Linux ns 6.0.0-1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.0.2-1 (2022-10-16) x86_64 GNU/Linux

Köszönöm a segítséget!

Hozzászólások

Mi volt a parancs? Egy strace "parancs" kimentet tudnál mutatni? (root-ként)

A parancs sima sudo systemctl start nftables volt. De a sudo systemctl restart nftables is elhasalt.

systemd[1]: Starting nftables...
░░ Subject: A start job for unit nftables.service has begun execution
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit nftables.service has begun execution.
░░
░░ The job identifier is 2645.
Oct 18 20:55:48 ns sudo[3117]: pam_unix(sudo:session): session closed for user root
Oct 18 20:55:48 ns systemd[1]: nftables.service: Main process exited, code=exited, status=3/NOTIMPLEMENTED
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ An ExecStart= process belonging to unit nftables.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 3.
Oct 18 20:55:48 ns nft[3120]: mnl.c:45: Unable to initialize Netlink socket: Protocol not supported
Oct 18 20:55:48 ns systemd[1]: nftables.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ The unit nftables.service has entered the 'failed' state with result 'exit-code'.
Oct 18 20:55:48 ns systemd[1]: Failed to start nftables.
░░ Subject: A start job for unit nftables.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit nftables.service has finished with a failure.
░░
░░ The job identifier is 2645 and the job result is failed.

user@pc:~$ sudo systemctl status nftables.service 
● nftables.service - nftables
     Loaded: loaded (/lib/systemd/system/nftables.service; disabled; preset: enabled)
     Active: active (exited) since Wed 2022-10-19 08:16:04 CEST; 3min 18s ago
       Docs: man:nft(8)
             http://wiki.nftables.org
    Process: 6688 ExecStart=/usr/sbin/nft -f /etc/nftables.conf (code=exited, status=0/SUCCESS)
   Main PID: 6688 (code=exited, status=0/SUCCESS)
        CPU: 5ms

Oct 19 08:16:04 pc systemd[1]: Starting nftables...
Oct 19 08:16:04 pc systemd[1]: Finished nftables.
user@pc:~$ 
user@pc:~$ uname -a
Linux pc 6.0.0-1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.0.2-1 (2022-10-16) x86_64 GNU/Linux
user@pc:~$ 
user@pc:~$ cat /usr/lib/systemd/system/nftables.service
[Unit]
Description=nftables
Documentation=man:nft(8) http://wiki.nftables.org
Wants=network-pre.target
Before=network-pre.target shutdown.target
Conflicts=shutdown.target
DefaultDependencies=no

[Service]
Type=oneshot
RemainAfterExit=yes
StandardInput=null
ProtectSystem=full
ProtectHome=true
ExecStart=/usr/sbin/nft -f /etc/nftables.conf
ExecReload=/usr/sbin/nft -f /etc/nftables.conf
ExecStop=/usr/sbin/nft flush ruleset

[Install]
WantedBy=sysinit.target
user@pc:~$ 
user@pc:~$ sudo strace -e socket /usr/sbin/nft -f /etc/nftables.conf
socket(AF_NETLINK, SOCK_RAW, NETLINK_NETFILTER) = 3
+++ exited with 0 +++

Köszönöm Mindenkinek a segítséget! Megoldódott!

A gond, mint kiderült vmi miatt a /lib/modules mappa teljesen üres volt. Ismételten betöltöttük a kernel image-et és újra lett indítva a rendszer és most jól működik az nftables.