Tuesday, 27 March 2007

Summarizing an IP address range

As I've mentioned previously, I've found IPy python module to be extremely useful for manipulating IP addresses. One such use is a script I've written to summarize an IP address range into the networks that make it up. The script supports both IPv4 and IPv6 addresses.

Example usage:
$ ./summarize.py

or alternatively as a python module:
>>> from summarize import summarize
>>> summarize('', '')
['', '', '', '', '', '', '', '']

The source for this script is available for download from the Wad of Stuff repository.

1 comment:

NoahGift said...

IPy is very nice. Glad to see another person using it too.