View Single Post
  #1 (permalink)  
Old 06-29-2009, 03:42 PM
Virchanza's Avatar
Virchanza Virchanza is offline
Senior Member
 
Join Date: Sep 2008
Location: I am not living
Posts: 728
Default Idea for a program: UPnP

I dunno if this program would be really useful, but I think it'd be fun to write and it'd keep my programming skills sharp

Anyway, lately we've been talking about the UPnP protocol which is used by some routers. Basically you can send a request to the router to ask it what ports it is forwarding, and it will reply with a list, e.g.:
TCP port 80 on the WAN goes to TCP port 80 on LAN computer 10.10.10.5.
TCP port 443 on the WAN goes to TCP port 80 on LAN computer 10.10.10.18.


Also you can use this protocol to send requests to forward new ports, or to cancel any port forwarding that's already in place.

I think it'd be really neat to make a tiny little Linux program out of it, something like:

Code:
root@bt:~# portfwd --list
Sending request to router... timeout in 5 seconds...
Router response as follows:

WAN Port        goes to        LAN IP address        LAN Port
-------                        ----------------       -----------
TCP 80                          10.10.10.5             TCP 80
UDP 21                          10.10.10.2             UDP 22
TCP 443                         10.10.10.7             TCP 80

root@bt:~# portfwd --add TCP80 10.10.10.9 TCP81
Sending request to router... timeout in 5 seconds...
Request successful, requested port forwarding has been enabled.

root@bt:~# portfwd --del TCP80
Sending request to router... timeout in 5 seconds...
Request successful, requested port forwarding has been disabled.
Does anyone know of any other little project that does this? I've been searching the net for a little while but I've only found server applications, server libraries and server source code. I've yet to see any client applications like what I'm suggesting.

If you've ever used M$ WinXP, you might have noticed in the system tray in the bottom right corner, that sometimes an icon appears for your network connection saying something like "Intelligent Gateway Device detected on the network". As far as I know, this means it's found a router on the LAN that support UPnP.
__________________
Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".

Last edited by Virchanza; 06-29-2009 at 03:48 PM.
Reply With Quote