rtorrent不支持UPNP,aMule的UNPN功能在我这里没用,郁闷,只能自己动手编了一个。
python编的,我的系统是ubuntu8.10,用的挺好,理论上windows上也能用。
包里有使用有说明(readme),欢迎有问题发邮件给我。
注意:协议字母要大写(TCP/UDP)。
端口映射/转发工具,对用路由器(支持UPNP)上网的朋友有用
端口映射/转发工具,对用路由器(支持UPNP)上网的朋友有用
- 附件
-
- upnp.tar.gz
- 改进了适应性,请chpn兄及其他以前不能用的朋友试试现在能不能用
2008-11-29 20:33 - (3.34 KiB) 下载 844 次
上次由 fuhuizn 在 2008-12-02 14:52,总共编辑 5 次。
Re: 端口映射/转发工具,对用路由器(支持UPNP)上网的朋友有用
就上一个版本controlURL找不到的,p功能死的问题再问一下
controlURL找不到应该是其它问题吧
但是我的路由器中是开启了UPNP功能的,并且在路由器中发现MusicBox 自动加了一个端口映射这说明你的路由器没有开UPNP功能
controlURL找不到应该是其它问题吧
Re: 端口映射/转发工具,对用路由器(支持UPNP)上网的朋友有用
我是针对自己的路由器做你的,你用下面的程序测试一下,把输出贴出来给我研究研究,应该能解决了chpn 写了:就上一个版本controlURL找不到的,p功能死的问题再问一下但是我的路由器中是开启了UPNP功能的,并且在路由器中发现MusicBox 自动加了一个端口映射这说明你的路由器没有开UPNP功能
controlURL找不到应该是其它问题吧
- 附件
-
- upnp.zip
- 这个包含测试代码,你把执行后输出的内容贴出来给我看看
- (2.39 KiB) 下载 146 次
Re: 端口映射/转发工具,对用路由器(支持UPNP)上网的朋友有用
装了 libupnp-1.6.6 和linux-IGD
执行
rout add -net 239.0.0.0 netmask 255.0.0.0 eth0
sudo upnpd wmaster0 wlan0
就可以成功执行p命令
但是添加删除都不成功
我是在家里装的,家里IP是192.168.13.6,在公司测试,公司IP是195.2.199.125,可下面还是出现了家里时的IP,不知道为啥
执行
rout add -net 239.0.0.0 netmask 255.0.0.0 eth0
sudo upnpd wmaster0 wlan0
就可以成功执行p命令
但是添加删除都不成功
我是在家里装的,家里IP是192.168.13.6,在公司测试,公司IP是195.2.199.125,可下面还是出现了家里时的IP,不知道为啥
python ./upnp.py
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
DATE: Tue, 02 Dec 2008 01:48:43 GMT
EXT:
LOCATION: http://195.2.199.125:49153/gatedesc.xml
SERVER: Linux/2.6.27-10-generic, UPnP/1.0, Portable SDK for UPnP devices/1.6.6
X-User-Agent: redsonic
ST: upnp:rootdevice
USN: uuid:75802409-bccb-40e7-8e6c-fa095ecce13e::upnp:rootdevice
discription: http://195.2.199.125:49153/gatedesc.xml
<?xml version="1.0"?>
<root xmlns="urn:schemas-upnp-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<device>
<deviceType>urn:schemas-upnp-org:device:InternetGatewayDevice:1</deviceType>
<friendlyName>Linux Internet Gateway Device</friendlyName>
<manufacturer>Linux UPnP IGD Project</manufacturer>
<manufacturerURL>http://linux-igd.sourceforge.net</manufacturerURL>
<modelName>IGD Version 1.00</modelName>
<UDN>uuid:75802409-bccb-40e7-8e6c-fa095ecce13e</UDN>
<iconList>
<icon>
<mimetype>image/gif</mimetype>
<width>118</width>
<height>119</height>
<depth>8</depth>
<url>/ligd.gif</url>
</icon>
</iconList>
<serviceList>
<service>
<serviceType>urn:schemas-dummy-com:service:Dummy:1</serviceType>
<serviceId>urn:dummy-com:serviceId:dummy1</serviceId>
<controlURL>/dummy</controlURL>
<eventSubURL>/dummy</eventSubURL>
<SCPDURL>/dummy.xml</SCPDURL>
</service>
</serviceList>
<deviceList>
<device>
<deviceType>urn:schemas-upnp-org:device:WANDevice:1</deviceType>
<friendlyName>WANDevice</friendlyName>
<manufacturer>Linux UPnP IGD Project</manufacturer>
<manufacturerURL>http://linux-igd.sourceforge.net</manufacturerURL>
<modelDescription>WAN Device on Linux IGD</modelDescription>
<modelName>Linux IGD</modelName>
<modelNumber>1.00</modelNumber>
<modelURL>http://linux-igd.sourceforge.net</modelURL>
<serialNumber>1.00</serialNumber>
<UDN>uuid:75802409-bccb-40e7-8e6c-fa095ecce13e</UDN>
<UPC>Linux IGD</UPC>
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1</serviceType>
<serviceId>urn:upnp-org:serviceId:WANCommonIFC1</serviceId>
<controlURL>/upnp/control/WANCommonIFC1</controlURL>
<eventSubURL>/upnp/control/WANCommonIFC1</eventSubURL>
<SCPDURL>/gateicfgSCPD.xml</SCPDURL>
</service>
</serviceList>
<deviceList>
<device>
<deviceType>urn:schemas-upnp-org:device:WANConnectionDevice:1</deviceType>
<friendlyName>WANConnectionDevice</friendlyName>
<manufacturer>Linux UPnP IGD Project</manufacturer>
<manufacturerURL>http://linux-igd.sourceforge.net</manufacturerURL>
<modelDescription>WanConnectionDevice on Linux IGD</modelDescription>
<modelName>Linux IGD</modelName>
<modelNumber>0.95</modelNumber>
<modelURL>http://linux-igd.sourceforge.net</modelURL>
<serialNumber>0.95</serialNumber>
<UDN>uuid:75802409-bccb-40e7-8e6c-fa095ecce13e</UDN>
<UPC>Linux IGD</UPC>
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:service:WANIPConnection:1</serviceType>
<serviceId>urn:upnp-org:serviceId:WANIPConn1</serviceId>
<controlURL>/upnp/control/WANIPConn1</controlURL>
<eventSubURL>/upnp/control/WANIPConn1</eventSubURL>
<SCPDURL>/gateconnSCPD.xml</SCPDURL>
</service>
</serviceList>
</device>
</deviceList>
</device>
</deviceList>
</device>
</root>
controlURL: http://195.2.199.125:49153/upnp/control/WANIPConn1
HTTP/1.1 200 OK
SERVER: Ambit OS/1.0 UPnP/1.0 AMBIT-UPNP/1.0
EXT:
LOCATION: http://195.2.199.4:80/Public_UPNP_gatedesc.xml
CACHE-CONTROL: max-age=3600
ST: upnp:rootdevice
USN: uuid:3ef1e8fc-de3d-a8c2-38e9-b97da5deb99e::upnp:rootdevice
discription: http://195.2.199.4:80/Public_UPNP_gatedesc.xml
<?xml version="1.0"?>
<root xmlns="urn:schemas-upnp-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<URLBase>http://195.2.199.4:80/</URLBase>
<device>
<deviceType>urn:schemas-upnp-org:device:InternetGatewayDevice:1</deviceType>
<presentationURL>/start.htm</presentationURL>
<friendlyName>Residential Gateway</friendlyName>
<manufacturer>NETGEAR, Inc.</manufacturer>
<manufacturerURL>http://www.NETGEAR.com</manufacturerURL>
<modelDescription>Residential Gateway</modelDescription>
<modelName>Residential Gateway</modelName>
<UDN>uuid:3ef1e8fc-de3d-a8c2-38e9-b97da5deb99e</UDN>
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:service:Layer3Forwarding:1</serviceType>
<serviceId>urn:upnp-org:serviceId:L3Forwarding1</serviceId>
<SCPDURL>/Public_UPNP_Layer3F.xml</SCPDURL>
<controlURL>/Public_UPNP_C1</controlURL>
<eventSubURL>/Public_UPNP_Event_1</eventSubURL>
</service>
</serviceList>
<deviceList>
<device>
<deviceType>urn:schemas-upnp-org:device:WANDevice:1</deviceType>
<friendlyName>WAN Device</friendlyName>
<manufacturer>NETGEAR, Inc.</manufacturer>
<manufacturerURL>http://www.NETGEAR.com</manufacturerURL>
<modelDescription>Residential Gateway</modelDescription>
<modelName>Residential Gateway</modelName>
<UDN>uuid:b40d9e71-e99e-8e60-3911-5cd317403035</UDN>
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1</serviceType>
<serviceId>urn:upnp-org:serviceId:WANCommonIFC1</serviceId>
<SCPDURL>/Public_UPNP_WAND.xml</SCPDURL>
<controlURL>/Public_UPNP_C2</controlURL>
<eventSubURL>/Public_UPNP_Event_2</eventSubURL>
</service>
</serviceList>
<deviceList>
<device>
<deviceType>urn:schemas-upnp-org:device:WANConnectionDevice:1</deviceType>
<friendlyName>WAN Connection Device</friendlyName>
<manufacturer>NETGEAR, Inc.</manufacturer>
<manufacturerURL>http://www.NETGEAR.com</manufacturerURL>
<modelDescription>Residential Gateway</modelDescription>
<modelName>Residential Gateway</modelName>
<UDN>uuid:e32ab4d0-f2e5-b17c-3706-cd8fd4f8a6fc</UDN>
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:service:WANIPConnection:1</serviceType>
<serviceId>urn:upnp-org:serviceId:WANIPConn1</serviceId>
<SCPDURL>/Public_UPNP_WANIPConn.xml</SCPDURL>
<controlURL>/Public_UPNP_C3</controlURL>
<eventSubURL>/Public_UPNP_Event_3</eventSubURL>
</service>
</serviceList>
</device>
</deviceList>
</device>
</deviceList>
</device>
</root>
controlURL: http://195.2.199.4:80/Public_UPNP_C3
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
DATE: Tue, 02 Dec 2008 01:48:44 GMT
EXT:
LOCATION: http://192.168.13.6:49152/gatedesc.xml
SERVER: Linux/2.6.27-10-generic, UPnP/1.0, Portable SDK for UPnP devices/1.6.6
X-User-Agent: redsonic
ST: upnp:rootdevice
USN: uuid:75802409-bccb-40e7-8e6c-fa095ecce13e::upnp:rootdevice
discription: http://192.168.13.6:49152/gatedesc.xml
>p
0 192.168.126.1 TCP 8284
1 192.168.42.1 TCP 41190
2 195.2.199.83 UDP 1704
3 195.2.199.83 UDP 1705
4 195.2.199.150 UDP 13461
5 195.2.199.150 TCP 13461
6 195.2.199.89 TCP 32452
7 195.2.199.89 UDP 32452
8 195.2.199.107 TCP 22444
9 195.2.199.150 TCP 5601
10 195.2.199.185 UDP 7600
11 195.2.199.112 TCP 29858
12 195.2.199.112 UDP 29858
13 195.2.199.186 TCP 14132
14 195.2.199.186 UDP 14132
15 192.168.1.32 UDP 12728
16 192.168.1.32 TCP 12728
17 195.2.199.99 TCP 30954
18 195.2.199.99 UDP 30954
19 195.2.199.109 UDP 15533
20 195.2.199.110 UDP 7950
21 195.2.199.111 UDP 7171
22 195.2.199.112 UDP 16502
>d s udp 16502
Fail
>a s tcp 16503
Fail
>