IPv6 aggregation tool

Hi list,

I can't seem to find any tools that'll aggregate a list of IPv6 prefixes.
Used to 'aggregate' for IPv4, looking for something similar for IPv6.

Looks like the most recent NetAddr::IP perl module will do it:


Take a look at the Compact function. I think that's what will do it.


Found this tool that works perfectly.


Hoping this'll help someone else here on the list. Thanks!

The Net::CIDR package contains functions that manipulate lists of
IP netblocks expressed in CIDR notation. The Net::CIDR functions
handle both IPv4 and IPv6 addresses.

WWW: http://search.cpan.org/dist/Net-CIDR/

Thx, this is at least three times faster than what I have here.

Just a comment on the final print statement, which doesn't fit my needs
for ipv6:

- print "prefix: ", $_->prefix(), "\n";
+ print "print: " , $_->print(), "\n";

- prefix: 2001:0db8:0000:0000:0000:0000:0000:0000/32
+ print: 2001:db8::/32

Rgds, Stefan

:slight_smile: thanks! Was wondering how to do that.

:slight_smile: thanks! Was wondering how to do that.

$ perldoc Net::IP :wink: That doc's a fine one to read also for other