How can I block traffic from certain countries please?

Started by g0nz0uk, June 06, 2025, 03:23:23 PM

Previous topic - Next topic
Hello,

My friend has bought the Ubiquity Dream Hub for his router/firewall, yeah it's very nice.  He's blocking traffic from China/Russia etc and I'd like to do the same with my OPNsense firewall.  How are you doing this on yours?

I use Grafana a lot and I'd love to plot the geo locations on there too, has anyone done this too?

Thanks

You need to register an account with Maxmind to be able to download the free geolocation database. Then you can create firewall aliases based on country.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Sure I can do that, but what would I then need to do in the OPNsense GUI to use this?

Something like this https://docs.opnsense.org/manual/how-tos/maxmind_geo_ip.html

Exactly. As I wrote - with the subscription in place and active go to Firewall > Aliases and create GeoIP aliases by the country as you see fit. Then use these in firewall rules.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)