Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - hacesoft

#1
Good day, I have released version 2.1. which supports Dnsmasq DNS & DHCP.
Again I look forward to your reactions :).

The link is:

https://github.com/hacesoft/opnsense-devicemonitor
#2
Quote from: mooh on April 21, 2026, 10:01:40 PM
Quote from: hacesoft on April 21, 2026, 06:51:56 PMNot every plugin is for everyone — install what fits your needs. 🙂
I didn't mean to belittle your effort. In fact, I appreciate every effort to improve OPNsense.

I just not sure what the size of the target audience for all this host discovery stuff is, yours and the new component of OPNsense. If I want to know what's going on on my network, I ask it directly via SNMP or an all-in-one solution like Unifi or Omada. Only small, unmanaged networks don't already provide that functionality. How many are there using OPNsense?

Hello, I recently switched from pfSense to OpnSense and this option was standard in the system and I use it to check if an uninvited guest is connecting. Or when I connect a device, I find out its IP address. I don't have unifi, or rather I only use AP AC RL and I have a classic L2, L3 switch. So OpnSense will provide me with the necessary information :). I originally wrote the plugin just for myself, but I decided to share it with others... I would like the plugin to be offered as a standard package, but that's too much for me for now :).
#3
Quote from: SteffenDE on April 23, 2026, 07:49:14 AM
Quote from: hacesoft on April 21, 2026, 06:38:33 PMHi Steffen,
The hostname field works as follows: the plugin pulls the hostname from Services → ISC DHCPv4 / DHCPv6 → DHCP Static Mappings — specifically the Hostname field for each entry. If a device doesn't have a static mapping with a hostname defined there, the field will simply remain empty, as the plugin has no other automatic source for this information.
You can also fill in the hostname manually directly in the plugin, but note that this is stored only in the plugin's own database — it does not propagate back to OPNsense DHCP or any other system.
So the short answer: populate the Hostname field in your DHCP static mappings and it will appear automatically.

I have hostnames defined at Dnsmasq because I think ISC is deprecated. So it would be nice to support Dnsmasq too.
Good day, I just converted my home network from ISC to DNSmasq and it will take a while before I get to it and modify the plugin. but don't worry, it will happen :).
#4
Quote from: pc44 on April 23, 2026, 09:42:44 PM
Quote from: pc44 on April 23, 2026, 04:26:58 AMI have an older version of Device Monitor installed and working.  It is great !!!

I am happy with it, but is there a way to update to this new version, or do I need to fully uninstall/reinstall?

Thank you.

Figured it out.  Deleted the existing /tmp/opnsense-devicemonitor folder.  Then downloaded, unzipped, and copied over the new files.  Then just re-ran sh install.sh.

Now up-to-date. ☑️
Good day, exactly as you asked. If you use sh install.sh, everything except the database will be deleted before installation. After installation, the plugin will be started again. If you use sh uninstall.sh, everything will be removed.
#5
Quote from: mooh on April 21, 2026, 03:30:38 PMI would like to see this software rolled into one plugin together with the device discovery service added to OPNsense recently. There's some overlap in functionality.

Then again, unless the information is accumulated over a multi-layer network, i.e. across routers, I could just as well query the network management software for it. I can see how filtering MACs into FW Aliases can be useful if one manages networks on the basis of MAC addresses, but I don't.

The primary motivation for building this plugin was notifications — automatically alerting me (via email or webhook) whenever a new or unknown device appears on the network. That's the core value-add, and it's something OPNsense still doesn't provide natively. Everything else — custom hostnames, clickable URLs, having it all in one place — is convenience on top of that.
An important part of the plugin is also device identification — it works on several levels: hostname (pulled from DHCP static mappings, or filled in manually by the admin), a custom admin note, and vendor identification resolved from the MAC address prefix (OUI lookup). This has been part of the plugin since v1.0.
Regarding merging with the native discovery service: Device Monitor v2.0 already builds directly on the hostwatch database (/var/db/hostwatch/hosts.db), so that overlap has been intentionally addressed. Interestingly, hostwatch didn't exist at all when I started writing the plugin — it was added somewhere between v1.0 and v2.0, and I was happy to take advantage of it. The plugin no longer does its own ARP/tcpdump scanning. A nice case of the platform catching up mid-project. 🙂
On your multi-layer network point: you're right — like hostwatch itself, this plugin only sees devices on directly connected segments. For deeper topologies a dedicated NMS like LibreNMS or Zabbix would be the proper tool. This plugin targets setups where OPNsense is the network edge.
Not every plugin is for everyone — install what fits your needs. 🙂
#6
Quote from: SteffenDE on April 20, 2026, 03:16:58 PMHi,

Nice tool, not perfect yet but provides a good overview.

But what doesn't seem to work at all is the hostname, which is always unfilled?


Steffen

Hi Steffen,
The hostname field works as follows: the plugin pulls the hostname from Services → ISC DHCPv4 / DHCPv6 → DHCP Static Mappings — specifically the Hostname field for each entry. If a device doesn't have a static mapping with a hostname defined there, the field will simply remain empty, as the plugin has no other automatic source for this information.
You can also fill in the hostname manually directly in the plugin, but note that this is stored only in the plugin's own database — it does not propagate back to OPNsense DHCP or any other system.
So the short answer: populate the Hostname field in your DHCP static mappings and it will appear automatically.
#7
Version 2.0 is released today. Completely redesigned :). And it already looks usable :).
#8
Good day, here is a link to the latest version of my Device monitor plugin: https://github.com/hacesoft/opnsense-devicemonitor
#9
Quote from: Seimus on January 02, 2026, 01:27:06 PMWould it be possible to have as well notifications via webhook e.g to support ntfy instances?


Have a nice day, I added support for webhook, ntfy and custom
#10
Quote from: Monviech (Cedrik) on January 02, 2026, 01:29:13 PMHello,

there is a new hostdiscovery service on the OPNsense roadmap that uses a rust written daemon that captures arp and ndp messages via pcap to build a database of known devices.

https://github.com/opnsense/hostwatch

https://github.com/opnsense/core/pull/9354

So something comparable is a core feature soon and integrated into a few components like aliases and captive portal.

So as feedback, you could use the existing sqlite database of the hostwatch service since its in core anyway if you want your own GUI around it.

Have a nice day, it's not yet :), so I'll use my own solution. My plugin can even display devices that don't have an IP address :). And in the DHCP settings, 'Deny unknown clients' is enabled, then I only get the MAC address, which is what I wanted :). And to send the result by email :). If the future add-on works the same or even better, I'll use that, for now I have this :).
#11
Quote from: Seimus on January 02, 2026, 01:27:06 PMLooks interesting, and remembers me on NetalertX.

Few questions here:
QuoteRequirements

    1. OPNsense 24.x or newer
    2. Working SMTP configuration (System → Settings → Notifications)
    3. SSH access enabled (System → Settings → Administration → Secure Shell)
    4. Root password

2. Working SMTP configuration (System → Settings → Notifications)
Would it be possible to have as well notifications via webhook e.g to support ntfy instances?


3. SSH access enabled (System → Settings → Administration → Secure Shell)
4. Root password
Does this work only with a Root account? Or does this work with any active admin account with proper permissions?

Regards,
S.

Good day, it definitely wouldn't be a problem to use a webhook to send data instead of email notifications. I have something similar planned at home, where I will be sending data to a protocol center that I have on my NAS in BSD format (RFC 3164). I have the ROOT account disabled on the firewall, and I have my own Admin account on which the plugin works nicely.
#12

Hello everyone! 👋
I've created my first OPNsense plugin:
https://github.com/hacesoft/opnsense-devicemonitor

And would like to share it with you. It's called Device Monitor - a tool for automatic network device monitoring and detection.
What the plugin does:

🔍 Automatic network device scanning (ARP + DNS)
📊 Online/offline status display
🔔 Email notifications for new device detection
🏷� Manufacturer identification using OUI database
📈 Dashboard with device overview

Technical details:

Python daemon with configurable scan interval
MVC architecture following OPNsense standards
REST API for control
Czech and English translations

The plugin is fully functional, but definitely not perfect. I would love to hear your feedback:

What could I improve?
What features would be useful?
Where did I make mistakes or violate best practices?
Any suggestions for improvements!

I'm open to constructive criticism and looking forward to your insights. Thanks for your time! 🙏
#13
Thank you for your response and recommendations
I'd like to clarify a few things about my configuration:
DNS and hostname:
I'm using internal DNS (firewall.local), I don't have any DynDNS or public domain. I've already created an Unbound DNS override (firewall.local → LAN IP).
Problem resolution:
The problem wasn't NAT Reflection or DNS - the entire issue was a missing firewall rule. The WiFi VLAN was completely isolated and had no access to the firewall, so it couldn't reach the OpenVPN port either. After adding a rule that allows WiFi VLAN → Firewall IP:2000/UDP, everything works.
Security concerns:
Although the problem is solved, I'm not happy with this solution from a security standpoint. By opening a rule from WiFi VLAN to the firewall, I've essentially "punched a hole" in the isolation I originally didn't want.
Original intent:
My goal was to have the WiFi VLAN completely isolated from the local LAN network. Anything from WiFi VLAN that needs access to LAN should only be available through the VPN tunnel. I'm aware that without a valid certificate, nobody can connect to OpenVPN, but I still don't like that WiFi devices have direct access to the firewall IP.
#14
Hello,
I need help with a MaxMind GeoIP problem in OPNsense. The GUI doesn't load the database, even though I'm setting everything up according to the documentation.

🎯 My goal:
I wanted to use a GeoIP alias to block selected countries (CN, RU, IR, KP, BY) on the WAN interface.

📋 Procedure according to documentation:
I followed the official guide:
https://docs.opnsense.org/manual/how-tos/maxmind_geo_ip.html
1. Creating MaxMind account:

Registered at https://www.maxmind.com/en/geolite2/signup
Generated Account ID and License Key

2. Creating URL with authentication:

According to the guide, I created a URL in the format:

  https://ACCOUNT_ID:LICENSE_KEY@download.maxmind.com/geoip/databases/GeoLite2-Country-CSV/download?suffix=zip
3. Testing URL in browser:

Pasted the URL into browser
✅ Database downloaded successfully (5.2 MB ZIP file)
Extracted it on my computer and checked the content
Files contain correct CSV files according to documentation:

GeoLite2-Country-Locations-en.csv
GeoLite2-Country-Blocks-IPv4.csv
GeoLite2-Country-Blocks-IPv6.csv



4. Configuration in OPNsense GUI:

Firewall → Aliases → GeoIP settings
Pasted URL into "Url" field
Clicked "Apply"

5. Creating GeoIP alias:

Firewall → Aliases → IP → Add
Name: Blocked_Countries
Type: GeoIP
Countries: CN, IR, KP, BY, RU
Save

6. Creating firewall rule:

Firewall → Rules → WAN → Add
Action: Block
Source: Blocked_Countries alias
Save → Apply


❌ Problem:
GUI doesn't load the database:

After applying URL in GeoIP settings, nothing happened
Total number of ranges: 0 (stayed at zero)
Warning: "In order to use GeoIP, you need to configure a source in the GeoIP settings tab"
Firewall rule with GeoIP alias doesn't work - nothing is blocked

Console check:
bashpfctl -t Blocked_Countries -T show
# Empty - no IP addresses

🔧 Alternative solution (SSH workaround):
Since GUI doesn't work, I tried to bypass the problem via SSH:
1. Manual download and installation of database:
bash# Download database
curl -L -o /tmp/GeoLite2-Country.tar.gz \
  -u ACCOUNT_ID:LICENSE_KEY \
  'https://download.maxmind.com/geoip/databases/GeoLite2-Country/download?suffix=tar.gz';

# Extract
cd /tmp
tar -xzf GeoLite2-Country.tar.gz

# Copy MMDB to correct directory
find . -name "*.mmdb" -exec cp {} /usr/local/share/GeoIP/ \;
chmod 644 /usr/local/share/GeoIP/*.mmdb

# Verification
ls -lh /usr/local/share/GeoIP/
# Result: GeoLite2-Country.mmdb (9.5 MB)
2. Refresh aliases:
bashconfigctl filter refresh_aliases
{"status": "ok"}
3. Functionality test:
bash# Number of IP addresses in table
pfctl -t Blocked_Countries -T show | wc -l
491970

# Test specific Chinese IP
pfctl -t Blocked_Countries -T test 1.0.1.1
1/1 addresses match.

# Check firewall rule
pfctl -vsr | grep -A 5 "Blocked_Countries"
block drop in log quick on pppoe0 ... from <Blocked_Countries> to any
[ Evaluations: 42    Packets: 0    Bytes: 0    States: 0 ]
✅ It works! GeoIP alias contains 491,970 IP ranges and blocking works.
4. Automating updates - creating update script:
bash# Create script
cat > /usr/local/bin/update-geoip.sh << 'EOF'
#!/bin/sh
curl -L -o /tmp/GeoLite2-Country-CSV.zip \
  -u ACCOUNT_ID:LICENSE_KEY \
  'https://download.maxmind.com/geoip/databases/GeoLite2-Country-CSV/download?suffix=zip';

/usr/local/sbin/configctl filter refresh_aliases

echo "GeoIP database updated: $(date)"
EOF

# Set permissions
chmod +x /usr/local/bin/update-geoip.sh

# Test script
/usr/local/bin/update-geoip.sh
# Result: {"status": "ok"}
# GeoIP database updated: Sat Nov 1 22:14:05 CET 2025
5. Setting up cron job in GUI:

System → Settings → Cron → Add
Minutes: 0
Hours: 3
Days of week: 2,5 (Tuesday, Friday)
Command: /usr/local/bin/update-geoip.sh
Description: Update GeoIP database
Save → Apply


✅ Result of workaround solution:

✅ GeoIP blocking works
✅ 491,970 IP ranges from CN, RU, IR, KP, BY
✅ Automatic updates twice a week
✅ Firewall rule active and blocking

BUT:

❌ GUI still shows Total number of ranges: 0
❌ Warning in GUI still present


💻 My environment:

OPNsense: Tested on both Community Edition 25.7.6 and Business Edition 25.10_2 - same problem on both
MaxMind: GeoLite2-Country (free)
Formats: Tried CSV (zip) and MMDB (tar.gz) - GUI doesn't load either


❓ Questions:

Why doesn't the GUI load the database from MaxMind URL, even though it downloads successfully in browser?
Is this a known issue in OPNsense 25.7.6 / 25.10_2?
Is there a way to get standard GUI downloading to work?
Or is my SSH workaround an acceptable long-term solution?

Thank you for any help
#15
Hello,
I need help with an OpenVPN connection problem from my local network.
🎯 What I want to achieve:
Connect to OpenVPN server from my mobile phone, whether I'm connected on mobile data (outside) or on my home WiFi VLAN.

✅ What works:

Connection to OpenVPN from the internet (mobile data) works perfectly
OpenVPN server runs on UDP port 2451
Certificate-only authentication (without username/password) works


❌ What doesn't work:

Connection to OpenVPN from home WiFi VLAN - cannot establish connection
Mobile phone is connected to WiFi VLAN which has no access to home LAN (it's isolated)
Trying to connect to WAN IP/hostname of the firewall


🔧 What I have configured:
OpenVPN server configuration:

Protocol: UDP
Port: 2451
Bind address: 0.0.0.0

Client Export configuration:

VPN → OpenVPN → Client Export → Custom config:

  proto udp
  remote firewall.local 2451
NAT Reflection - I tried:

First attempt: NAT Reflection on specific WiFi VLAN interface

Interfaces → [WiFi_VLAN] → Settings → NAT Reflection


Second attempt: Global NAT Reflection

Firewall → Settings → Advanced → Network Address Translation
✅ "Reflection for port forwards" - enabled
✅ "Reflection for 1:1" - enabled



Result: Neither works - still cannot connect from WiFi VLAN.

💻 My environment:

OPNsense: Tested on both Community Edition 25.7.6 and Business Edition 25.10_2 - same problem on both
OpenVPN server: UDP on port 2451
WiFi VLAN: Isolated from LAN, but has internet access through WAN


❓ Question:
How to properly configure OPNsense so that OpenVPN works when connecting from local WiFi VLAN?
Do I need a special firewall rule? Or different NAT Reflection settings? Or maybe a completely different approach?
Thank you for any advice!