Skip to content

Nuface Blog

隨意隨手記 Casual Notes

Menu
  • Home
  • About
  • Services
  • Blog
  • Contact
  • Privacy Policy
  • Login
Menu

OPNsense 25.x GeoIP Configuration with New MaxMind Authorization

Posted on 2025-11-11 by Rico

🧠 1. Background

Starting from OPNsense 25.x, the GeoIP function is now integrated into the core system, no plugin installation is required.
However, the authorization method has changed — you now must use both Account ID and License Key in the download URL.


⚙️ 2. Generate License Information on MaxMind

1️⃣ Sign up at MaxMind GeoLite2.
2️⃣ Find your Account ID on your dashboard.
3️⃣ Go to My Account → Manage License Keys, click Generate New License Key.
4️⃣ Enable ✅ “Yes, this key will be used for GeoIP Update Program.”
5️⃣ Copy the generated License Key.


🌐 3. Configure GeoIP in OPNsense

1️⃣ Open OPNsense → Firewall → Aliases → GeoIP settings
2️⃣ Enter this URL pattern in the “URL” field:

https://AccountID:LicenseKey@download.maxmind.com/geoip/databases/GeoLite2-Country-CSV/download?suffix=zip

📘 Example:

https://123456:AbCdEfGhIjKlMnOpQrStUvWxYz123456@download.maxmind.com/geoip/databases/GeoLite2-Country-CSV/download?suffix=zip

3️⃣ Click Apply, then wait for the database to download.


✅ 4. Verification

After downloading successfully, you’ll see:

  • Last Updated: shows a timestamp
  • Total Ranges: lists millions of entries

That means GeoIP data is now ready for use.


🔒 5. Example Usage

Block China and Russia:

Action: Block  
Source: BLOCK_CN_RU  
Destination: any

Allow VPN access only from specific countries:

Action: Pass  
Source: VPN_ALLOWED  
Destination: WAN address (VPN port)

⚡ 6. Notes and Best Practices

ItemRecommendation
Auth RequirementUse Account ID + License Key
URL FormatMust include “@download.maxmind.com”
Database TypeGeoLite2-Country (CSV)
Update CycleAuto monthly or manual Apply
PerformanceIncrease pf table entries to 4 M+

✅ 7. Summary

VersionGeoIP MethodAuth ModelConfig PathURL Pattern
≤ 24.7Plugin os-geoipLicense Key onlyServices → MaxMindSimple URL
≥ 25.xBuilt-in coreAccount ID + License KeyFirewall → Aliases → GeoIP Settingshttps://AccountID:LicenseKey@...

Recent Posts

  • Postfix + Let’s Encrypt + BIND9 + DANE Fully Automated TLSA Update Guide
  • Postfix + Let’s Encrypt + BIND9 + DANE TLSA 指紋自動更新完整教學
  • Deploying DANE in Postfix
  • 如何在 Postfix 中部署 DANE
  • DANE: DNSSEC-Based TLS Protection

Recent Comments

  1. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on High Availability Architecture, Failover, GeoDNS, Monitoring, and Email Abuse Automation (SOAR)
  2. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on MariaDB + PostfixAdmin: The Core of Virtual Domain & Mailbox Management
  3. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Daily Operations, Monitoring, and Performance Tuning for an Enterprise Mail System
  4. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Final Chapter: Complete Troubleshooting Guide & Frequently Asked Questions (FAQ)
  5. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Network Architecture, DNS Configuration, TLS Design, and Postfix/Dovecot SNI Explained

Archives

  • December 2025
  • November 2025
  • October 2025

Categories

  • AI
  • Apache
  • Cybersecurity
  • Database
  • DNS
  • Docker
  • Fail2Ban
  • FileSystem
  • Firewall
  • Linux
  • LLM
  • Mail
  • N8N
  • OpenLdap
  • OPNsense
  • PHP
  • QoS
  • Samba
  • Switch
  • Virtualization
  • VPN
  • WordPress
© 2025 Nuface Blog | Powered by Superbs Personal Blog theme