UPnP Port Mapping

I have set up OSMC/Kodi with Transmission (Port 9091), Sickrage (Port 8081) and CouchPotato (Port 5050). I’m aware that I must redirect these ports to my Raspberry Pi3 address in the router settings, but I cannot due to my ISP being a moron and blocking any access to its configuration.

I was able to run a Windows Javascript Software that mapped these ports using the UPnP protocol on the locked-down router, the problem is that this is not a permanent solution, and the UPnP mapping is lost (when rebooting, power outage, refreshing external IP’s, etc).

Is there any way to map these ports through UPnP on my set-up? I found MiniUPnPc but I was completely lost on how to install/compile.

You don’t need to compile miniupnpc, it’s already available in the debian repo.

Just install it like this

sudo apt-get install miniupnpc

Or you can try with this, it’s java based and also works in Linux:

I have tried both miniupnpc and PortMapper.
Both are failing to detect my router.

The odd thing is that when I run PortMapper on my Windows 7 Laptop, it can detect my router and map ports.

What am I doing wrong?



My router is actually on

Do you have some kind of firewall installed (like iptables) on the raspberry?

If so, it might be blocking the incoming packets that both programs are expecting.

Generally, it’s most helpful if you run grab-logs -A and supply us with the URL.

But I’d just like to get back to the first post, which is a little unclear:

Sticking with transmission for now, port 9091 is used for giving access to the transmission-daemon client. Do you want to be able to access transmission from a remote location or simply to access transmission (etc.) from within your local network? If the second option, you normally won’t need port forwarding.

I would like to access it from outside my local network.

In my LAN they are all working fine.

I’m not sure. I’ll check soon.
What is the easiest way to check if iptables is blocking?

Thanks for clarifying.

I just switched on upnp on my router and installed miniupnp on osmc. The osmc box is connected directly by cable to the router:

osmc@osmc:~$ upnpc -s
upnpc : miniupnpc library test client. (c) 2005-2014 Thomas Bernard
Go to http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
for more information.
List of UPNP devices found on the network :
 st: urn:schemas-upnp-org:device:InternetGatewayDevice:1

Found valid IGD :
Local LAN ip address :
Connection Type : IP_Routed
Status : Connected, uptime=717777s, LastConnectionError : ERROR_NONE
  Time started : Mon May  8 06:01:51 2017
MaxBitRateDown : 4200000 bps (4.2 Mbps)   MaxBitRateUp 4200000 bps (4.2 Mbps)
ExternalIPAddress = xx.xx.xx.xx
Bytes:   Sent: 1595784480	Recv: 3340384368
Packets: Sent: 15578008	Recv: 19176616

So, it works fine on OSMC, in general, but not for you. It might be a networking issue. Could you describe your network set-up, including hardware. Do you use any switches, for example? And don’t forget the grab-logs -A

I’m using a VDSL Modem/Router (which is totally locked down by ISP) and has an IP, the PI is on the same network, on IP

Using the Windows version of the port mapper I was able to access everything using my cellphone on the 4G network outside my house.

You’ve not told me very much, at all. You haven’t mentioned if OSMC is using cable or WiFi (or both), how the Win 7 laptop connects to the router, what device is or whether you have any other network devices.

And we need the URL from grab-logs -A

OSMC in on cable eth0 ( The win7 was on Wireless Lan.
The I’m not sure who was it and it is not showing anymore when I run the commands again.

I tried grab-logs -A and all I got was:

osmc@Raspberry_GHD:~$ grab-logs -A
Logs successfully uploaded.
Logs available at https://paste.osmc.tv/

Which seems to be an incomplete URL. (first time I’m using this grab-logs)

Yes, it’s an incomplete URL. We’ve seen this with a few other people and it normally corrects itself after a reboot. If possible, please reboot OSMC and try again.

It might be that your locked-down router isn’t compatible with either miniupnp or upnp portmapper. You didn’t mention which router it is but the miniupnp site contains a list of compatible routers. The list is almost certainly incomplete but is a reminder that not all routers work correctly and/or adhere to the “correct” specification. If it were me, I’d try to replace it or configure it in a modem-only (bridge) mode.