'ufw' does not work properly

Which system do you use? Android, Ubuntu, OOWOW or others?

**Ubuntu server newest, dated version as 230606.**

Which version of system do you use? Khadas official images, self built images, or others?

**Khadas offiial image download through OOWOW.**

Please describe your issue below:

I installed ubuntu server via OOWOW and ‘sudo apt update’ and ‘sudo apt upgrade’ then I installed ‘ufw’ by ‘sudo apt install ufw’. VIM1S is connected via ethernet cable.

‘sudo ufw allow ssh’, ‘sudo ufw enable’ then the following message show up.

ERROR: problem running ufw-init
iptables-restore v1.8.7 (nf_tables):
line 75: RULE_APPEND failed (No such file or directory): rule in chain ufw-not-local
iptables-restore v1.8.7 (nf_tables): unknown option “–log-prefix”
Error occurred at line: 24
Try iptables-restore -h' or 'iptables-restore --help' for more information. ip6tables-restore v1.8.7 (nf_tables): Couldn't load match rt’:No such file or directory

Error occurred at line: 24
Try ip6tables-restore -h' or 'ip6tables-restore --help' for more information. ip6tables-restore v1.8.7 (nf_tables): unknown option "--log-prefix" Error occurred at line: 24 Try ip6tables-restore -h’ or ‘ip6tables-restore --help’ for more information.

Problem running ‘/etc/ufw/before.rules’
Problem running ‘/etc/ufw/user.rules’
Problem running ‘/etc/ufw/before6.rules’
Problem running ‘/etc/ufw/user6.rules’

That’s the matter, ufw does not work properly even though ‘allow ssh’, no communication via network available until ‘sudo ufw disable’. I appreciate the procedure how to fix it.

I do not mind build own image from kernel source.



You will have to reconfigure the kernel then it will work.
I don’t recall the exact config settings because it was over a year or so ago that we worked with the Khadas boards.

UFW will not function properly until you can enable it without any error messages.

Also, when you do get it working be sure to disable ssh logging. If you don’t send the log file to a remote USB or NVMe drive it can wear out the emmc or SD card within a few months.

If you don’t need to touch the internet with that board you can develop for it on your host that has 2 ethernet ports. Use one jack going to your internet modem and the other going to a AP/DNS-router that has your SBC’s connected with wire or wireless. This will keep your boards off the internet yet still be able to work with them on your big box.

1 Like

Thank you for advice. I may ask ChatGPT for suitable config and build kernel image. Hope it will help.

Fenix has made if very easy for you to build a custom kernel. They even have a script for a .deb package that lets you scp it over to the target then just dpkg -i then a reboot. Test, it, if still does not work turn on more options and try it again. I do recall it being one that is buried deep so it might take a couple of tries to get it right.

Thank you for additional info. It is a easy life (dpkg -i *.deb) to do within ssh connection. By the way, I made a fat kernel yesterday and it is probably be able to diet because I put config switch ON seemed or looked to be related. I will try soon.

Now, I’m ready for my own build kernel to eMMC burning. Next concern is ‘ufw’ enable at Linux version 5.4? or 6.1??

5.4 & 5.10 with the kernal config works. We stopped chasing kernel versions and have not done any testing with 6.x +

Do recall that it was best to

$sudo apt autoremove ufw

before the kernel mods, then apt install ufw after the reboot.

Thank you for helpful advice.