Block countries based on Geo data with UFW firewall

I while ago, I wrote this post about how to block all network traffic from-and-to certain countries using UFW firewall based on recent Geo data. The statistics of this website show that this post is still one of the most popular posts here. Many people found their way here through Google searches like: UFW, Geo and Block. If you happen to be one of these people, welcome! You came to …

Block all traffic from a Geo-located country with UFW firewall on Ubuntu

Update 30-7-2023 – This post is a bit old. I have written a new article on the subject. Check it out here: https://www.ustoopia.nl/featured/block-countries-based-on-geo-data-with-ufw-firewall/ I was noticing some really strange requests in my web server’s log files on a VPS that I manage. Requests that seem to be focused on finding vulnerabilities or exploits. Turns out, most of the originating IP addresses are from China. Since the VPS is not behind …