Score:0

is there any way to import ufw rules quickly?

in flag

just wondering if is there any faster way than this to import ufw rules

i'm trying to block geo ip's and as you know each country have tons of ip's it takes forever to deny access with this method

cat geoip.txt | awk '/^[^#]/ { print $1 }' | sudo xargs -I {} ufw deny from {} to any

i appreciate your insights in advance tnX

Doug Smythies avatar
gn flag
ufw is just a front end for iptables. ipset can be used with iptables as a way to decide what to do with a large lists of ip addresses. It loads relatively quickly. I do not know how to do it within ufw.
Amin avatar
in flag
hmm not sure then whats wrong i try to added just 1 country it took 2 days to finish on my VPS!
Doug Smythies avatar
gn flag
Yes, the one ip address at a time method is very slow. If you want to try the ipset method see [here](https://askubuntu.com/questions/868334/block-china-with-iptables).
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.