Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find port mapping in IGD #39

Open
flydr2 opened this issue Aug 13, 2019 · 14 comments
Open

Could not find port mapping in IGD #39

flydr2 opened this issue Aug 13, 2019 · 14 comments

Comments

@flydr2
Copy link

flydr2 commented Aug 13, 2019

Been trying to get UPnP to work with no success.
Seems to have multiple errors.

see attached log.txt
log.txt

@ofekp
Copy link
Owner

ofekp commented Aug 15, 2019

@flydr2 You can see the return error message is saying "OnlyPermanentLeasesSupported".

Do you have UPnP service enabled on your router?

@flydr2
Copy link
Author

flydr2 commented Aug 15, 2019 via email

@ofekp
Copy link
Owner

ofekp commented Aug 17, 2019

Can you please try to change LEASE_DURATION from 36000 to 0?
If that does not work, please try again with -1.

Let me know the results.

@flydr2
Copy link
Author

flydr2 commented Aug 17, 2019

I had tried 0... Will try -1 and report back when done...

@flydr2
Copy link
Author

flydr2 commented Aug 17, 2019

-1 does not work... looks like the same thing
log.txt

@flydr2
Copy link
Author

flydr2 commented Aug 17, 2019

The router is a ZYXEL VMG1312-B10B
Untitled

@ofekp
Copy link
Owner

ofekp commented Aug 18, 2019

Every documentation or advise I was able to find say 0 should do the trick.
Can you send me the log after you set this to 0 please?

Then, please attach the file from this path (I am partly guessing this URL since it is not printed in the log):
http://10.0.0.1:5431/dynsvc/WANPPPConnection121.xml

Then, if you are familiar with PostMan or any other tool that lets you send POST requests, please send the following (I am assuming you internal address is still 10.0.0.6):

Method:

POST

URL:

http://10.0.0.1:5431/uuid:6031978d-0edc-dc0e-8d97-3160318ddc02/WANPPPConnection121

Headers:

Content-Type: text/xml; charset="utf-8"
Connection: close
SOAPAction: "urn:schemas-upnp-org:service:WANPPPConnection:1#AddPortMapping"
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
  <u:AddPortMapping xmlns:u="urn:schemas-upnp-org:service:WANPPPConnection:1">
  <NewRemoteHost></NewRemoteHost>
  <NewExternalPort>9191</NewExternalPort>
  <NewProtocol>TCP</NewProtocol>
  <NewInternalPort>9191</NewInternalPort>
  <NewInternalClient>10.0.0.6</NewInternalClient>
  <NewEnabled>1</NewEnabled>
  <NewPortMappingDescription>NoLuz</NewPortMappingDescription> 
</u:AddPortMapping>
</s:Body>
</s:Envelope>

I removed the <NewLeaseDuration>-1</NewLeaseDuration> completely from the request.

Let's see if this sets the rule correctly.

@flydr2
Copy link
Author

flydr2 commented Aug 18, 2019

Here is the log with "0"
log.txt

Also what I have changed in the script
Untitled

@flydr2
Copy link
Author

flydr2 commented Aug 18, 2019

As requested the xml... (Renamed it .txt)
WANPPPConnection121.xml.txt

I will try to figure out what you want me to try with PostMan

@flydr2
Copy link
Author

flydr2 commented Aug 18, 2019

As requested the xml... (Renamed it .txt)
WANPPPConnection121.xml.txt

I will try to figure out what you want me to try with PostMan
postman

@ofekp
Copy link
Owner

ofekp commented Aug 19, 2019

@flydr2 Nice work following my requests :)

I can see that using 0 results in a 200 OK response which is awesome and a good sign.
The rule is just not found after that, and we need to find out why.

Please make sure that the rule is not found in the router using the web UI. If it is, please delete it.

Now, please add the following line to the body, as one of the parameters in the PostMan request you sent before?
<NewLeaseDuration>0</NewLeaseDuration>
You can put it just before the </u:AddPortMapping>.

I am expecting to see 200 OK response this time, if not, we have another issue in the PostMan request. Make sure your Headers section in the PostMan app are set correctly too.

If you do get 200 OK, please check the router config to see if you can find the rule using the Web UI.

If you don't get 200, please run the code again with the lease duration const set to 0, and after it runs (and fails) a few times, please check the router for the rule.

Let me know what happened.

@ofekp
Copy link
Owner

ofekp commented Aug 29, 2019

Hey @flydr2, any luck?

@flydr2
Copy link
Author

flydr2 commented Aug 29, 2019 via email

@ofekp
Copy link
Owner

ofekp commented Aug 29, 2019

I hope you're on vacation :)
Have fun, we'll continue at your convenience.

I have taken the liberty to remove your name and phone number from your message, since they are not publicly available at your GitHub profile. Probably added automatically. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants