Any point using UPNP in routers?

Posted on 2006-05-02
Last Modified: 2008-01-09
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!

Question by:JustinWillis
    LVL 10

    Accepted Solution


    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
    LVL 1

    Author Comment

    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.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
    Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now