I had large ipset for blocking most of internet to knock my host. It does not work any more.
Creating ipset by adding ip nets by country to ipset used to work nicely. Last time it worked nicely was on August (kernel 5.13.2-1-default, Tumbleweed distribution update done 2021-07-24).
I did Tumbleweed distribution upgrade on 2021-08-21 (kernel 5.13.8-1-default). Since then adding IP nets country by country to ipset slows down. In the beginnging entries are inserted into ipset from by-country net files with reasonable speed, but everty additional country file increases entries creation time exponentially. It is so slow that it does not finish during whole week!
Now I tried to import all nets from single file. Practically it fails, too.
firewall-cmd --permanent --new-ipset=deny_public --type=hash:net --option=family=inet --option=hashsize=16384 --option=maxelem=208516
[FONT=monospace]firewall-cmd --permanent --ipset=deny_public --add-entries-from-file=./blacklist_nets_sorted
Latter command sits there hours and hours solidly eating 100% of single core CPU cycles.
Firewalld used to use iptables backend. I decided to give a try to libnftables backend, but with no avail. Is there a way to see what firewall-cmd is doing while consuming CPU?
[/FONT]
[FONT=monospace][FONT=monospace]$ zypper info firewalld libnftables1 python3-firewall ipset
Loading repository data...
Reading installed packages...
Information for package firewalld:
----------------------------------
Repository : Main Repository (OSS)
Name : firewalld
Version : 1.0.1-1.1
Arch : noarch
Vendor : openSUSE
Installed Size : 453.7 KiB
Installed : Yes
Status : up-to-date
Source package : firewalld-1.0.1-1.1.src
Summary : A firewall daemon with D-Bus interface providing a dynamic firewall
Description :
firewalld is a firewall service daemon that provides a dynamic customizable
firewall with a D-Bus interface.
Information for package libnftables1:
-------------------------------------
Repository : Main Repository (OSS)
Name : libnftables1
Version : 1.0.0-1.2
Arch : x86_64
Vendor : openSUSE
Installed Size : 811.9 KiB
Installed : Yes (automatically)
Status : up-to-date
Source package : nftables-1.0.0-1.2.src
Summary : nftables firewalling command interface
Description :
libnftables is the nftables command line interface placed into a
library.
Information for package python3-firewall:
-----------------------------------------
Repository : Main Repository (OSS)
Name : python3-firewall
Version : 1.0.1-1.1
Arch : noarch
Vendor : openSUSE
Installed Size : 2.0 MiB
Installed : Yes (automatically)
Status : up-to-date
Source package : firewalld-1.0.1-1.1.src
Summary : Python3 bindings for FirewallD
Description :
The python3 bindings for firewalld.
[/FONT][/FONT]
[FONT=monospace][FONT=monospace][FONT=monospace]Information for package ipset:
------------------------------
Repository : Main Repository (OSS)
Name : ipset
Version : 7.15-1.2
Arch : x86_64
Vendor : openSUSE
Installed Size : 28.3 KiB
Installed : Yes (automatically)
Status : up-to-date
Source package : ipset-7.15-1.2.src
Summary : Netfilter ipset administration utility
Description :
IP sets are a framework inside the Linux kernel, which can be
administered by the ipset utility. Depending on the type, currently
an IP set may store IP addresses, (TCP/UDP) port numbers or IP
addresses with MAC addresses in a way, which ensures lightning speed
when matching an entry against a set.
ipset can:
* store multiple IP addresses or port numbers and match against the
collection by iptables in one swoop;
* dynamically update iptables rules against IP addresses or ports
without performance penalty;
* express complex IP address and ports based rulesets with one single
iptables rule and benefit from the speed of IP sets
[/FONT][/FONT][/FONT]