Any point using UPNP in routers?

Hi, I have written a cool Delphi app (with EE experts holding my hand :) which is fairly easy to use but does require incoming connections (vital to it's purpose), so the most annoying thing during install is trying to explain to people how to enable Port Forwarding or NAT in their various router makes, I have tried to document this but just soooo many different makes/models in the world, UPNP feature however has been around for many years now and is designed to help with this, I have just tried an example program written in C but it failed miserably to open port's in my Draytek Vigor router.

Has anyone used UPNP successfully to open ports in a users router? I realise the security issues with UPNP and if the client does not have it enabled then will advise them to enable it and then disable it after install.

I want to make install process as simple as possible for those who do not know how to configure their routers properly.

I would like a working example or demo with source of a Delphi app (or any pointers to decent online docs) that can open ports in a router programmatically when the UPNP feature is active.  I am also aware that pretty much only XP supports UPNP out of the box at the moment due to reliance on COM.

If this is just going to be a pain to code then will just carry on doing manually, it seems that UPNP has not really taken off yet?

Thanks for any help or suggestions!

Who is Participating?

this page provides links to examples and SDKs

I have also had the same problem as you when I was making an Updater. This is what I have found out:
 - People who do not know much about routers dont normally have a UPnP Enabled router, although most the new ones does    have it, incorrect use of UPnP crashes not only the program but sometime the router as well, which means you get lots of angry emails....

 - Because BitTorrent is becoming popular, lots of people disable their UPnP so BitTorrent(and some other applications) can run smoothly, it is unlikely they will enable UPnP for other programs because they need it.

what are you trying to achieve? you should consider using one of the standard ports. (In my case of the updater, I ended up using port 80 to access a subdirectory in my weberver to get the file and action list and a port 21 FTP to transfer the actual files. These ports are almost 100% of the time unblocked by firewall and forwarded by Routers
JustinWillisAuthor Commented:
I need to open 2 TCP ports 8090-8091 and have the incoming traffic directed to the local IP the app is installed on, at the moment I have documented how the user can do this manually but some people contact me for help doing this, which is time consuming when it could possibly be done automatically for them, it is looking like it will be more hassle than a time saver, am now exploring the possibility of using UDP Hole Punching to bypass the firewall/router full stop.  I am writing a remote access program which currently works well, I know of another remote access program that has successfully used the UDP Hole Punching trick so solve this issue so will be doing tests to see if it could also work for mine, although would probably mean a bit of rewriting as I am currently using TCP.

Thanks for the info, P2P programs also seem to use the UDP Hole Punching trick when ports cannot be opened as does a well know VOIP program, so does seem to work well, will have to try it.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.