Android Question How to find out IPv6 Address ?

fs007

Member
A wifi interface can have multiple global (public) ip adresses in IPv6 and at least one LinkLocal Address. That's nothing new.

But how can i find out these adresses in B4A ? ServerSocket.GetMyWifiIp only gives me the IPv4 address.
 

drgottjr

Expert
Licensed User
Longtime User
i apologize in advance if my information is outdated, but if you are sitting behind a router or a cellular service provider's firewall(s), you can't
even see your own public IPv4 IP address, let alone what IPv6 addresses you may have. and even if you could, with CG-NAT and other programs, your
address is shared among others and is not necessarily the same for any particular period of time. the only way to know your own external addresses
is to use an online service that tells you.
 
Upvote 0

fs007

Member
i apologize in advance if my information is outdated, but if you are sitting behind a router or a cellular service provider's firewall(s), you can't
even see your own public IPv4 IP address, let alone what IPv6 addresses you may have. and even if you could, with CG-NAT and other programs, your
address is shared among others and is not necessarily the same for any particular period of time. the only way to know your own external addresses
is to use an online service that tells you.
Sorry, drgottjr, but that's not correct: IPv6 does NOT know something like NAT (or CG-NAT). Every device, even behind a router, has a globally routable ip adress. (i'm not speaking of cellular networks, but of WiFi, see my post above).
The device gets the prefix by so called prefix delegation from the router and the suffix is basicly build out of the MAC-adress or is even choosen randomly for sake of privacy (and then told the router by NDP).

But i can put my question even in this form: How can i find out in B4A the IPv6 Wifi adress of an Android device, may it be private or public ?

Regarding IPv4 your answer is correct of corse
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
Sorry, drgottjr, but that's not correct: IPv6 does NOT know something like NAT (or CG-NAT). Every device, even behind a router, has a globally routable ip adress. (i'm not speaking of cellular networks, but of WiFi, see my post above).
The device gets the prefix by so called prefix delegation from the router and the suffix is basicly build out of the MAC-adress or is even choosen randomly for sake of privacy (and then told the router by NDP).

But i can put my question even in this form: How can i find out in B4A the IPv6 Wifi adress of an Android device, may it be private or public ?

Regarding IPv4 your answer is correct of corse
you can add this to those suggested in the link. thanks for bringing me up to date!
 

Attachments

  • getmyip6addr.zip
    9.4 KB · Views: 23
  • ipv6.png
    ipv6.png
    47.3 KB · Views: 25
Upvote 0
Top