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

IPv6 not working when using fritzbox_ip arg #55

Closed
realbadidas opened this issue May 11, 2024 · 3 comments · Fixed by #57
Closed

IPv6 not working when using fritzbox_ip arg #55

realbadidas opened this issue May 11, 2024 · 3 comments · Fixed by #57

Comments

@realbadidas
Copy link
Contributor

When I use the fritzbox_ip arg, the ipv6 arg gets ignored. Only A records are getting updated. I am not sure if the problem is the script or my router though, I haven't looked at the code. Using the default config it updates both.

@mietzen
Copy link
Owner

mietzen commented May 11, 2024

Because we only get the IPv4 Address:

$ curl "http://fritz.box:49000/igdupnp/control/WANIPConn1" -H "Content-Type: text/xml; charset="utf-8"" -H "SoapAction:urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress" -d "<?xml version='1.0' encoding='utf-8'?> <s:Envelope s:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'> <s:Body> <u:GetExternalIPAddress xmlns:u='urn:schemas-upnp-org:service:WANIPConnection:1' /> </s:Body> </s:Envelope>" -s

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetExternalIPAddressResponse xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1">
<NewExternalIPAddress>123.123.123.123</NewExternalIPAddress>
</u:GetExternalIPAddressResponse>
</s:Body>
</s:Envelope>%

We could also get the IPv6 Adresse from the Fritzbox, but I don't see the point in doing so, unless you want to point your domain explicitly to the Fritzbox, is this what you want to achieve?

Here is an example for IPv6:

$ curl "http://fritz.box:49000/igdupnp/control/WANIPConn1" -H "Content-Type: text/xml; charset="utf-8"" -H "SoapAction:urn:schemas-upnp-org:service:WANIPConnection:1#X_AVM_DE_GetExternalIPv6Address" -d "<?xml version='1.0' encoding='utf-8'?> <s:Envelope s:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'> <s:Body> <u:GetExternalIPAddress xmlns:u='urn:schemas-upnp-org:service:WANIPConnection:1' /> </s:Body> </s:Envelope>"

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:X_AVM_DE_GetExternalIPv6AddressResponse xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1">
<NewExternalIPv6Address>2001:aaaa:bbbb:cccc:1111:2222:3333:4444</NewExternalIPv6Address>
<NewPrefixLength>64</NewPrefixLength>
<NewValidLifetime>12345</NewValidLifetime>
<NewPreferedLifetime>1234</NewPreferedLifetime>
</u:X_AVM_DE_GetExternalIPv6AddressResponse>
</s:Body>
</s:Envelope>%

@realbadidas
Copy link
Contributor Author

oooh, i completely forgot that ipv6 gives each device a different address, whoops, still thanks for the reply.

@mietzen
Copy link
Owner

mietzen commented May 11, 2024

I implemented it anyway, it might be a very niche use case but if some one wants to point their (sub)domain to their fritzbox, e.g. for a VPN connection, they are now able to do so.

mietzen added a commit that referenced this issue May 11, 2024
Also get IPv6 address from fritzbox, closes #55
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

Successfully merging a pull request may close this issue.

2 participants