What's new

Use Portmapper with RT-AC88U

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

David B

Regular Contributor
I am trying to use Portmapper (https://github.com/kaklakariada/portmapper) to open ports with UPnP on my RT-AC88U, but doing so is not working. As per @RMerlin 's instructions from here, I disabled secure mode, but adding an entry is still not working, and I get the following error: https://pastebin.com/9rEcCER5 (I posted it on Pastebin because posting it directly on here causes some weird formatting error.)

Does anyone have any suggestions for fixing this? I can use the program to remove existing UPnP entries from the router, but adding new ones always fails with this error. From what I can tell here, the error is "ConflictInMappingEntry", which should only be happening when the port that is trying to be forwarded already has a rule, but this is happening for all ports.
 
Have you restarted miniupnpd after disabling secure_mode? Are you mapping a low port?

Is it possible to get the command you ran? Seems like this is GUI application so maybe look further up the logs and see? Or maybe turn on more verbose logging options? Pretty hard to go on just with the information here.

Edit: perhaps you can try with other tools like upnpc that gives more human readable errors and make sure the IP and port you’re using are correct?
 
I have restarted my router completely, but it is still happening. It is a GUI application, but I was using it through the command line, as that is how I had intended for it to be used. I'm now try to get upnpc to work, but it is also not working. Here's the command that I tried for upnpc:

upnpc -a 192.168.1.1 3333 22 TCP

This also did not work. This is the result of that:
upnpc : miniupnpc library test client. (c) 2005-2014 Thomas Bernard
Go to http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
for more information.
No IGD UPnP Device found on the network !

Why can't it find my router? I definitely have UPnP turned on. I would actually prefer to get upnpc working, as it is much easier to work with than the GUI application.

Also I am not sure if this is worth noting, but I am attempting to use upnpc on the Ubuntu Subsystem for Windows.
 
Last edited:
Also I am not sure if this is worth noting, but I am attempting to use upnpc on the Ubuntu Subsystem for Windows.
That's probably the problem. It works fine for me using the Windows version of upnpc.

What are you trying to do? The 192.168.1.1 address looks wrong. I'd expect that to be a client on your LAN, not the router itself. Also, the port numbers look to be the wrong way around.:confused:
Code:
C:\Utils>upnpc -a 192.168.1.1 3333 22 TCP
upnpc : miniupnpc library test client, version 1.9.
 (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 :
 desc: http://192.168.1.1:60300/rootDesc.xml
 st: urn:schemas-upnp-org:device:InternetGatewayDevice:1

Found valid IGD : http://192.168.1.1:60300/ctl/IPConn
Local LAN ip address : 192.168.1.238
ExternalIPAddress = 82.28.xxx.yyy
InternalIP:Port = 192.168.1.1:3333
external 82.28.xxx.yyy:22 TCP is redirected to internal 192.168.1.1:3333 (duration=0)
Code:
C:\Utils>upnpc -a 192.168.1.1 22 3333 TCP
upnpc : miniupnpc library test client, version 1.9.
 (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 :
 desc: http://192.168.1.1:45927/rootDesc.xml
 st: urn:schemas-upnp-org:device:InternetGatewayDevice:1

Found valid IGD : http://192.168.1.1:45927/ctl/IPConn
Local LAN ip address : 192.168.1.238
ExternalIPAddress = 82.28.xxx.yyy
InternalIP:Port = 192.168.1.1:22
external 82.28.xxx.yyy:3333 TCP is redirected to internal 192.168.1.1:22 (duration=0)
Note that to get the above to work I had to change the allowed UPnP port range in the GUI to 1-65535.
 
Last edited:
It looks like the Windows version of upnpc does indeed work properly. It's a pity that the WSL, according to Google search results, cannot support network utilities.

If you are wondering what I am trying to achieve, I wrote a script that allows me to open and close ports on my home network via text message using UPnP so that I can access my VPN on networks that block the port that I normally use it on. I have a Google Voice number that I registered, and I send a text message to it with instructions for what I want to do, and once a minute, a cron job runs on my personal home server that runs the script that reads the text and based on the instructions, opens or closes the correct TCP or UDP port using upnpc. The 192.168.1.1 address is correct because the VPN runs on my router and therefore I need the port to be forwarded to it instead of to my server.

When I was testing the script, I was using the WSL, which worked fine for testing the automated reading and writing of texts, but didn't go to well for testing UPnP with either Portmapper or upnpc. I thought something was wrong with my router's configuration (I had already disabled secure mode and change the allowed port ranges so I knew that wasn't it), so I spent time trying to figure it out. Apparently nothing was wrong. Portmapper is just a piece of garbage, and upnpc cannot be used via the WSL.

Now that I've got the script finished and running once a minute as a cron job, the next challenge is to figure out how to scan the entire outbound range of TCP and UDP ports on a network to determine what I can tunnel through. If anyone is wants to help with that, I'm open to ideas!
 
  • Like
Reactions: kfp
upnpc cannot be used via the WSL.

Now that I've got the script finished and running once a minute as a cron job, the next challenge is to figure out how to scan the entire outbound range of TCP and UDP ports on a network to determine what I can tunnel through. If anyone is wants to help with that, I'm open to ideas!

Interesting. I’ve never encountered any problems with networking utilities under WSL (but never attempted to use upnpc under it either).

As for outbound ports, can’t you just pick a random port and your upnpc command would fail if port is already in use? In that case just pick another one, won’t that work?

As an aside, couldn’t you handle the processing of the SMS message where you receive it, and get rid of the cron job?

It sounds like you’re implementing a port knocking service, there are already tools out there[URL="http:// for this, maybe give those a look?"] for this, maybe give those a look?[/URL]
 
Interesting. I’ve never encountered any problems with networking utilities under WSL (but never attempted to use upnpc under it either).
I think it depends on what you are working with. Also the information that I found online may be for an older version.

As for outbound ports, can’t you just pick a random port and your upnpc command would fail if port is already in use? In that case just pick another one, won’t that work?
I am not sure this would work. I think I would need to find an outbound port not blocked by the network's firewall, then configure my VPN to allow traffic on that port via my text message program.

As an aside, couldn’t you handle the processing of the SMS message where you receive it, and get rid of the cron job?
There is not any way that I am aware of. I am of course open to ideas.

It sounds like you’re implementing a port knocking service, there are already tools out there for this, maybe give those a look?
Well that was overwhelming to read. I can't figure out how to use this thing to scan for open outgoing ports. :eek:
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Staff online

Top