[Solved] Security on the pi (ufw)

I got 2 pi’s running osmc (pi2, pi3b), and both of them had till recently ufw running on them. Today i noticed that i could see my pi from my pc to chromecast to.I thought that is weird…maybe ufw is down. So i did ufw status on my pi2 and got:

root@pi2:~# ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
Firewall is active and enabled on system startup
root@pi2:~# ufw status
Status: inactive
root@pi2:~#

on my pi3 i got:

root@KodiPi3:~# ufw status
Status: inactive
root@KodiPi3:~# ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
ERROR: problem running ufw-init
iptables-restore: line 6 failed
iptables-restore: line 22 failed
iptables-restore v1.8.2 (nf_tables): Couldn't load match `conntrack':No such file or directory

Error occurred at line: 2
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
iptables-restore: line 4 failed
iptables-restore: line 5 failed
iptables-restore: line 21 failed
iptables-restore v1.8.2 (nf_tables): unknown option "--dport"
Error occurred at line: 19
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
iptables-restore: line 10 failed
iptables-restore v1.8.2 (nf_tables): Couldn't load match `multiport':No such file or directory

Error occurred at line: 21
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
iptables-restore v1.8.2 (nf_tables): Chain 'ufw-before-input' does not exist

Problem loading ipv6 (skipping)
Problem running '/etc/ufw/before.rules'
Problem running '/etc/ufw/after.rules'
Problem running '/etc/ufw/user.rules'

root@KodiPi3:~#

what is going on ? Didn an update break both my pi’s ? I havent touched my ufw for like 2 years…Everything was wokring fine last time i checked.

Edit: Also this happens:

root@pi2:~# iptables -L -v
# Warning: iptables-legacy tables present, use iptables-legacy to see them
iptables: Operation not supported.
root@pi2:~#

Last month, we updated OSMC from Debian Stretch to Buster.
Firewalling has changed.

See OSMC's October update is here with Debian Buster and Kodi 18.8 - OSMC - #110 by jackyaz.

hmm i wasnt aware sorry. So i have to remove ufw do that legacy switch and install it again ? Sorry i am confused. I got no idea about the Buster distro

ufw should work fine, you just need to get iptables-legacy working.

There’s a more in depth discussion about this here: OSMC Update request! Urgent!

Sam

Thanks Sam, i’ll go read it now

Edit: Thanks, that did it.