Skip to content

Instantly share code, notes, and snippets.

View Heidistein's full-sized avatar

Arjen Heidinga Heidistein

  • Duocast
  • Netherlands
View GitHub Profile
@Heidistein
Heidistein / cedrCompress.py
Created November 22, 2022 08:59
cidrmerge
#!/usr/bin/python
# Author: Arjen Heidinga <dexter@beetjevreemd.nl>
# Licence: GPL
# A script that compresses/merges/consolidates a list of CIDR addresses.
# It will remove prefixes that are already contained in a 'supernet'.
# It will try to combine smaller subnets into a supernet (ie find both /24's of a /23)
# It will toss out prefixes that are larger than specified (nothing more specific than /24)