os-upnp plugin not working?

Started by Warbreaker, July 16, 2026, 03:12:47 PM

Previous topic - Next topic
I dug into the `?` showing up for the redirect target a bit more, and it looks like the actual problem is upstream in miniupnpd rather than the OPNsense plugin itself.

Basically, miniupnpd isn't setting the address family on the PF pool address when it creates the rule. Older PF behavior hid that, but the newer PF/pfctl changes in 26.7 expose it as `?` even though the mapping itself still works.

I submitted a small upstream fix here:

https://github.com/miniupnp/miniupnp/pull/906

It's only a two-line change at the two affected `DIOCADDADDR` call sites. If it gets accepted and eventually makes its way into OPNsense, the existing UPnP plugin should start showing the correct IPs again without needing any changes to the plugin itself.

Figured I'd post it here in case anyone else was following the same issue.

Wow, nice find!  Took the liberty to fold this into the ports tree for tomorrow's 26.7.3:

https://github.com/opnsense/ports/commit/2616876aaa


Cheers,
Franco

Quote from: franco on Today at 03:03:18 PMWow, nice find!  Took the liberty to fold this into the ports tree for tomorrow's 26.7.3:

https://github.com/opnsense/ports/commit/2616876aaa


Cheers,
Franco

Will this solve the original problem with UPnP plugin with 26.7 or do we still need to manually configure the NAT mode from automatic to hybrid and add a source NAT rule as described as a fix earlier in this thread?

Well to answer the other question first: the plugin is in community support mode and the code is still based on the static PHP pages. It's not going to get a lot of maintenance, but if patches exist like here we can do something about it.

About the NAT rule I'm not sure.  The built-in automatic rule no longer works?  Why?  This wasn't changed so it may be a FreeBSD change.  But it's also possible for people who still have a 26.1.x to test to compare the /tmp/rules.debug file to see if anything shifted between versions, which I doubt a bit, but not impossible.


Cheers,
Franco

Quote from: franco on Today at 04:06:46 PMWell to answer the other question first: the plugin is in community support mode and the code is still based on the static PHP pages. It's not going to get a lot of maintenance, but if patches exist like here we can do something about it.

About the NAT rule I'm not sure.  The built-in automatic rule no longer works?  Why?  This wasn't changed so it may be a FreeBSD change.  But it's also possible for people who still have a 26.1.x to test to compare the /tmp/rules.debug file to see if anything shifted between versions, which I doubt a bit, but not impossible.


Cheers,
Franco

Out of curiosity, would you be open to a community-driven migration of os-upnp to the newer MVC framework? I'd be interested in taking a look at it, but I'd want to make sure that's a direction you'd actually want before going too far down that road.

Yes, I'd like to review and help shape the effort. But I have to say that I don't have a lot of time these days so this could be a longer effort.

The person who did the recent updates on the plugin and port was also open to this direction.

Eventually it has to be done either way as we aim to remove the static PHP pages within the next five years.


Cheers,
Franco