12

I've got a RPi4 and I'm trying to configure ufw. The problem is that I get this error

ERROR: Couldn't determine iptables version

The versions of iptables and ufw are

iptables 1.8.2-4
libnftables0:armhf 0.9.0-2
libnftnl11:armhf 1.1.2-2
nftables 0.9.0-2
ufw 0.36-1

Linux version is Linux rP15 4.19.50-v7l+

Any ideas?

3 Answers 3

12

I found the solution. Buster comes with two iptables flavours

 > $ update-alternatives --list iptables
   /usr/sbin/iptables-legacy
   /usr/sbin/iptables-nft

By default it uses iptables-nft. When changes to iptables-legacy

sudo update-alternatives --set iptables /usr/sbin/iptables-legacy

it works with UFW without problems after reboot.

2

I experienced the same problem immediately after installing ufw:

$ sudo ufw status
ERROR: Couldn't determine iptables version

But after rebooting (without changing any other settings) it started working (as suggested here):

$ sudo ufw status
Status: active

$ update-alternatives --display iptables | grep currently
  link currently points to /usr/sbin/iptables-nft

$ uname -a
Linux raspberrypi 5.10.11+ #1399 Thu Jan 28 12:02:28 GMT 2021 armv6l GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 10 (buster)
Release:    10
Codename:   buster

$ dpkg -s ufw | grep Version
Version: 0.36-1
$ dpkg -s iptables | grep Version
Version: 1.8.2-4

I'm not sure, but I think this Debian bug is related. If so, it's supposed to be fixed in Debian's ufw package's 0.36-3 version.

0

Buster uses nftables.

I haven’t tried this, but it is supposed to support iftables commands.

It is possible to revert, but you may be better to look for an updated tutorial

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.