UPNP service not working

I set up my openwrt router on a NanoPI R5C yesterday, I've been using the portmapper tool (link: UPnP PortMapper download | SourceForge.net) to test the UPNP service, But i couldn't get UPNP to work

Below are my current UPNP settings :

UPNP settings

I have ensured that I can connect to port 5000 on my router from my desktop using Test-NetConnection

Below are the upnp logs

Sun Oct 13 12:17:13 2024 daemon.warn miniupnpd[14443]: HTTP Connection from 192.168.2.249 closed unexpectedly
Sun Oct 13 12:17:13 2024 daemon.info miniupnpd[14443]: HTTP REQUEST from [::ffff:192.168.2.249]:54316 : POST /ctl/IPConn (HTTP/1.1)
Sun Oct 13 12:17:13 2024 daemon.debug miniupnpd[14443]: Host: 192.168.2.1:5000
Sun Oct 13 12:17:13 2024 daemon.info miniupnpd[14443]: SOAPAction: urn:schemas-upnp-org:service:WANIPConnection:1#AddPortMapping
Sun Oct 13 12:17:13 2024 daemon.info miniupnpd[14443]: AddPortMapping: ext port 50000 to 192.168.2.249:50000 protocol TCP for: test leaseduration=604800 rhost=
Sun Oct 13 12:17:13 2024 daemon.debug miniupnpd[14443]: UPnP permission rule 0 matched : port mapping accepted
Sun Oct 13 12:17:13 2024 daemon.debug miniupnpd[14443]: Check protocol tcp for port 50000 on ext_if eth0 192.168.1.100, 6401A8C0
Sun Oct 13 12:17:13 2024 daemon.info miniupnpd[14443]: redirecting port 50000 to 192.168.2.249:50000 protocol TCP for: test
Sun Oct 13 12:17:13 2024 daemon.info miniupnpd[14443]: Returning UPnPError 501: ActionFailed
Sun Oct 13 12:17:13 2024 daemon.info miniupnpd[14443]: HTTP REQUEST from [::ffff:192.168.2.249]:54318 : POST /ctl/IPConn (HTTP/1.1)
Sun Oct 13 12:17:13 2024 daemon.debug miniupnpd[14443]: Host: 192.168.2.1:5000
Sun Oct 13 12:17:13 2024 daemon.info miniupnpd[14443]: SOAPAction: urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry
Sun Oct 13 12:17:13 2024 daemon.info miniupnpd[14443]: GetGenericPortMappingEntry: index=0
Sun Oct 13 12:17:13 2024 daemon.info miniupnpd[14443]: Returning UPnPError 713: SpecifiedArrayIndexInvalid

I have already spent countless hours trying to resolve this issue. Really appreciate your help here.

External ip must be a public ip.

I don't see why External IP has to be public. UPNP does not care whether external IP is public or not.

My current setup goes like this.

ISP Router -> OpenWRTRouter -> PC

OpenWRTRouter has been designated as a DMZ in the ISP router.

This is the exact same setup which I used in my TP LInk Deco router and it worked without any issues.

This was indeed the solution. I enabled "Enable additional logging" in the UPNP setting and was looking at the debug logs in my ssh session. That is when i noticed the upnp service throwing an error saying the current external IP is a private IP and it needs a public ip to function.

I made some changes to my connection( Basically removed double NAT and configured PPPOE on my openwrt router), The UPNP service started working after that.

1 Like

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