Thoughts about ipv6 white listing

Tore Anderson tore.anderson at
Sat Dec 4 20:18:22 CET 2010

* Mikael Abrahamsson

> It would be great if someone would produce a opensource javascript (or
> alike) snippet which would try to verify if IPv6 connectivity was broken
> and give people some kind of "your IPv6 is broken and this will cause
> you problems in the future, please press ok that you're aware of
> this"-window on top of the website in question.

Here's something to get you started.  No copyright restrictions whatsoever,
but I'd be happy to hear about it if other sites are enabling something
like this too.  We intend to keep it running even after dual-stacking,
so that the users that endure the initial connect timeout will get the
warning (perhaps making it even more obvious and in-your-face).

$ curl -s | grep -A100 'Start of dualstack test code'
<!-- Start of dualstack test code -->
<img id="1x1_ds_testimg_1" class="1x1_ds_testimg" width="1" height="1">
<img id="1x1_ds_testimg_2" class="1x1_ds_testimg" width="1" height="1">
<img id="1x1_ds_testimg_3" class="1x1_ds_testimg" width="1" height="1">
<img id="1x1_v4_testimg_1" class="1x1_v4_testimg" width="1" height="1">
<img id="1x1_v4_testimg_2" class="1x1_v4_testimg" width="1" height="1">
<img id="1x1_v4_testimg_3" class="1x1_v4_testimg" width="1" height="1">
<img id="1x1_v4_only" class="1x1_v4_testimg" width="1" height="1">

<script language="javascript" type="text/javascript">
// record the number of dualstack and ipv4-only successes
var ds_ok = 0;
var v4_ok = 0;

$('.1x1_ds_testimg').load(function() {

$('.1x1_v4_testimg').load(function() {

var VGIpV6 = function () {
    var d = new Date();
    timestamp = d.getTime(); // Milliseconds
    timestamp = Math.round(timestamp / 1000); // Seconds

    // load the test images and try to bust some caches
    $('#1x1_ds_testimg_1').attr('src', '' + timestamp);
    $('#1x1_ds_testimg_2').attr('src', '' + timestamp);
    $('#1x1_ds_testimg_3').attr('src', '' + timestamp);
    $('#1x1_v4_testimg_1').attr('src', '' + timestamp);
    $('#1x1_v4_testimg_2').attr('src', '' + timestamp);
    $('#1x1_v4_testimg_3').attr('src', '' + timestamp);

    // check the result of the test after 15 seconds have passed
    var t = setTimeout(function() {
        // we take the conservative approach here.  100% success with
        // IPv4 combined with 0% success with dualstack is necessary
        // to give user a warning about broken IPv6
        if(v4_ok == 3 && ds_ok == 0) {
            $("head").append('<link rel="stylesheet" type="text/css" href="" />');
            $("body").append('<div id="typoContainer"><h2>Du har en nettverksfeil!</h2>\
                                    <div class="trControls">\
                                        <p id="trMessages" class="trMessages">Du har problemer med IPv6</p>\
                                        <p class="trHelpLink trMessages" style="text-align: left;"><a target="_new" href="">Klikk her for hjelp</a></p>\
            $('#1x1_v4_only').attr('src', '' + d.getTime());
    }, 5000);

Tore Anderson
Redpill Linpro AS -
Tel: +47 21 54 41 27

More information about the ipv6-ops mailing list