Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am niu789 on github.
  • I am niu789 (https://keybase.io/niu789) on keybase.
  • I have a public key ASA48XdHkpKVBCMcQ08NinFI3NmxzPFbdeyq6lWb3IBM4Qo

To claim this, I am signing this object:

@niu789
niu789 / aggregate-cidr-addresses.pl
Created August 22, 2017 20:11 — forked from denji/README.md
Take a list of CIDR address blocks and combine them, for example, 192.168.0.0/24 and 192.168.1.0/24 gives 192.168.0.0/23. I usually use "list-iana-reserved-ranges | aggregate-cidr-addresses" to get a list of blocks to not report with firewall log processing.
#!/usr/bin/perl
#
# aggregate-cidr-addresses - combine a list of CIDR address blocks
# Copyright (C) 2001,2007 Mark Suter <suter@zwitterion.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#