commandline request to get ipv6 address as from test-ipv6.com

gives me an ipv6 address as:

"Your IPv6 address on the public Internet appears to be 2604:...."

How can I get that information through the commandline?

For IPv4 I can do this :

 wget -qO- 

and get the external IPv4 ip for my LAN

I want that service for IPv6. IPv6 is a different animal I understand but the notion of external access by host is still relevant.

I see that test-ipv6.com returns a different internet IPv6 address for each of my LAN-hosts' net devices alternatively there may be a way of getting that info from the output of each host. So:

 ip a | grep inet6 

will list the IPv6 addresses associated with each network device but I don't know how to identify which one of those addresses is the address "on the public internet". Is there a universal rule, a pattern that identifies that address?

3

1 Answer

I found this on a gist

curl -s ipv6.icanhazip.com | xargs echo -n

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like