indutny / node-nat-upnp

NAT port mapping via UPnP
147 stars 59 forks source link

Router error on ttl > 0 #24

Open pietrovismara opened 8 years ago

pietrovismara commented 8 years ago

I instantiate my client like this:

        client.portMapping({
          public: publicPort,
          private: privatePort,
          ttl: 0
        }, function(err) {
          // Will be called once finished
          console.log("done", err);
        });

If ttl is greater than 0 i get this status code 500 and this response from the router api:

{
    "@": {
        "xmlns:s": "http://schemas.xmlsoap.org/soap/envelope/",
        "s:encodingStyle": "http://schemas.xmlsoap.org/soap/encoding/"
    },
    "s:Body": {
        "s:Fault": {
            "faultcode": "s:Client",
            "faultstring": "UPnPError",
            "detail": {
                "UPnPError": {
                    "@": {
                        "xmlns": "urn:schemas-upnp-org:control-1-0"
                    },
                    "errorCode": "725",
                    "errorDescription": "OnlyPermanentLeasesSupported"
                }
            }
        }
    }
}

I found the solution of setting ttl to 0 in this issue https://github.com/zerotier/ZeroTierOne/issues/242 This could be probably added to the README.md file.

indutny commented 8 years ago

@pietrovismara the zerotier/ZeroTierOne#242 seems to be a length stream of text. May I ask you to post a relevant excerpt here?

Thanks!

pietrovismara commented 8 years ago

I'm talking about this comment. The problem seems to be about the lease duration, setting it to 0 as suggested in the comment made the port forwarding works.

indutny commented 8 years ago

Ok, would you be interested in contributing this change to a readme? 😉

boltgolt commented 8 years ago

Had the same issue, and setting the ttl to 0 seems to fix it. I'm a bit worried that this change won't allow nat-upnp to get to the UPnP IGD if it's one hop away, though.

remy33 commented 7 years ago

I had the same problem, It's a shame you didn't fix the ReadMe!