I have a raspberry pi 4 running home assistant and using Duckdns for DDNS. But when I ping my Duckdns domain under Wifi condition, it returns a public IP not a local IP.
It still work when I using a PC, but unassailable when I using a cellphone. I guess maybe due to the IPv6 doesn't loopback.
How can I do to solve it? Thanks!
That shouldn't be a problem for ipv6. for ipv4 it's probably returning the router's public IP, which then of course doesn't work from within the LAN. Is that what you mean? My suggestion is to drop the ipv4 from the duckdns and just always connect via ipv6. When you don't have ipv6 use a VPN.
I don't understand why it can work on PC but can't on my cellphone? Both of them are using wifi connection.
For duckdns I don't use IPv4 cause I don't have a public IP of IPv4. It always connect via IPv6.
I just want to make the duckdns domain can loopback to raspberry pi under wifi connection.
If you are publishing only an ipv6 then it should just work. The cell phone looks up the address and connects to it... As long as the cell has an ipv6 it can connect. There is no "loopback" just a connection from the cell to the host. If it doesn't work it sounds like it is a problem with the cell. What does the cell phone show when you go to http://icanhazip.com does it show a public ipv6?
Yes, it returns the public Ipv6 the same as my router get.
Every device should have its own separate IPv6 it shouldn't be the same as your router.
My router is a 4G LTE wifi device. I can only get one public IPv6 for my router. I have to use port forwarding rules to make my raspberry pi accessible form outside.
Yeah that's no good. Set up a tunnel with hurricane electric