OPNsense Forum

Archive => 21.1 Legacy Series => Topic started by: thecodemonk on April 02, 2021, 05:29:23 pm

Title: Having some UPnP issues.
Post by: thecodemonk on April 02, 2021, 05:29:23 pm
I'm am a long time pfSense user (at work) that has had a R7000 with FreshTomato on it at home. Since my R7000 is about 8 years old and the wifi is starting to have issues, I decided to roll my own stuff at home instead of getting Orbi's or a Netgear wifi 6 mesh system. I bought a Protectli box and was going to use pfSense, but decided to give opnsense a go. I installed everything last night and configured it for my network and got the new access points wired up to the new switch (it's a managed netgear switch with poe).

I installed the upnp plugin. At home, I have a PS4, a few gaming PCs, and 4 Nintendo Switches. The kids often play multiplayer Minecraft and I play Warzone on my PC, as well as some various multiplayer PS4 games.

On FreshTomato, it was just ticking off the boxes and going and I would get open nat in Warzone and minecraft worked fine for the kids. With opnsense, I'm not having any luck at all.

After many hours of troubleshooting, I'm kind of stuck now and need some assistance. I doesn't seem to be working at all. In the status page of the upnp plugin, no mappings ever show up. However! I downloaded a upnp tool that lets you send requests to discovered devices. So when I do the AddPortMapping request, it actually says success. If I use the GetSpecificPortMappingEntry request, it returns what I requested, but it still doesn't actually show up in the upnp status page.

I have default deny turned off, but I have also tried adding my PC's IP and a large port range to the permissions, and I got the same result. In the routing log, I don't see any errors for requests. And in outbound nat, I have it in hybrid mode, and a rule for source lan net with the wan address at the nat address and static port enabled. I did not try to put my specific PC address in there, but I don't think this even comes into play yet.

I've uninstalled the plugin and re-enabled as well as just reinstalling it. I've disabled/reenabled and still no go.

I also attempted to turn off IGMP snooping in my switch, but since it's a cloud managed device (for now, I'm going to be turning that garbage off this weekend), I decided to just plug the switch my PC is on into the lan port of the firewall and plug my poe switch into my standard unmanaged lan switch. Still doesn't seem to work.

I'm really confused that the upnp test app says success and I'm not seeing the rule in the status list. I disabled the upnp and did the requests again, just to make sure it wasn't responding, just in case it thought it was sending it to the router when something else on the network was messing with it, but it does fail with it disabled.

I'm kind of at a loss for what to try next. While I could just put in manual port forwards for everything, minecraft could be a little more difficult, and I'm not sure what other games the kids are playing that might need port forwarding. I'd rather this be a little more hands off. Once it is working, I'll turn on the default deny and start ACL'ing this. So, any ideas?
Title: Re: Having some UPnP issues.
Post by: ZPrime on April 03, 2021, 04:32:55 am
Turn on UPnP

Then, Firewall -> NAT -> Outbound

Switch the radio buttons at the top to "Hybrid outbound NAT"
Now, either setup a rule for the entire LAN subnet, or configure your game systems/consoles to be in a sub-subnet (e.g. a /29 or /28 out of your LAN /24), and setup a rule for just that chunk... you want "Static Port = Yes" for the problem systems.

Again, this is just for outbound traffic, it insures that the firewall doesn't shuffle around the source port on the WAN side.

As long as UPnP is enabled and setup correctly, and you have static port outbound NAT for the game systems, this should take care of it.
Title: Re: Having some UPnP issues.
Post by: packet loss on April 03, 2021, 05:06:54 am
And in outbound nat, I have it in hybrid mode, and a rule for source lan net with the wan address at the nat address and static port enabled.

ZPrime he already has his outbound NAT using hybride mode with a single rule with static-ports for his entire LAN network.

thecodemonk, I recently installed OPNsense within the last week and configured everything manually. I use upnp as well and also noticed no mappings were shown under upnp -> status. So I was experiencing the same issue as you. I reinstalled the upnp plugin. That did not seem to fix the issue. I then reinstalled miniupnpd under packages and then rebooted OPNsense. After that, mappings started to show up under upnp -> status.

Make sure you reboot your consoles or PC. I've noticed my Xbox or PS5 won't send AddPortMapping requests after they are up and running so no port mappings will show up in OPNsense until you reboot. But this isn't always the case.

Let me know if this works for you.
Title: Re: Having some UPnP issues.
Post by: ZPrime on April 03, 2021, 09:56:59 am
And in outbound nat, I have it in hybrid mode, and a rule for source lan net with the wan address at the nat address and static port enabled.

ZPrime he already has his outbound NAT using hybride mode with a single rule with static-ports for his entire LAN network.

Sorry about that... I shouldn't be replying at 4am local time. :p

Quote
Make sure you reboot your consoles or PC. I've noticed my Xbox or PS5 won't send AddPortMapping requests after they are up and running so no port mappings will show up in OPNsense until you reboot. But this isn't always the case.
I can confirm that with Xbox at least, it sometimes doesn't want to map. What sometimes helps (and avoids a lengthy reboot) is to get into the networking section and check/test the NAT status. If it still doesn't map after that, there's a secret code (IIRC it's hold both triggers and then hit both bumpers simultaneously) that gives you a "more details" screen, and after bringing that up and then checking NAT status again, it usually seems to force the mapping.

UPnP is so great in theory, but the practice/execution is very janky at times...
Title: Re: Having some UPnP issues.
Post by: zyon on April 03, 2021, 12:20:45 pm
Why do not just create alias group for devices and port
Then Port forward with group, you’re already in hybrid nat

And remove upnp ;)
Title: Re: Having some UPnP issues.
Post by: cranky on April 03, 2021, 02:17:24 pm
Hi, i was facing the same issue, could not get OPEN nat on xboxlive or battle.net (warzone).
I finally fixed it after a whole week!!!!

Things i did to get it working.
1. forward all nescesarry ports like normal.
2. turn outbound on to hybrid.
3. add a static outbound with static port

(see my screenshots)

If you need more then one device to have OPEN nat, remove the forwards (leave static route and hybrid), and install and run UPNP.

Hope this helps, cheers.
Title: Re: Having some UPnP issues.
Post by: packet loss on April 03, 2021, 03:17:59 pm
Why do not just create alias group for devices and port
Then Port forward with group, you’re already in hybrid nat

And remove upnp ;)


This is just not feasible in a gaming household. Too many games, too many consoles and PC's running at the same time playing games. The amount of ports one would have to port forward would be unreasonable.

But as cranky has shown and what you are suggesting is an alternative method that does work. Although, it's just not suitable for my network.
Title: Re: Having some UPnP issues.
Post by: thecodemonk on April 04, 2021, 03:12:29 am
Thanks for all the suggestions, but even after reinstalling miniupnpd, and then removing os-upnp and reinstalling everything, it's still not working for some reason.

Upon install of os-upnp, this is in the install window:
Code: [Select]
*** !!WARNING!! !!WARNING!! !!WARNING!! ***
This port allows machines within your network to create holes in your
firewall.  Please ensure this is really what you want!
*** !!WARNING!! !!WARNING!! !!WARNING!! ***

For this daemon to work, you must modify your pf rules to add an anchor
in both the NAT and rules section.  Both must be called 'miniupnpd'.
Example:

# NAT section
# UPnPd rdr anchor
rdr-anchor "miniupnpd"

# Rules section
# uPnPd rule anchor
anchor "miniupnpd"
Checking integrity... done (0 conflicting)
Nothing to do.
***DONE***

Then after going into upnp and enabling everything, I went to the routing log and this was in there:
Code: [Select]
2021-04-03T20:57:08 miniupnpd[50993] ioctl(dev, DIOCGETRULES, ...): Invalid argument
2021-04-03T20:57:08 miniupnpd[50993] ioctl(dev, DIOCGETRULES, ...): Invalid argument
2021-04-03T20:57:08 miniupnpd[50993] ioctl(dev, DIOCGETRULES, ...): Invalid argument
2021-04-03T20:57:08 miniupnpd[50993] ioctl(dev, DIOCGETRULES, ...): Invalid argument
2021-04-03T20:57:08 miniupnpd[50993] ioctl(dev, DIOCGETRULES, ...): Invalid argument
2021-04-03T20:57:08 miniupnpd[50993] ioctl(dev, DIOCGETRULES, ...): Invalid argument
2021-04-03T20:57:08 miniupnpd[50993] ioctl(dev, DIOCGETRULES, ...): Invalid argument
2021-04-03T20:57:08 miniupnpd[50993] ioctl(dev, DIOCGETRULES, ...): Invalid argument
2021-04-03T20:57:07 miniupnpd[50993] ioctl(dev, DIOCGETRULES, ...): Invalid argument
2021-04-03T20:57:07 miniupnpd[50993] ioctl(dev, DIOCGETRULES, ...): Invalid argument
2021-04-03T20:57:07 miniupnpd[50993] ioctl(dev, DIOCGETRULES, ...): Invalid argument
2021-04-03T20:57:07 miniupnpd[50993] PCPSendUnsolicitedAnnounce() IPv6 sendto(): No route to host
2021-04-03T20:57:07 miniupnpd[50993] Listening for NAT-PMP/PCP traffic on port 5351
2021-04-03T20:57:07 miniupnpd[50993] setsockopt(udp, IPV6_RECVPKTINFO): Invalid argument
2021-04-03T20:57:07 miniupnpd[50993] HTTP IPv6 address given to control points : [2601:409:200:1ab:2e0:67ff:fe22:e25d]
2021-04-03T20:57:07 miniupnpd[50993] HTTP listening on port 2189

In COD Cold war, when I open the game (after rebooting my pc) I am still get Nat Moderate and no forwarded ports listed in the upnp status.

Here are screenshots of my setup.. Am I missing something? Is there something else I need to tweak? What can I turn on to debug this? Is it a bug I need to report?

(https://ibb.co/fFsdwWn)
(https://ibb.co/WW4MFH8)
(https://ibb.co/rHVSQL8)

The images aren't showing up in the embed, so I just attached them.
Title: Re: Having some UPnP issues.
Post by: ZPrime on April 04, 2021, 06:05:33 am
I can confirm you’re not crazy, something is wrong with UPnP for me too (on 21.1.4).

I’d be happy to provide more info if I knew what would help.
Title: Re: Having some UPnP issues.
Post by: thecodemonk on April 04, 2021, 07:41:39 am
Well, I think my first step is going to be figuring out if miniupnpd was upgraded and if it was, I'll revert to a previous version. If that still doesn't work, I'll revert opnsense to the last version and test. I'll report what I find tomorrow. I'm going to have to plan this out though as the wife and kids won't like being without internet. Lol
Title: Re: Having some UPnP issues.
Post by: xpendable on April 04, 2021, 04:59:03 pm
I have uPnP setup and working fine with COD Warzone, however my setup is a bit different then yours...

Firewall/Settings/Advanced:
Reflection for port forwards = unchecked/disabled
Automatic outbound NAT for Reflection = unchecked/disabled

Firewall/NAT/Outbound:
Interface    Source    Source Port    Destination    Destination Port    NAT Address            NAT Port    Static Port    Description
WAN         LAN net   udp/ 3074      *                   udp/ 3074           Interface address      *               YES                       Allow Static-Port mapping for COD

uPnP:
Default Deny = checked/enabled
Use System Time = unchecked/disabled
Entry 1 = allow 1024-65535 192.168.0.0/24 1024-65535

I just used the example values for this post for the uPnP Entry 1 rule, be sure to use your own subnet and the port range you want to forward.

NOTE:
I have found that COD takes a while to show up in the uPnP status for some reason, maybe up to a day or so. I know it's not my setup because other uPnP services work fine without any delay or issues. I have found this is the only port needed in the NAT Outbound rules for Warzone (This also worked during the Cold War Trial) running from my PC. The network status went from Strict to Moderate and then after a day or so (as noted above), it will then show as Open once the entry appears in the uPnP status page.
Title: Re: Having some UPnP issues.
Post by: thecodemonk on April 04, 2021, 06:10:20 pm
Do you have the latest updates installed for everything?
Title: Re: Having some UPnP issues.
Post by: ZPrime on April 05, 2021, 03:16:37 am
I had some time to play around with this some more... from a Mac, using the free/open source "Port Map" app (https://www.codingmonkeys.de/portmap/), and the Mac creates a port mapping successfully.

but, by default the Mac app is using NAT-PMP and not UPnP.

When I disable NAT-PMP in OPNsense's daemon, the mac app wants to fall back to UPnP, but it's not working. It sits at "searching" forever and things are not happy. I'm not seeing anything revealing popping up in the log on opnsense though...
Title: Re: Having some UPnP issues.
Post by: thecodemonk on April 05, 2021, 05:10:13 pm
So I think I've come to the conclusion for me that it's Call of Duty that isn't working right, plus I think there might be a bug in the gui UPNP status.

The app I am using to test with will also display current port forwards and I have not been using it to check for them.. I've just been using the status page.

If I create a forward without a description, it does not display in the list. According to the specs, a description isn't required. But without a description it doesn't show in the GUI status list. I've been creating them without this whole time and seeing them not show up. Also, when testing these forwards, I haven't been closing the browser window or clearing states. I think FreshTomato must be doing that behind the scenes without telling you it is..

Anyway. My test is by running nginx on my local PC (same one that runs Warzone/Cold War) with it's default web page. I create a forward using upnp for external port 8080 and internal port 80 to my local PC. Then on my phone, I turn off Wifi, and go to http://myexternalip:8080 and see if the page comes up. Without the forward, it doesn't come up. I then close that tab, clear all the states, then create the forward. I then go to that address on my phone and the page shows up immediately. Close the tab, remove the forward using the utility, clear all states, and open a tab and go to that address and it times out.

I've tried that both with a description and without, and it works. Now, this was before reading about nat-pmp. So mine is on right now. I will test again with that turned off, but for now, it does look like this is working on my config (without changing any settings like xpendable has. I will most likely try his settings as well.

The other thing I was going to do is mirror my PC's port to another port on my switch and run wireshark so I could capture the exact settings CoD is using, but I'm having an issue with my laptop being plugged into that switch... So now I'm kind of wondering if I'm having a switch issue as well. My protectli box has 2 more optional ports that I can bridge to lan, so I may do that and plug my individual switches into those to test as well. However, with it working on my simple test with nginx, I have to believe that this is actually working, but something CoD is doing is slightly different and the real problem that needs to be discoverd.
Title: Re: Having some UPnP issues.
Post by: xpendable on April 05, 2021, 05:49:18 pm
Hi thecodemonk, I am running OPNsense 21.1.4 updated via the GUI with no patches or any manual installs.

I hope you get it all figured out, as long as you get it running with your setup is all that matters ;)
Title: Re: Having some UPnP issues.
Post by: ZPrime on April 06, 2021, 01:47:49 am
So I think I've come to the conclusion for me that it's Call of Duty that isn't working right, plus I think there might be a bug in the gui UPNP status.

The app I am using to test with will also display current port forwards and I have not been using it to check for them.. I've just been using the status page.
Curious, what app are you using to create the forwards (presumably on Windows)? I have a Win VM and a work laptop running Windows that I can break out to try a different app.

Quote
If I create a forward without a description, it does not display in the list. According to the specs, a description isn't required. But without a description it doesn't show in the GUI status list. I've been creating them without this whole time and seeing them not show up. Also, when testing these forwards, I haven't been closing the browser window or clearing states. I think FreshTomato must be doing that behind the scenes without telling you it is..
How is FreshTomato part of the scenario here, I thought you were running OPNsense?
You shouldn't need to clear states in the router to make a new port forward work.

Quote
Anyway. My test is by running nginx on my local PC (same one that runs Warzone/Cold War) with it's default web page. I create a forward using upnp for external port 8080 and internal port 80 to my local PC. Then on my phone, I turn off Wifi, and go to http://myexternalip:8080 and see if the page comes up. Without the forward, it doesn't come up. I then close that tab, clear all the states, then create the forward. I then go to that address on my phone and the page shows up immediately. Close the tab, remove the forward using the utility, clear all states, and open a tab and go to that address and it times out.
Yeah, so this proves that you are able to get a port to forward... if the opnsense GUI isn't showing that port mapping, that definitely seems like a bug.

Quote
I've tried that both with a description and without, and it works. Now, this was before reading about nat-pmp. So mine is on right now. I will test again with that turned off, but for now, it does look like this is working on my config (without changing any settings like xpendable has. I will most likely try his settings as well.
I don't know what utility you are using to create the mappings from your PC, but NAT-PMP is originally an Apple thing, so unless your utility explicitly has NAT-PMP support in it, it probably is just using UPnP.

I'm having problems with an XBox One X that is failing to get a port mapping via UPnP (and it has worked in the past with OPNsense), so there's definitely something wrong.  I have the same problem as you - wife will be upset if I break the internet to downgrade the router unless she's asleep, so I have to work around that. I'm also not exactly sure how to rollback OPNsense to an older release... Do I need to make a config backup and then fully reinstall from an older ISO?
Title: Re: Having some UPnP issues.
Post by: thecodemonk on April 06, 2021, 05:40:01 am
FreshTomato isn't in the picture. I was just referencing when I used it before I never had to clear states to get things like that to work, but I did need to in opnsense IF I had previously tried to connect just to verify it wasn't working before creating the port forward. I agree that it was weird and I shouldn't have to do that, but I've come to the conclusion that something was seriously weird and cached for me. I'll explain in a minute.

The app I was using is just called upnptest. https://www.majorgeeks.com/files/details/universal_plug_and_play_tester_(upnptest).html (https://www.majorgeeks.com/files/details/universal_plug_and_play_tester_(upnptest).html)

You can tell that app was written by someone who clearly was having upnp issues and wanted to just a quick and dirty way to figure out what was up. You may need to lookup the UPNP specs to make sure you are filling in all the right values. If you need help, I can walk you through how to use it.

So this is a kind of long story, but the tl;dr version is mine is now working fine...

Last night I was going to set my laptop up on a mirrored port on my managed switch and I was going to mirror the port my unmanaged switch is plugged into. That unmanaged switch is where my PC and PS4 are connected. I also plug my laptop into that unmanaged switch as it's my work laptop and that's what I work from all day. I plug my laptop into the managed switch and I cannot get it to work, at all. I can't get DHCP and I even tried a static mapping and it was a no go. I was in a bit of a panic as I really needed to work today. I knew I could fall back to wifi, but I was seriously concerned. I tried different ports on the switch, and nothing. So now I'm thinking my laptop ethernet port is just dead now.

So I tried rebooting it multiple times, even booting up linux because I know dang well it could just be windows being a jerk. Still nothing. Since it was almost midnight, I decided to just throw in the towel for the night. I put the laptop back on the desk, connected ethernet from the managed switch and it all starts working again. What. The. Crap.

So I decided that something was seriously messed up and this new managed switch must have an arp caching issue or something that's causing an issue here. So before I head up to bed, decided to just power everything off and let it all reboot. I turn it all off, and a minute later have to deal with the wife texting me "we have no internet again". I go to bed, and check the status of everything from my phone and it's good. Everything is back up and running.

Fast forward to this afternoon, I hear my son laughing and telling to my daughter to watch out for the skeletons. So I go see what they are doing, and they are playing multiplayer minecraft. That's odd. I didn't think it would work with upnp not working right... Check the status page, and there's a line for minecraft. What. The. Crap. I flip over to my desktop and turn on warzone. As it's loading shaders, refresh the status page, and low and behold it's listed. Go to the account page in settings, and it's nat open.... Open CoD Cold War, it's also nat type open.

Just to make sure it wasn't a fluke, I played quite a few rounds tonight with zero issues.

I have no idea what the real problem was. I'm certainly glad it's working now, but I would have really liked to know what was causing it not to work. With my laptop issue though, I'm really suspect of this managed switch. I think I'm going to turn off netgear's insight cloud BS and go back to just individually managing everything. I know for sure the local management had tools to at least view the arp cache, the cloud stuff has nothing. I would have liked to have cleared it last night when testing. Especially since when I was first setting all this up, I connected my PC to the managed switch a few times to test things out.

Anyway. I guess we can try to work through your problems and see if we can get yours working now.

If you wanted to revert, there are tools to revert packages and the OS. I would make a backup of the config first just in case you do need to reinstall from ISO if something goes wrong. https://docs.opnsense.org/manual/opnsense_tools.html (https://docs.opnsense.org/manual/opnsense_tools.html)
Title: Re: Having some UPnP issues.
Post by: 5SpeedFun on April 06, 2021, 05:44:56 pm
Hi all,

I have a LOT of experience with this.  Are both the OPNSense box & the other device on the same switch?  Are they on the same vlan?  Can they ping each other directly without going through a router?

 If so the following advice should fix it.

Option 1> IGMP SNooping on

If you are using a switch with IGMP snooping and BOTH (client) devices (& opensense) are connected to it, then do the following:

* Leave IGMP snooping on.
* Make the switch an IGMP querier (I'm assuming this is a home setup & you don't have a rendezvous point or other layer 3 device that is an IGMP querier).  If you aren't sure how to make it an IGMP Querier, post here and I may be able to help.
* Do a STATIC JOIN on your switch for the Opnsense box "lan" port and join it to 239.255.255.250.  If you aren't sure how to do a static join, post here & I can assist.

Again: If there is a "layer 3" device between the opnsense box & the upnp clients, you will need to enable PIM (if you can) or use an IGMP proxy or it won't work.

The problem with the UPNP service on OpnSense (not opnsense specific issue, it's upstream) is that it expects to work on an a "dumb" switch that floods multicast.  The upnp daemon never sends an IGMP Join to the switch (which, with IGMP snooping on, it expects).  Since the join is never received by the switch,  it never sends the <client>->239.255.255.250 traffic to the opnsense port.  That is why the static join is needed -- to force sending the client upnp requests to the opnsense box.

Option 2>  Turn IGMP SNooping off, so all multicast is flooded:

Another option is to turn igmp snooping off & make sure the clients & opnsense box are in the same vlan on the same switch. 
Title: Re: Having some UPnP issues.
Post by: thecodemonk on April 06, 2021, 06:05:18 pm
The problem with the UPNP service on OpnSense (not opnsense specific issue, it's upstream) is that it expects to work on an a "dumb" switch that floods multicast.  The upnp daemon never sends an IGMP Join to the switch (which, with IGMP snooping on, it expects).  Since the join is never received by the switch,  it never sends the <client>->239.255.255.250 traffic to the opnsense port.  That is why the static join is needed -- to force sending the client upnp requests to the opnsense box.

Option 2>  Turn IGMP SNooping off, so all multicast is flooded:

Another option is to turn igmp snooping off & make sure the clients & opnsense box are in the same vlan on the same switch. 

I believe that ultimately this may have been my issue. My PC was on a dumb switch that is connected to the managed switch and then the opnsense box is connected to the managed switch as well. I had gone into netgear's insight (Their managed cloud service for everything) and turned off IGMP snooping a few days ago in testing. It said it saved it, but I had to return to that page and do it 3 more times before it finally said that it was off. With the potential APR caching issue and IGMP snooping not potentially being off, the final reboot I did of everything, including that switch, may have turned snooping off and cleared the cache so that things actually started working.

I am definitely going to can this Netgear Insight crap and go back to locally managing it. It's a pain and I get less aggregated data about the connected clients, but for home I will live with it. Using all this was a test of their "business" class gear anyway to see if we would like it over the Unifi stuff we have a the office now. It's a resounding no from me. For home, it's fine. But I won't be using this cloud stuff at the office and managing a half dozen of these individually would be a colossal pain.
Title: Re: Having some UPnP issues.
Post by: ZPrime on April 08, 2021, 06:58:21 am
Hi all,

I have a LOT of experience with this.  Are both the OPNSense box & the other device on the same switch?  Are they on the same vlan?  Can they ping each other directly without going through a router?
Well, yes, sort-of. :)

all of my devices are on a single VLAN. I have a Ubiquiti EdgeSwitch 24-PoE as my "core", and in two locations I have Ubiquiti Unifi switches (an 8 port and a 16 port PoE). I have IGMP snooping disabled on the EdgeSwitch, and have not enabled it in the Unifi controller in the "Network" section, so everything should be getting multicast fllood. All systems that would normally be using UPnP are hardwired.

I did just realize that I had some level of IGMP filtering happening on my Unifi APs ("Multicast Enhancement" was enabled on the wireless network), which would partially explain why some of my testing was failing (laptop is on wifi)... but it doesn't explain why the Xbox wasn't working (which is hardwired).

However, there is one other piece in the game I often forget about... I have a "SamKnows" bandwidth testing box on my LAN at home. It's basically a small linux box that sits behind my opnsense box and it just bridges all traffic through it, and then runs internet speed tests when it detects enough of an "idle window" in the traffic flow. It's supposed to be a transparent bridge, although I've discovered that it filters 802.1q (i.e. it chokes on vlan tagging). Multicast had been working fine in the past though (UPnP has not been a problem before.)

I wouldn't be entirely surprised if something changed and it started filtering multicast though.  That said, after fixing the filtering on the wifi, I now can use the Windows UPnP test app that thecodemonk mentioned, and I'm getting responses from opnsense. So it doesn't seem like multicast is entirely blocked, at least. More testing needed to see if it will allow me to actually map a port though...

Win10 (in a VMware VM, using bridged networking on my Mac) with this UPnPTest app can map a port. 

The Mac itself cannot map a port or even get a response from opnsense via UPnP (although NAT-PMP works). I even pulled down the "upnpc" client  (which is part of the miniupnpd project, same thing used on opnsense) with homebrew, and it isn't even getting an answer from opnsense... which makes me wonder if Apple is doing something with multicast on recent versions of MacOS. I don't really care much about the Mac though, the xboxes are what need to work.

I need to give an xbox another try and see if it magically starts working now... I definitely have IGMP snooping disabled on the Unifi switch it is uplinked to, so it should be getting flooded, but it's probably worth verifying that with wireshark because Unifi gear is known to often do things you don't expect.
Title: Re: Having some UPnP issues.
Post by: ZPrime on May 25, 2021, 05:39:30 am
I know this thread is over a month old now, but I found a solution and wanted to report it. :)

I believe my problem stemmed from the fact that I'm using Multi-WAN, which then requires rules on the LAN side to set a gateway group for the outgoing traffic.

I have a rule above my GW Group rule that is just a generic "allow to firewall LAN IP"... but that overlooks multicast.

Had to add this rule, prior to my GW group selection rule:
source network: <LAN net>
destination host: 239.255.255.250  [multicast IP used for UPnP discovery (http://www.upnp-hacks.org/upnp.html)]
Protocol: UDP
Port: 1900

This got UPnP functional again, at least with the handy Mac app "Port Map (https://github.com/monkeydom/TCMPortMapper/releases/tag/PortMap-2.0.1)". I haven't tried an Xbox yet, but I suspect it will be OK too.
Title: Re: Having some UPnP issues.
Post by: FullyBorked on May 25, 2021, 02:41:32 pm
I know this thread is over a month old now, but I found a solution and wanted to report it. :)

I believe my problem stemmed from the fact that I'm using Multi-WAN, which then requires rules on the LAN side to set a gateway group for the outgoing traffic.

I have a rule above my GW Group rule that is just a generic "allow to firewall LAN IP"... but that overlooks multicast.

Had to add this rule, prior to my GW group selection rule:
source network: <LAN net>
destination host: 239.255.255.250  [multicast IP used for UPnP discovery (http://www.upnp-hacks.org/upnp.html)]
Protocol: UDP
Port: 1900

This got UPnP functional again, at least with the handy Mac app "Port Map (https://github.com/monkeydom/TCMPortMapper/releases/tag/PortMap-2.0.1)". I haven't tried an Xbox yet, but I suspect it will be OK too.

I'll be honest I figured this would do nothing since I thought my ANY rule should cover this also. I also have multi-wan so figured I'd give it a try.  However Xbox networking now shows NAT Type: Strict and Server: Connected.  Which is better  than unable to connect as it has.  Thanks for the post.
Title: Re: Having some UPnP issues.
Post by: tanks on May 26, 2021, 06:01:01 am
My configuration as below.

Firewall -> NAT -> Outbound

Interface   Source   Source Port   Destination   Destination Port   NAT Address   NAT Port   Static Port   Description
WAN   192.168.50.99/32    *   *   *   Interface address   *   YES   Xbox One

Entry in uPnP
allow 88-65535 192.168.50.99/32 88-65535
Title: Re: Having some UPnP issues.
Post by: DoomSalamander on May 26, 2021, 03:00:20 pm
I am not even using UPnP and I have a PS4 working fine so far. I gave the PS4 a static IP and it's own network for easy management and allowed a bunch of port range and some outbound ports that are static. I also use a multi wan setup. Should I even bother using UPnP if I am able to make the console work without it? When I tried to make it work I didn't work.
Title: Re: Having some UPnP issues.
Post by: FullyBorked on May 26, 2021, 03:04:02 pm
I am not even using UPnP and I have a PS4 working fine so far. I gave the PS4 a static IP and it's own network for easy management and allowed a bunch of port range and some outbound ports that are static. I also use a multi wan setup. Should I even bother using UPnP if I am able to make the console work without it? When I tried to make it work I didn't work.
Sounds like you've manually done what UPnP should do automatically.  It's up to you if you'd rather UPnP do it or you continue manually as you have.

Sent from my IN2025 using Tapatalk

Title: Re: Having some UPnP issues.
Post by: DoomSalamander on May 26, 2021, 03:14:33 pm
I am not even using UPnP and I have a PS4 working fine so far. I gave the PS4 a static IP and it's own network for easy management and allowed a bunch of port range and some outbound ports that are static. I also use a multi wan setup. Should I even bother using UPnP if I am able to make the console work without it? When I tried to make it work I didn't work.
Sounds like you've manually done what UPnP should do automatically.  It's up to you if you'd rather UPnP do it or you continue manually as you have.

Sent from my IN2025 using Tapatalk

I have set it up for a friend that shares the internet with me and he is only using a few games. Doesn't UPnP also do automatic port forwarding which can be pretty dangerous? I am just wondering which solution is more secure.
Title: Re: Having some UPnP issues.
Post by: FullyBorked on May 26, 2021, 03:21:21 pm
I am not even using UPnP and I have a PS4 working fine so far. I gave the PS4 a static IP and it's own network for easy management and allowed a bunch of port range and some outbound ports that are static. I also use a multi wan setup. Should I even bother using UPnP if I am able to make the console work without it? When I tried to make it work I didn't work.
Sounds like you've manually done what UPnP should do automatically.  It's up to you if you'd rather UPnP do it or you continue manually as you have.

Sent from my IN2025 using Tapatalk

I have set it up for a friend that shares the internet with me and he is only using a few games. Doesn't UPnP also do automatic port forwarding which can be pretty dangerous? I am just wondering which solution is more secure.

Yes it does automatic port forwarding.  Manually would arguably be more secure.  And placing the device on an isolated vlan as well if your primary concern is security. 

Personally I prefer just letting UPnP do it's job and my stuff just "works".  I understand and accept the risks on my home network.  I host some servers in my home lab and those all live in a DMZ physically and logically sperate from my LAN.  But for the random game I might want to spool up on short notice or that my wife might try and play.  I don't have the time or patients to figure out all the port forwarding each time to get these devices up and going.  And I don't want to forget and leave those port forwards in place if we aren't playing that particular game any longer.  All that to say I prefer the UPnP way of life lol. 
Title: Re: Having some UPnP issues.
Post by: DoomSalamander on May 26, 2021, 03:25:41 pm
Then I wonder why the PS4 is even working because I haven't set up a single port forward rule yet. I only have rules on the network the PS4 is and very few ports on the outgoing NAT side that are static.
Title: Re: Having some UPnP issues.
Post by: FullyBorked on May 26, 2021, 03:29:29 pm
Then I wonder why the PS4 is even working because I haven't set up a single port forward rule yet. I only have rules on the network the PS4 is and very few ports on the outgoing NAT side that are static.

Maybe you haven't played anything yet that requires port forwards?  That would be my only thought.  Not every game requires a port forward.  Usually peer to peer games do, but dedicated server games or single player titles do not.  It's mostly rare at  this point that I hit games that require it.  Warframe for example does require UPnP to function correctly since it's peer to peer. 
Title: Re: Having some UPnP issues.
Post by: DoomSalamander on May 26, 2021, 03:33:13 pm
Then I wonder why the PS4 is even working because I haven't set up a single port forward rule yet. I only have rules on the network the PS4 is and very few ports on the outgoing NAT side that are static.

Maybe you haven't played anything yet that requires port forwards?  That would be my only thought.  Not every game requires a port forward.  Usually peer to peer games do, but dedicated server games or single player titles do not.  It's mostly rare at  this point that I hit games that require it.  Warframe for example does require UPnP to function correctly since it's peer to peer.

I think this might be it. He only uses very few games such as COD Warzone and NBA2k20. I think he only uses like 4 games. He hasn't complained yet so I guess. Set it and forget it. Didn't bother doing UPnP since I haven't managed to make it work since then.