0

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

Amin
  • 156
  • 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. – Doug Smythies Mar 15 '23 at 14:53
  • hmm not sure then whats wrong i try to added just 1 country it took 2 days to finish on my VPS! – Amin Mar 16 '23 at 07:29
  • 1
    Yes, the one ip address at a time method is very slow. If you want to try the ipset method see here. – Doug Smythies Mar 16 '23 at 14:46

0 Answers0