Want to do GeoIP block. OPNsense or OpenWRT?

Hello all. I have my proxy (Nginx Proxy Manager) opened to the internet. I have fail2ban reading the logs. I want to add a GeoIP block to only let IPs in my country to access it. This should give another layer of security.

I starting taking a look at OPNsense (maybe a forbidden router?) but I also saw that OpenWRT has some packages available to that end. I want to do DNS and NTP also in the router, but both should be capable of that. So:

  1. Does OpenWRT have support to do GeoIP blocking and it is good enough?
  2. If not, OPNsense would be better?
1 Like

noice

if you are using a desktop, this is the way

is for repurposing consumer grade routers
has a place, but not at the level you are playing

2 Likes

Good idea.
My logs tell me that a good chunk of attacks on my server originate from IPs registered overseas.
However, another chunk (about the same size) originate from cloud services (really any cloud service you know and some you don’t - yet).

2 Likes

Meet OpenVPN :roll_eyes: (<-link!)

Or basically any VPN provider worth their salt these days. Or Tor :stuck_out_tongue: Which is essentially a multi-step VPN in itself.

I would buy a router for that with good support. My main motivation to use OpenWRT is to use a low power device to do all, router, firewall and Wifi.

I would block all that.

If you are advising me to use it, I already use Wireguard. If you are telling me that an attacker in another country can use it to simulate to be in mine, I know it is not bulletproof, but I would be making things more difficult to them.

Good idea :smiley:

In my experience geo blocking brought malicious traffic down by a lot, and I mean a lot. For a motivated attacker it’s a speed bump, but casual wannabe hackers, bots - waaay down. I still get some from local cloud providers and infected WordPress instances but nowhere near what was coming from China, US and Russia - my top 3 sources of malicious traffic.

1 Like

So I know that OPNsense is better, but it is OpenWRT not enough?

1 Like

There is nothing wrong with using either router OS solution.
For OpenWRT there is a plug-in that has a luci component that allows for country blocking (among others).

If you have the resources I would suggest you spin up a forbidden router of each OS and play around with both. I love pfsense (with pfblockerNG) but flipped back to openwrt about 4 months ago and its been rock solid for all of my needs and I run both as a VMs on proxmox with zero issues like this.

We all have preferred OSes but its not often a common feature such as geoblock is unavailable on a popular platform. I respect TryTwice’s opinion but the comment openwrt is meant to repurpose consumer grade and not good for what the OP asked is a point I would disagree with.

Anyway you choose, share your results and good luck!

2 Likes

Yeah I just use pfSense with pfBlockerNG for this for the same reasons.

I mean sure, you end up needing two boxes instead of one so potentially double the power consumption, but its not like going from 12W to 24W is a huge deal. Plus using an enterprise WiFi Access Point is just so much more reliable than a consumer router in my experience.

I’m so used to how to configure rules in pfSense now, I haven’t a clue how I would replicate them on OpenWRT.

If you are looking for a straightforward solution with built-in GeoIP blocking and a user-friendly UI, OPNsense is likely the better choice for your needs. OPNsense has a more user-friendly interface tailored for routing and firewall management. Its kind of a no brainer here. OpenWRT is simpler and you can accomplish the task. However OpenWRT does not natively support GeoIP blocking out of the box. It can be accomplished through third-party packages and scripts. For example, you can use ipset with GeoIP databases to block incoming requests based on country but its not as robust or as effective as opnsense can provide and it cant do much IDS IPS

Block everything, allow only selected IPs.

If the server does not provide services that must be relatively publicly accessible, then I see no point in leaving the server open even for 10% of the internet.

1 Like

Accessing from mobile data gives you a new IP every time (I think) and the server has services only for my close family, so not so easy to put all behind a VPN.

Just and update of the thread. I used geoip-shell for the last month in my Nginx VM, it seems that OpenWRT would be enough for me, but I decided to go all in and I will recieve this week a pair of Wyse 5070 and an Optiplex 3000 Thin Client that I will test to do and OPNsense router to learn and play.

1 Like