Monday, February 9, 2009

A cool IPv6 trick

Connect to m0n0wall's website via IPv4 and the page displays the static info you'd expect when connecting to the website. Connect with an IPv6 machine (or a dual stack machine) and the website displays your IPv6 address in an area normally left blank.


I'm let to wonder how they did this. So far all the IPv6 websites I've connected to had host names that were mapped to IPv6 addresses or the URL itself had something IPv6 specific contained therein (http://ipv6.google.com for instance).

So far this is the first website I've encountered that either connects via IPv6 first and then IPv4 or it is just simply gathering the address out of the connect statement and is pasting it on the page but still using IPv4 as the transport.

I guess I won't figure it out until break out the protocol analyzer.

If it would be possible to have one URL but direct clients to different hosts depending if they connected using IPv4 or IPv6, well, that would be pretty freaking awesome and a great way to do load balancing. I'm pretty sure the Big Iron F5 could do something like this but that's a whole other story. I think I'll write the m0n0 webmaster to see what trickery is going on back there.

My curiosity is piqued!

2 comments:

Paul said...

There's no magic or trickery involved; m0n0.ch is a dual-stack domain. If you connect over IPv6, a server-side script prints out your address.

$ host m0n0.ch
m0n0.ch has address 80.254.71.228
m0n0.ch has IPv6 address 2a02:200:3:1::101

There are lots of sites out there that echo back the address you're connecting from.

See also: http://whatismyipv6.net/

Parlez à la Main said...

Thanks! I knew there was a simple answer I was overlooking.