Recent

Author Topic: [SOLVED] How to open UPnP port with synapse  (Read 11304 times)

Key-Real

  • Sr. Member
  • ****
  • Posts: 389
Re: [SOLVED] How to open UPnP port with synapse
« Reply #105 on: November 21, 2023, 09:36:18 pm »
Code: Pascal  [Select][+][-]
  1. $ ping DESKTOP-B8UVQV5 -4
  2.  
  3. Ping wird ausgef▒hrt f▒r DESKTOP-B8UVQV5 [192.168.56.1] mit 32 Bytes Daten:
  4. Antwort von 192.168.56.1: Bytes=32 Zeit<1ms TTL=128
  5. Antwort von 192.168.56.1: Bytes=32 Zeit<1ms TTL=128
  6. Antwort von 192.168.56.1: Bytes=32 Zeit<1ms TTL=128
  7. Antwort von 192.168.56.1: Bytes=32 Zeit<1ms TTL=128
  8.  
  9. Ping-Statistik f▒r 192.168.56.1:
  10.     Pakete: Gesendet = 4, Empfangen = 4, Verloren = 0
  11.     (0% Verlust),
  12. Ca. Zeitangaben in Millisek.:
  13.     Minimum = 0ms, Maximum = 0ms, Mittelwert = 0ms




Code: Pascal  [Select][+][-]
  1. $ ./upnpc-shared.exe -d 1234 TCP
  2. upnpc : miniupnpc library test client, version 2.1.
  3.  (c) 2005-2018 Thomas Bernard.
  4. Go to http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
  5. for more information.
  6. List of UPNP devices found on the network :
  7.  desc: http://192.168.0.1:49153/IGDdevicedesc_brlan0.xml
  8.  st: urn:schemas-upnp-org:device:InternetGatewayDevice:1
  9.  
  10. Found valid IGD : http://192.168.0.1:49153/upnp/control/WANIPConnection0
  11. Local LAN ip address : 192.168.0.5
  12. UPNP_DeletePortMapping() failed with code : 714
  13.  


rvk

  • Hero Member
  • *****
  • Posts: 6806
Re: [SOLVED] How to open UPnP port with synapse
« Reply #106 on: November 21, 2023, 09:39:46 pm »
Code: Pascal  [Select][+][-]
  1. $ ping DESKTOP-B8UVQV5 -4
  2.  
  3. Ping wird ausgef▒hrt f▒r DESKTOP-B8UVQV5 [192.168.56.1] mit 32 Bytes Daten:
  4. Antwort von 192.168.56.1: Bytes=32 Zeit<1ms TTL=128
What kind of IP range is 192.168.56.x for you?

If your router is on 192.168.0.1 I would expect that "ping yourhostname -4" would result in your own 192.168.0.5.

So that's really strange. Is that maybe a VPN ??

$ ./upnpc-shared.exe -d 1234 TCP
(.....)
UPNP_DeletePortMapping() failed with code : 714
Does ./upnpc-shared.exe -l still show the 1234 forwardings for TCP and UDP?

Key-Real

  • Sr. Member
  • ****
  • Posts: 389
Re: [SOLVED] How to open UPnP port with synapse
« Reply #107 on: November 21, 2023, 09:42:01 pm »
Code: Pascal  [Select][+][-]
  1. $ ./upnpc-shared.exe -l
  2. upnpc : miniupnpc library test client, version 2.1.
  3.  (c) 2005-2018 Thomas Bernard.
  4. Go to http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
  5. for more information.
  6. List of UPNP devices found on the network :
  7.  desc: http://192.168.0.1:49153/IGDdevicedesc_brlan0.xml
  8.  st: urn:schemas-upnp-org:device:InternetGatewayDevice:1
  9.  
  10. Found valid IGD : http://192.168.0.1:49153/upnp/control/WANIPConnection0
  11. Local LAN ip address : 192.168.0.5
  12. Connection Type : IP_Routed
  13. Status : Connected, uptime=0s, LastConnectionError : ERROR_NONE
  14. MaxBitRateDown : 100000000 bps (100.0 Mbps)   MaxBitRateUp 100000000 bps (100.0 Mbps)
  15. ExternalIPAddress = 31.18.189.13
  16.  i protocol exPort->inAddr:inPort description remoteHost leaseTime
  17. GetGenericPortMappingEntry() returned 713 (SpecifiedArrayIndexInvalid)
  18.  
  19.  


Code: Pascal  [Select][+][-]
  1. $ ipconfig
  2.  
  3. Windows-IP-Konfiguration
  4.  
  5.  
  6. Ethernet-Adapter Ethernet:
  7.  
  8.    Verbindungsspezifisches DNS-Suffix:
  9.    Verbindungslokale IPv6-Adresse  . : fe80::b61d:8d7e:c75b:e740%32
  10.    IPv4-Adresse  . . . . . . . . . . : 192.168.0.5
  11.    Subnetzmaske  . . . . . . . . . . : 255.255.255.0
  12.    Standardgateway . . . . . . . . . : 192.168.0.1
  13.  
  14. Ethernet-Adapter Ethernet 2:
  15.  
  16.    Verbindungsspezifisches DNS-Suffix:
  17.    Verbindungslokale IPv6-Adresse  . : fe80::9842:6014:cefe:6915%7
  18.    IPv4-Adresse  . . . . . . . . . . : 192.168.56.1
  19.    Subnetzmaske  . . . . . . . . . . : 255.255.255.0
  20.    Standardgateway . . . . . . . . . :
  21.  
  22. Drahtlos-LAN-Adapter WLAN:
  23.  
  24.    Medienstatus. . . . . . . . . . . : Medium getrennt
  25.    Verbindungsspezifisches DNS-Suffix:
  26.  
  27. Drahtlos-LAN-Adapter LAN-Verbindung* 9:
  28.  
  29.    Medienstatus. . . . . . . . . . . : Medium getrennt
  30.    Verbindungsspezifisches DNS-Suffix:
  31.  
  32. Drahtlos-LAN-Adapter LAN-Verbindung* 10:
  33.  
  34.    Medienstatus. . . . . . . . . . . : Medium getrennt
  35.    Verbindungsspezifisches DNS-Suffix:
  36.  
  37.  

no VPN

rvk

  • Hero Member
  • *****
  • Posts: 6806
Re: [SOLVED] How to open UPnP port with synapse
« Reply #108 on: November 21, 2023, 09:46:08 pm »
Code: Pascal  [Select][+][-]
  1. $ ./upnpc-shared.exe -l
  2. GetGenericPortMappingEntry() returned 713 (SpecifiedArrayIndexInvalid)
  3.  
Ok, it could be that the first run the mapping already existed.
But the mapping could be deleted afterwards.
So it should be ok now (if you run it again).


Code: Pascal  [Select][+][-]
  1. Ethernet-Adapter Ethernet 2:
  2.  
  3.    Verbindungsspezifisches DNS-Suffix:
  4.    Verbindungslokale IPv6-Adresse  . : fe80::9842:6014:cefe:6915%7
  5.    IPv4-Adresse  . . . . . . . . . . : 192.168.56.1
  6.    Subnetzmaske  . . . . . . . . . . : 255.255.255.0
  7.    Standardgateway . . . . . . . . . :
  8.  

no VPN
So no VPN. But what is on "Ethernet-Adapter Ethernet 2" ???

Probably your output or route print also has the lower metric for 255.255.255.255 on that interface and that's why the broadcast on 255.255.255.255 didn't find the router.

So your Internet card 2 has higher proirity over that of your router. Normally that indicates a VPN.

If I were you I would find out why you have a Internet 2 (before someone is spying on your internet traffic).

rvk

  • Hero Member
  • *****
  • Posts: 6806
Re: [SOLVED] How to open UPnP port with synapse
« Reply #109 on: November 21, 2023, 09:49:06 pm »
I have some extra network interfaces for Hyper-V but none have a higher priority from my internet connection.
But this could be a bridge network interface which messes everything up.

(Traffic over 192.168.56.1 would pass through to your 192.168.0.x but for gethostname and broadcast this is not easy to detect)

Key-Real

  • Sr. Member
  • ****
  • Posts: 389
Re: [SOLVED] How to open UPnP port with synapse
« Reply #110 on: November 21, 2023, 09:51:34 pm »
I have no idea where the Ethernet 2 is came from!

If I wanna conncet local only 192.168.0.5 works

rvk

  • Hero Member
  • *****
  • Posts: 6806
Re: [SOLVED] How to open UPnP port with synapse
« Reply #111 on: November 21, 2023, 09:53:57 pm »
If I wanna conncet local only 192.168.0.5 works
Yep, if you do Create with 192.168.0.255 and SetPortMapping with 192.168.0.5 (your internal IP) it should work correctly.

Automatic detection of 255.255.255.255 broadcast doesn't work with a bridge adapter (like one for Hyper-V)
and UPnP.InternalIP (which returns the IP for your bridge adapter which isn't known in your router so gives an error).

Key-Real

  • Sr. Member
  • ****
  • Posts: 389
Re: [SOLVED] How to open UPnP port with synapse
« Reply #112 on: November 21, 2023, 09:57:54 pm »

I Create with 192.168.0.255 and SetPortMapping with 192.168.0.5

Code: Pascal  [Select][+][-]
  1. Connecting through UPnP....
  2. Setuping UPnP...
  3. M-SEARCH found the following (length 438 bytes):
  4. HTTP/1.1 200 OK
  5. CACHE-CONTROL: max-age=1800
  6. DATE: Tue, 21 Nov 2023 20:56:51 GMT
  7. EXT:
  8. LOCATION: http://192.168.0.1:49153/IGDdevicedesc_brlan0.xml
  9. OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
  10. 01-NLS: c2893784-88ac-11ee-9ee8-a235e7bf7181
  11. SERVER: Linux/4.9.135-Prod_19.3, UPnP/1.0, Portable SDK for UPnP devices/1.6.22
  12. X-User-Agent: redsonic
  13. ST: upnp:rootdevice
  14. USN: uuid:ebf5a0a0-1dd1-11b2-a90f-021018951e6c::upnp:rootdevice
  15.  
  16.  
  17. M-SEARCH result:
  18. <?xml version="1.0"?>
  19. <root xmlns="urn:schemas-upnp-org:device-1-0">
  20. <specVersion>
  21. <major>1</major>
  22. <minor>0</minor>
  23. </specVersion>
  24. <device>
  25. <deviceType>urn:schemas-upnp-org:device:InternetGatewayDevice:1</deviceType>
  26. <friendlyName>CGA6444VF</friendlyName>
  27. <manufacturer>Technicolor</manufacturer>
  28. <manufacturerURL>http://www.technicolor.com/</manufacturerURL>
  29. <modelDescription>Docsis 3.1 Gateway</modelDescription>
  30. <modelName>CGA6444VF</modelName>
  31. <modelNumber>1.0</modelNumber>
  32. <modelURL>http://www.technicolor.com</modelURL>
  33. <serialNumber></serialNumber>
  34. <UDN>uuid:ebf5a0a0-1dd1-11b2-a90f-021018951e6c</UDN>
  35. <UPC>CGA6444VF</UPC>
  36. <serviceList>
  37. <service>
  38. <serviceType>urn:schemas-upnp-org:service:Layer3Forwarding:1</serviceType>
  39. <serviceId>urn:upnp-org:serviceId:L3Forwarding1</serviceId>
  40. <SCPDURL>/Layer3ForwardingSCPD.xml</SCPDURL>
  41. <controlURL>/upnp/control/Layer3Forwarding</controlURL>
  42. <eventSubURL>/upnp/event/Layer3Forwarding</eventSubURL>
  43. </service>
  44. </serviceList>
  45. <deviceList>
  46. <device>
  47. <deviceType>urn:schemas-upnp-org:device:WANDevice:1</deviceType>
  48. <friendlyName>WANDevice:1</friendlyName>
  49. <manufacturer>Technicolor</manufacturer>
  50. <manufacturerURL>http://www.technicolor.com/</manufacturerURL>
  51. <modelDescription>Docsis 3.1 Gateway</modelDescription>
  52. <modelName>CGA6444VF</modelName>
  53. <modelNumber>1.0</modelNumber>
  54. <modelURL>http://www.technicolor.com</modelURL>
  55. <serialNumber></serialNumber>
  56. <UDN>uuid:ebf5a0a0-1dd1-11b2-a92f-021018951e6c</UDN>
  57. <UPC>CGA6444VF</UPC>
  58. <serviceList>
  59. <service>
  60. <serviceType>urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1</serviceType>
  61. <serviceId>urn:upnp-org:serviceId:WANCommonIFC1</serviceId>
  62. <SCPDURL>/WANCommonInterfaceConfigSCPD.xml</SCPDURL>
  63. <controlURL>/upnp/control/WANCommonInterfaceConfig0</controlURL>
  64. <eventSubURL>/upnp/event/WANCommonInterfaceConfig0</eventSubURL>
  65. </service>
  66. </serviceList>
  67. <deviceList>
  68.     <device>
  69.         <deviceType>urn:schemas-upnp-org:device:WANConnectionDevice:1</deviceType>
  70.         <friendlyName>WANConnectionDevice:1</friendlyName>
  71.         <manufacturer>Technicolor</manufacturer>
  72.         <manufacturerURL>http://www.technicolor.com/</manufacturerURL>
  73.         <modelDescription>Docsis 3.1 Gateway</modelDescription>
  74.         <modelName>CGA6444VF</modelName>
  75.         <modelNumber>1.0</modelNumber>
  76.         <modelURL>http://www.technicolor.com</modelURL>
  77.         <serialNumber></serialNumber>
  78.         <UDN>uuid:ebf5a0a0-1dd1-11b2-a93f-021018951e6c</UDN>
  79.         <UPC>CGA6444VF</UPC>
  80.         <serviceList>
  81.        <service>
  82.            <serviceType>urn:schemas-upnp-org:service:WANIPConnection:1</serviceType>
  83.            <serviceId>urn:upnp-org:serviceId:WANIPConn1</serviceId>
  84.            <SCPDURL>/WANIPConnectionServiceSCPD.xml</SCPDURL>
  85.            <controlURL>/upnp/control/WANIPConnection0</controlURL>
  86.            <eventSubURL>/upnp/event/WANIPConnection0</eventSubURL>
  87.        </service>
  88.         </serviceList>
  89.     </device>
  90. </deviceList>
  91. </device>
  92. </deviceList>
  93. <presentationURL>http://192.168.0.1/</presentationURL></device>
  94. </root>
  95.  
  96. UPnP device is available at http://192.168.0.1:49153/upnp/control/WANIPConnection0
  97. Internal IP: 192.168.56.1
  98. External IP: 31.18.189.13
  99. Status: Connected
  100. Last error: ERROR_NONE
  101. Uptime router: 0 days 0 hours 0 minutes and 0 seconds
  102. No portmappings
  103. Opening Port...
  104. SetPortMapping reports OK but Port does not seem to be forwarded
  105. Portmappings:
  106. 0 TCP 1234->192.168.0.5:1234 FlyTracker 0 s
  107. SetPortMapping reports OK but Port does not seem to be forwarded
  108. Portmappings:
  109. 0 TCP 1234->192.168.0.5:1234 FlyTracker 0 s
  110. 1 UDP 1234->192.168.0.5:1234 FlyTracker 0 s
  111. UPnP Error!
  112.  

SetPortMapping reports OK but Port does not seem to be forwarded!

Key-Real

  • Sr. Member
  • ****
  • Posts: 389
Re: [SOLVED] How to open UPnP port with synapse
« Reply #113 on: November 21, 2023, 09:59:11 pm »
btw.

Code: Pascal  [Select][+][-]
  1. {$IFDEF WINDOWS}
  2.    {$HINTS OFF}
  3.                 WSAStartup(2, VWSAData);
  4.         {$HINTS ON}
  5.         SetLength(VName, 255);
  6.         GetHostName(PChar(VName), 255);
  7.         SetLength(VName, StrLen(PChar(VName)));
  8.         VHostEnt := GetHostByName(PChar(VName));
  9.         with VHostEnt^ do
  10.         Result := Format(CFormatIPMask, [Byte(h_addr^[0]), Byte(h_addr^[1]), Byte(h_addr^[2]), Byte(h_addr^[3])]);
  11.         WSACleanup;
  12.  {$ENDIF}
  13.  
  14. end;
  15.  

returns me 192.168.56.1

rvk

  • Hero Member
  • *****
  • Posts: 6806
Re: [SOLVED] How to open UPnP port with synapse
« Reply #114 on: November 21, 2023, 09:59:44 pm »
Code: [Select]
[quote author=Key-Real link=topic=63652.msg497522#msg497522 date=1700600274]
Portmappings:
0 TCP 1234->192.168.0.5:1234 FlyTracker 0 s
1 UDP 1234->192.168.0.5:1234 FlyTracker 0 s
UPnP Error!

SetPortMapping reports OK but Port does not seem to be forwarded!
[/quote]
It works fine but you have this line:
if UPnP.GetSpecificPortMapping(8000, 'TCP').InternalClient = UPnP.InternalIP then

Of course you need to replace the InternalIP there too with 192.168.0.5

rvk

  • Hero Member
  • *****
  • Posts: 6806
Re: [SOLVED] How to open UPnP port with synapse
« Reply #115 on: November 21, 2023, 10:01:04 pm »
returns me 192.168.56.1
Yes, and that's an internal IP for a bridge adapter. It's not known at your router (which is why InternalIp doesn't work).

Key-Real

  • Sr. Member
  • ****
  • Posts: 389
Re: [SOLVED] How to open UPnP port with synapse
« Reply #116 on: November 21, 2023, 10:06:04 pm »
ok, i changed everyting but my app still cant connect

Key-Real

  • Sr. Member
  • ****
  • Posts: 389
Re: [SOLVED] How to open UPnP port with synapse
« Reply #117 on: November 21, 2023, 10:07:08 pm »
where is the "strange" ip came from? How to find this out? Im not a windows pro.

rvk

  • Hero Member
  • *****
  • Posts: 6806
Re: [SOLVED] How to open UPnP port with synapse
« Reply #118 on: November 21, 2023, 10:11:12 pm »
where is the "strange" ip came from? How to find this out? Im not a windows pro.
Click the notification area and click all settings.
Goto Network & Internet
Click Ethernet
Click "Change adapter options"
Now you see all the network connections.
There are probably some Hyper-V Virtual Ethernet Adapters

ok, i changed everyting but my app still cant connect
If the portforwarding is correct now then the upnp library works correctly.
It's upto the code for listening for the incoming connection for it to work.
But the virtual adapter can mess things up there too (but that depends on that code).

Key-Real

  • Sr. Member
  • ****
  • Posts: 389
Re: [SOLVED] How to open UPnP port with synapse
« Reply #119 on: November 21, 2023, 11:08:28 pm »
Good News:

Yes I had a VirtualBox "something" in the list.

I disabled it.

now the returned local IP is correct.

is seems to do the forwarding.


the bad news:
My network routies did not work under windows :(  (microsoft sux) have to check where the issues are.




well BIG THX!!!!!!!!

 

TinyPortal © 2005-2018