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

Wrong IPv6? #16

Closed
martux69 opened this issue Mar 29, 2022 · 1 comment
Closed

Wrong IPv6? #16

martux69 opened this issue Mar 29, 2022 · 1 comment

Comments

@martux69
Copy link

Hi,
I run your awesome script on my home server behind a fritzbox and it works perfectly for IPv6. But IPv6 is faulty: The script detects the IPv6 address of my server and not the public address of my fritzbox.
Til now I'm not very familiar with ipv6 but I'm not sure wether it is possible to get the public ip address of the router by calling an external web site (as it is done by ipv4) in generally?
BTW: The URL https://ip6.seeip.org in the script seems not to be worked anymore (access forbidden), perhaps it would be a good solution to use https://api64.ipify.org (similar to the ipv4 url)?
Kind regards
Martin

@stecklars
Copy link
Owner

Dear @martux69,

Due to the nature of IPv6, every device in your home network usually has its own public IPv6 address (that might be firewalled by your router, but in theory, it is publicly accessible). For this reason, if you want to use the IPv6 address, I recommend you to run the script directly on the device you want to access. Then it should actually be the IP address that you need in order to access the device in question, so exactly what you want. The reason why with IPv4 you always get the router IP address is the usage of NAT. That is why you have to configure port forwarding and so on on your router for IPv4 (so that it knows to which device the request should be forwarded).

Theoretically, with IPv6 it is also possible to find out the public address on the device itself (but the most reliable way for all operating systems and without having to use some kind of tool and parse its output is probably still calling an external service, which is why I am doing it that way).

The URL you mentioned is currently working for me. Maybe it was a temporary outage? The script actually accesses another service (https://v6.ident.me/) in case it does not get a (valid) IP address by one of the services. So this should not affect the usage of the script, as long as the other service is still working.

Kind regards
Lars

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