UPnP bug in OpenWrt

I suppose, those might be relevant to the problem:


But I don't use this feature.

Alright I'll give it a try

1 Like

Okay so I tried adding those modules except the last


because they were taking so much space & couldn't build the final image (Even though I excluded as many as not so important modules I could)
So I'm outta options. Whereas I tried LEDE version build 17.1.06 from here [UPDATE] LEDE 17.01.6 custom builds for TP-LINK WR841N(D) WR941N(D) WR743N(D) WR741N(D) WR740N(D) All Versions
in his LEDE build UPnP worked!
So I just want to make it work in the latest OpenWrt build :relieved:

Isn't a resource/perf issue? 841 is low end he, which does not guarantee basic stability - qbittotrent can be beyond threshold.

1 Like

I did the tests & it's fine for my daily internet speed. It'll only struggle if my speed is beyond 10 MBPS. UPnP gives me 501 Action Failed error. I think it's bcz I'm behind double NAT.

You should have opened with that. Do you have any sort of control over the higher link router?

My ISP is lying to me. I've been after them about this double NAT issue since two years & they said everything is fine on their side. They never block any port, that's what they say (lie). In fact they are basically putting pressure on me to buy a static public IP from them. But that's a story for another day; I'll try to look into it.
Although, on LEDE UPnP module works flawlessly. It just doesn't work on latest build of OpenWrt :thinking:

If you don't have a public IP, then that's the issue. This [slightly] conflicts with your first post (since it doesn't make much scene for an ISP to double NAT 2+ public IPs.

This struck my curiosity, since "public" and "NAT" are different things. Although, it's possible they're using a NAT pool with their publicly-issued IPs at a customer aggregation router, it just wastes more public IPs. Are you sure your IP doenst begin with 100.x.x.x?

This would more align with ISP using Carrier-grade NAT.

Then, that doesn't seem to be an issue; and you likely do have a public IP address. For testing, did you re-install that previous version?

On WAN the IP starts with 172 & if I google "What Is My IP Address" it starts with 103.
Yes I've tested LEDE version last week, UPnP absolutely works.
Here's my post where one user had the similar problem & tried Stun server to fix it.
UPNP bug in OpenWrt ( to would be a private IP (RFC1918). While this range could be used for cgNAT, your ISP would deserve a whack over the head if they steal this range from their customers - that's what is reserved for.

That however doesn't change the fact that you don't have a globally routable ('public') IP, but are behind some kind of (cg)NAT, which means there is no way to open ports to the outside or to access your router from the open internet. In the least bad case, you'd at least have an IPv6 prefix (DS-Lite) as well, which might give you at least the opportunity to use your device's IPv6 address instead.

1 Like

Agreed. BUT is there a way I can compile older version of UPnP module with the latest OpenWrt build?

You can build it, but it won't (can't) work (without a public IP address).

1 Like

Then how come it works in LEDE version?

Maybe a bit off topic...
But I leave this here for people that have to use a double NAT setup.
For example if you have to use your ISP router and your OpenWRT box behind it.

UPNP also passes the public IP as info to the clients.
(I'm sure PS4 uses this info)
In a double NAT setup this will not work. (Because a private IP is passed over to the clients)
To fix this, change/add
option external_ip 'your public ip address'
to your miniupnpd conf.
It also possible to modify the miniupnpd init script to automatically get the public IP address.
And enable DMZ mode on your ISP router. (to the IP address of your OpenWRT box)
Or forward all high ports (1024-65535) to your OpenWRT box.
But for cgNAT, your ISP has to open/forward the ports or to give a public IP.


Thank you that was very informative shm0. Probably it won't work in my case but I'll definitely try & update the forum.

Finally it worked! Just added
option external_ip 'your public ip address'
in my miniupnpd conf. Thank you so much :slight_smile:

I'm glad you got it working!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.