NFTables could read a properly formatted text file directly using an
include statement. Depending on your work flow, it might be easier if you could have a shell, AWK, or perl script read the text file or logs. Either way, you'd
add the entries to a set.
So if you have a named set, with or without timeouts,
Code:
. . .
set blacklist {
type ipv4_addr
flags interval
auto-merge
elements = { 199.201.64.0/22, 204.15.20.0/22, }
}
. . .
then you can have a script update it,
Code:
#!/bin/sh
. . .
nft add element inet filter blacklist { $address }
. . .
where $address contains an IPv4 address or CIDR address range.
I presume it is similar for IPv6.