How to easily deaggregate an IP address range

A few days ago I needed to nullroute an address range, so I found myself with the incredibly tedious task of de-aggregating IP ranges.

Sure that I wouldn’t do such thing by hand, I googled around and found ipcalc, which can be installed on most Linux systems:

1
2
3
4
5
$ apt-get install ipcalc

$ ipcalc 1.2.168.0 - 1.2.169.255
deaggregate 1.2.168.0 - 1.2.169.255
1.2.168.0/23

As simple as that!


In the mood for some more reading?

...or check the archives.