Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1016292
  • 博文数量: 244
  • 博客积分: 6820
  • 博客等级: 准将
  • 技术积分: 3020
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-09 21:33
文章分类

全部博文(244)

文章存档

2013年(1)

2012年(16)

2011年(132)

2010年(3)

2009年(12)

2008年(80)

我的朋友

分类: LINUX

2011-05-10 12:03:46

1.源码下载地址
2.

Using upnpc:

You should first list (-l) the services, actions and arguments supported by your IGD device.

Then you can invoke any command following the syntax:

./upnpc -a device:service:action arg1,arg2,arg3

One example would be:

./upnpc -a 0:3:2 80,TCP,1922.168.0.1,80

The actual parameters and values will depend on the device. Using -l you will have a list of the parameters you can use.

I will keep updating this code as i find necessary. Still, as my problem is solved, this code may stall until i require some additional feature, or someone submits a patch.

Any question regarding miniupnp, please contact Thomas Bernard at a:

3../upnpc-shared
upnpc : miniupnpc library test client. (c) 2006-2009 Thomas Bernard
Go to or
for more information.
Usage : ./upnpc-shared [options] -a ip port external_port protocol
Add port redirection
./upnpc-shared [options] -d external_port protocol [port2 protocol2]Â*[...]
Delete port redirection
./upnpc-shared [options] -s
Get Connection status
./upnpc-shared [options] -l
List redirections
./upnpc-shared [options] -r port1 protocol1 [port2 protocol2] [...]
Add all redirections to the current host


It looks like the "-a" option will do exactly what you want. It will automagically discover your router IP if the router is UPnP compatible.

阅读(1567) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~