kaklakariada / portmapper

A tool for managing port forwardings via UPnP
GNU General Public License v3.0
685 stars 89 forks source link

PortMapper 2.1.1 couldn't find a router while miniupnp works #38

Closed database64128 closed 4 years ago

database64128 commented 6 years ago
DEBUG Saved settings [Settings: presets=[], useEntityEncoding=true, logLevel=TRACE, routerFactoryClassName=org.chris.portmapper.router.cling.ClingRouterFactory]
TRACE Connecting to router...
INFO  Creating router factory for class org.chris.portmapper.router.cling.ClingRouterFactory
DEBUG Router factory Cling lib created
INFO  Searching for routers...
DEBUG System property 'portmapper.locationUrl' not defined: discover routers automatically.
INFO  >>> Starting UPnP service...
INFO  Using configuration: org.fourthline.cling.DefaultUpnpServiceConfiguration
INFO  Creating Router: org.fourthline.cling.transport.RouterImpl
INFO  Creating wildcard socket (for receiving multicast datagrams) on port: 1900
INFO  Joining multicast group: /239.255.255.250:1900 on network interface: Hyper-V Virtual Ethernet Adapter #4
INFO  Creating wildcard socket (for receiving multicast datagrams) on port: 1900
INFO  Joining multicast group: /239.255.255.250:1900 on network interface: Hyper-V Virtual Ethernet Adapter #5
INFO  Creating wildcard socket (for receiving multicast datagrams) on port: 1900
INFO  Joining multicast group: /239.255.255.250:1900 on network interface: Hyper-V Virtual Ethernet Adapter #2
INFO  Creating wildcard socket (for receiving multicast datagrams) on port: 1900
INFO  Joining multicast group: /239.255.255.250:1900 on network interface: Hyper-V Virtual Ethernet Adapter #3
INFO  Creating wildcard socket (for receiving multicast datagrams) on port: 1900
INFO  Joining multicast group: /239.255.255.250:1900 on network interface: Hyper-V Virtual Ethernet Adapter
INFO  Creating wildcard socket (for receiving multicast datagrams) on port: 1900
INFO  Joining multicast group: /239.255.255.250:1900 on network interface: Hyper-V Virtual Ethernet Adapter #6
INFO  Created server (for receiving TCP streams) on: /172.21.21.1:10716
INFO  Creating bound socket (for datagram input/output) on: /172.21.21.1
INFO  Created server (for receiving TCP streams) on: /192.168.137.1:10719
INFO  Creating bound socket (for datagram input/output) on: /192.168.137.1
INFO  Created server (for receiving TCP streams) on: /169.254.120.132:10722
INFO  Creating bound socket (for datagram input/output) on: /169.254.120.132
INFO  Created server (for receiving TCP streams) on: /169.254.248.114:10725
INFO  Creating bound socket (for datagram input/output) on: /169.254.248.114
INFO  Created server (for receiving TCP streams) on: /172.30.252.49:10728
INFO  Creating bound socket (for datagram input/output) on: /172.30.252.49
INFO  Created server (for receiving TCP streams) on: /192.168.101.8:10731
INFO  Creating bound socket (for datagram input/output) on: /192.168.101.8
INFO  <<< UPnP service started successfully
DEBUG Start searching using upnp service
DEBUG Did not find a service after 5 seconds
WARN  Could not connect to router: Did not find a router
org.chris.portmapper.router.RouterException: Did not find a router
    at org.chris.portmapper.PortMapperApp.connectRouter(PortMapperApp.java:220)
    at org.chris.portmapper.gui.PortMapperView$ConnectTask.doInBackground(PortMapperView.java:456)
    at org.chris.portmapper.gui.PortMapperView$ConnectTask.doInBackground(PortMapperView.java:444)
    at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at javax.swing.SwingWorker.run(SwingWorker.java:334)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
WARN  Could not connect to router: Did not find a router
INFO  Timeout of 60 seconds while waiting for HTTP request to complete, aborting: (StreamRequestMessage) GET http://192.168.101.1:37215/00e0fc37-2525-2828-2500-e40eee778a1e/upnpdev.xml
WARN  Device descriptor retrieval failed, no response: http://192.168.101.1:37215/00e0fc37-2525-2828-2500-e40eee778a1e/upnpdev.xml
INFO  Timeout of 60 seconds while waiting for HTTP request to complete, aborting: (StreamRequestMessage) GET http://192.168.101.2:2869/upnphost/udhisapi.dll?content=uuid:c94925dd-3fda-4a91-ae62-627ced5a5d58
WARN  Device descriptor retrieval failed, no response: http://192.168.101.2:2869/upnphost/udhisapi.dll?content=uuid:c94925dd-3fda-4a91-ae62-627ced5a5d58

Tried every UPnP library and none of them works. miniupnp works:

.\upnpc-shared.exe -l
upnpc : miniupnpc library test client, version 2.1.
 (c) 2005-2018 Thomas Bernard.
Go to http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
for more information.
List of UPNP devices found on the network :
 desc: http://192.168.101.1:37215/00e0fc37-2525-2828-2500-e40eee778a1e/upnpdev.xml
 st: urn:schemas-upnp-org:device:InternetGatewayDevice:1

UPnP device found. Is it an IGD ? : http://192.168.101.1:37215/ctrlu/00e0fc37-2525-2828-2502-e40eee778a1e/WANPPPConn_1
Trying to continue anyway
Local LAN ip address : unset
Connection Type : IP_Routed
Status : Connected, uptime=74177s, LastConnectionError : ERROR_NONE
  Time started : Mon Aug 27 17:33:46 2018
GetLinkLayerMaxBitRates failed.
ExternalIPAddress = 223.244.187.251
 i protocol exPort->inAddr:inPort description remoteHost leaseTime
 0 UDP 60440->192.168.101.2:60440 'Teredo 192.168.101.2:60440-&gt;60440 UDP' '' 547958
GetGenericPortMappingEntry() returned 713 (SpecifiedArrayIndexInvalid)

The content of http://192.168.101.1:37215/00e0fc37-2525-2828-2500-e40eee778a1e/upnpdev.xml is

<?xml version="1.0"?>
<root xmlns="urn:schemas-upnp-org:device-1-0">
<link type="text/css" id="dark-mode" rel="stylesheet" href=""/>
<style type="text/css" id="dark-mode-custom-style"/>
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<device>
<deviceType>
urn:schemas-upnp-org:device:InternetGatewayDevice:1
</deviceType>
<friendlyName>华为路由WS5200运营商专供版</friendlyName>
<manufacturer>Huawei Technologies Co., Ltd.</manufacturer>
<manufacturerURL>http://www.huawei.com</manufacturerURL>
<modelDescription>Huawei Home Gateway</modelDescription>
<modelName>WS5200-tg</modelName>
<modelNumber>001</modelNumber>
<modelURL>http://www.huawei.com</modelURL>
<serialNumber>QAT7S18802002084</serialNumber>
<UDN>uuid:00e0fc37-2525-2828-2500-e40eee778a1e</UDN>
<UPC>000000000001</UPC>
<serviceList>
<service>
<serviceType>urn:www-huawei-com:service:NetworkSyncService:1</serviceType>
<serviceId>urn:www-huawei-com:serviceId:NetworkSyncService1</serviceId>
<SCPDURL>
/desc/00e0fc37-2525-2828-2500-e40eee778a1e/upnpNetworkSync.xml
</SCPDURL>
<controlURL>
/ctrlu/00e0fc37-2525-2828-2500-e40eee778a1e/NetworkSyncService_1
</controlURL>
<eventSubURL>/evt/NetworkSyncService_1</eventSubURL>
</service>
</serviceList>
<deviceList>
<device>
<deviceType>urn:schemas-upnp-org:device:WANDevice:1</deviceType>
<friendlyName>WANDevice</friendlyName>
<manufacturer>Huawei Technologies Co., Ltd.</manufacturer>
<manufacturerURL>http://www.huawei.com</manufacturerURL>
<modelDescription>Huawei Home Gateway</modelDescription>
<modelName>WS5200-tg</modelName>
<modelNumber>001</modelNumber>
<modelURL>http://www.huawei.com</modelURL>
<serialNumber>QAT7S18802002084</serialNumber>
<UDN>uuid:00e0fc37-2525-2828-2501-e40eee778a1e</UDN>
<UPC>000000000001</UPC>
<deviceList>
<device>
<deviceType>urn:schemas-upnp-org:device:WANConnectionDevice:1</deviceType>
<friendlyName>WANConnectionDevice</friendlyName>
<manufacturer>Huawei Technologies Co., Ltd.</manufacturer>
<manufacturerURL>http://www.huawei.com</manufacturerURL>
<modelDescription>Huawei Home Gateway</modelDescription>
<modelName>WS5200-tg</modelName>
<modelNumber>001</modelNumber>
<modelURL>http://www.huawei.com</modelURL>
<serialNumber>QAT7S18802002084</serialNumber>
<UDN>uuid:00e0fc37-2525-2828-2502-e40eee778a1e</UDN>
<UPC>000000000001</UPC>
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:service:WANPPPConnection:1</serviceType>
<serviceId>urn:upnp-org:serviceId:WANPPPConn1</serviceId>
<SCPDURL>
/desc/00e0fc37-2525-2828-2502-e40eee778a1e/upnpWANPPPConnection.xml
</SCPDURL>
<controlURL>
/ctrlu/00e0fc37-2525-2828-2502-e40eee778a1e/WANPPPConn_1
</controlURL>
<eventSubURL>/evt/WANPPPConn_1</eventSubURL>
</service>
</serviceList>
</device>
</deviceList>
</device>
<device>
<deviceType>urn:schemas-upnp-org:device:LANDevice:1</deviceType>
<friendlyName>LANDevice</friendlyName>
<manufacturer>Huawei Technologies Co., Ltd.</manufacturer>
<manufacturerURL>http://www.huawei.com</manufacturerURL>
<modelDescription>Huawei Home Gateway</modelDescription>
<modelName>WS5200-tg</modelName>
<modelNumber>001</modelNumber>
<modelURL>http://www.huawei.com</modelURL>
<serialNumber>QAT7S18802002084</serialNumber>
<UDN>uuid:00e0fc37-2525-2828-2503-e40eee778a1e</UDN>
<UPC>000000000001</UPC>
</device>
</deviceList>
<presentationURL>http://192.168.101.1</presentationURL>
</device>
</root>