All pastes #361480 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-02-18 04:36 UTC
rendered paste body
#!/usr/bin/perl -w
# Ultimately this script will calculate a list of IPv6 ip's within the specified
# range of elements.  Useful for DNS generation.

use strict;

# for starters, we will simply output a list of ip's from a single /64 subnet
# starting at 0000 and ending at ffff

my $prefix = "3ffe:b80:d92";
my $subnetlen = "/64";
my $firstsubnet = "0000";
my $finalsubnet = "ffff";

print "$prefix" . "\:\:" . "\/48\n";

#my $x = 0;
#for($x = 0; $x < 10; $x++) {
#       print "yada $x\n";
#}

for($firstsubnet = 0000; $firstsubnet < 10000; $firstsubnet++) {
        print "$prefix" . "\:" . "$firstsubnet" . "\:\:" . "\/64\n";
}