mysteriumnetwork / node

Mysterium Network Node - official implementation of distributed VPN network (dVPN) protocol
https://mysterium.network
GNU General Public License v3.0
1.11k stars 312 forks source link

NAT port mapping kicks TV (not router) with experimental flag `--experiment-natpunching` #914

Closed Waldz closed 5 years ago

Waldz commented 5 years ago

How to reproduce a bug

2019-04-25T21:06:16.782693 [Warn] [upnp] error parsing discovery response error querying device by location: error requesting root device details from "http://192.168.1.101:9080": EOF 2019-04-25T21:06:16.833738 [Debug] [upnp] not a gateway device: map[server:FedoraCore/2 UPnP/1.0 MINT-X/1.8.1 deviceType:urn:schemas-upnp-org:device:Basic:1 manufacturer:Sony Corporation friendlyName:KDL-50W755C modelName:KDL-50W755C modelNo:] 2019-04-25T21:06:16.852768 [Debug] [upnp] not a gateway device: map[manufacturer:Sony Corporation friendlyName:KDL-50W755C modelName:MediaRenderer modelNo:100 server:Android/1.6 UPnP/1.0 Huey Sample DMR/0.1 deviceType:urn:schemas-upnp-org:device:MediaRenderer:1]


- Also NAT port mapping fails, because configures my TV OS :):

2019-04-25T21:06:16.971655 [Info] [service-openvpn] Openvpn service started successfully 2019-04-25T21:06:16.971704 [Trace] [client-management] Line delivering: >INFO:OpenVPN Management Interface Version 1 -- type 'help' for more info 2019-04-25T21:06:16.971737 [Trace] [client-management] Line not delivered: >INFO:OpenVPN Management Interface Version 1 -- type 'help' for more info

2019-04-25T21:06:17.969511 [Debug] [port mapping] Couldn't add port mapping for port 45919: no UPnP or NAT-PMP router discovered, retrying with permanent lease 2019-04-25T21:06:18.54189 [Info] [ip-detector.api] IP detected: 78.31.184.122 2019-04-25T21:06:18.656103 [Info] [traversal-events-tracker] got NAT event: {port_mapping false no UPnP or NAT-PMP router discovered} 2019-04-25T21:06:18.656143 [Debug] [port mapping] Couldn't add port mapping for port 45919: no UPnP or NAT-PMP router discovered 2019-04-25T21:06:18.656214 [Info] [traversal-events-tracker] got NAT event: {port_mapping false no UPnP or NAT-PMP router discovered}


- *Problem2:* And later connection from Android Consumer fails:

2019-04-25T21:14:32.624302 [Debug] [NATS.Receiver] Request '0x061d51912d5824ff203d94fa2dc7ccf8968a2f1b.openvpn.dialog-create' received: {"payload":{"peer_id":"0x9b86159ccf228b71874386d093362d557a7eee58","version":"v1"},"signature":"JzA22RP+73b4P8ARu2GVbvhO0gwsZ4TRvQbnTAso2jtDfknfQG6OdUEnSxNN93Yq4mFfzWVRVccOp3Jk5k4umgE="} 2019-04-25T21:14:32.624863 [Debug] [NATS.Receiver] Request '8e1059e2-9eac-40dc-b853-77373c3c057c.session-create' topic has been subscribed to 2019-04-25T21:14:32.624896 [Debug] [NATS.Receiver] Request '8e1059e2-9eac-40dc-b853-77373c3c057c.session-destroy' topic has been subscribed to 2019-04-25T21:14:32.624972 [Info] [NATS.DialogWaiter] Accepted dialog from: '0x9b86159ccf228b71874386d093362d557a7eee58' 2019-04-25T21:14:32.625257 [Debug] [NATS.Receiver] Request '0x061d51912d5824ff203d94fa2dc7ccf8968a2f1b.openvpn.dialog-create' response: {"payload":{"reason":200,"reasonMessage":"OK","topic":"8e1059e2-9eac-40dc-b853-77373c3c057c"},"signature":"vUBgJjpDhbbh81Mqg3JurbuMJvkrJoZlY2bQhd4JIZQTkouw+LsvtYeV0js792wKegcBOuzuNmzuBoAWUtE34QA="} 2019-04-25T21:14:32.808935 [Debug] [NATS.Receiver] Request '8e1059e2-9eac-40dc-b853-77373c3c057c.session-create' received: {"payload":{"proposal_id":1,"config":null,"consumer_info":{"issuerID":{"address":"0x9b86159ccf228b71874386d093362d557a7eee58"}}},"signature":"H7vtOQLy5e0kAvY1XJkklj7LFnTJltIRkZdLLAJpFl5aj9wXI6wcChe4kctCGkgxHU0Nwej72f1crXui8ygrUwA="} 2019-04-25T21:14:32.809647 [Debug] [port-provider] supplying port 42542, err 2019-04-25T21:14:32.809667 [Info] [traversal-events-tracker] getting last NAT event: &{port_mapping false no UPnP or NAT-PMP router discovered} 2019-04-25T21:14:32.80968 [Info] [traversal-events-tracker] getting last NAT event: &{port_mapping false no UPnP or NAT-PMP router discovered} 2019-04-25T21:14:32.809688 [Info] [service-openvpn] client port determined: 50221 2019-04-25T21:14:32.809693 [Info] [service-openvpn] pinger port: 42542 2019-04-25T21:14:32.809764 [Info] [NATPinger] Pinging peer with: &{[110 117 108 108] 42542} 2019-04-25T21:14:32.809901 [Warn] [NATPinger] unable to parse ping message: &{[110 117 108 108] 42542}: remote party does not support NAT hole punching, IP:PORT is missing 2019-04-25T21:14:32.816255 [Debug] [NATS.Receiver] Request '8e1059e2-9eac-40dc-b853-77373c3c057c.session-create' response: {"payload":{"success":true,"message":"","session":{"id":"b11c0a7f-4307-47e0-9cbf-bde4b41e79eb","config":{"remote":"78.31.184.122","port":42542,"lport":50221,"protocol":"udp","TLSPresharedKey":"-----BEGIN OpenVPN Static key V1-----\n7903a8c9b9af1717cb85b8a8af3e5852db501926b5f60362e4899a977e16d4c81650d3c95d582b64d49712fae4eb30bbad6d37cee082131c2a21bbf545e8173de383fe1df4d8a0a04f68b056510c228975fe6da34460f208dccd74aa53d0aec8032d2d689b5cb57e71d02fe6ae72841d23a6fe05c239cad3655b988a65877d8f1bc934b621a096ea74d144a8a181de8eb3e0b3be0a9d51b23285a91872ce81e41d06557266ced50d16c6351e700f2eeaa38b91b1cb4b346cb3726938ac1d7ba95ee810b5afa5cc09c8198e38cbfd39f1fddb64a9e43ac7fc82f3c1b1eec453ce6c8d122fd49609affe4cee6af5fdb384c5ef7e24fa7503a88892e0265b41ec3c\n-----END OpenVPN Static key V1-----\n","CACertificate":"-----BEGIN CERTIFICATE-----\nMIIBxTCCAWygAwIBAgICBFcwCgYIKoZIzj0EAwIwQjELMAkGA1UEBhMCTFQxGjAY\nBgNVBAoTEU15c3Rlcml1bSBOZXR3b3JrMRcwFQYDVQQLEw5NeXN0ZXJpdW0gVGVh\nbTAeFw0xOTA0MjUyMTEwMjRaFw0yOTA0MjUyMTEwMjRaMEIxCzAJBgNVBAYTAkxU\nMRowGAYDVQQKExFNeXN0ZXJpdW0gTmV0d29yazEXMBUGA1UECxMOTXlzdGVyaXVt\nIFRlYW0wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARnPom9U3G9OTSHEMFe/nA7\naxDhUIq7s36MxbUipjovbWn+aCnDrFriKT/KBrtgEGykP2TY1weA18lMLWop12a5\no1IwUDAOBgNVHQ8BAf8EBAMCAoQwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUF\nBwMBMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0OBAcEBQECAwQFMAoGCCqGSM49BAMC\nA0cAMEQCIHB8onO6DGL5irjjRXbSTxyCfYzvzRisu5Zhuuo/pJ4jAiBt+/pBooiY\n+V6/LGv1ryqCGjVjcDPloGic+duQ1R/+Tw==\n-----END CERTIFICATE-----\n"}},"paymentInfo":{"lastPromise":{"sequenceID":1,"amount":0},"freeCredit":0}},"signature":"zKPccEjMXw//MuYYxnQZQ7o0L8ys2VOdFCMdKwgJTJ4nyyIjM7c/xI3nsVVtcGGKMJpDDbaaNnklgmP+oNS+KwE="}



*Expected behaviour: *
- NAT port mapping should configure my router, not TV
- Maybe it affects NAT hole punching, because it dont event start
vkuznecovas commented 5 years ago

https://github.com/mysteriumnetwork/node/pull/915 fixes this. please retest with latest master.

tadaskay commented 5 years ago

upnp devices on the network are only logged for debugging purposes. It doesn't try to configure your tv. It clearly says in the log:

Couldn't add port mapping for port 45919: no UPnP or NAT-PMP router discovered