Merit Network
Can't find what you're looking for? Search the Mail Archives.
  About Merit   Services   Network   Resources & Support   Network Research   News   Events   Home

Discussion Communities: Merit Network Email List Archives

North American Network Operators Group

Date Prev | Date Next | Date Index | Thread Index | Author Index | Historical

Re: subnet aggregation script

  • From: Joe Abley
  • Date: Mon Sep 21 12:30:47 2009


On 2009-09-21, at 12:00, Ric Moseley wrote:


Does anyone know of a tool/script that can aggregate subnets feed to it
via command line? Meaning if I give it multiple /30s (or any size
subnet) it will scrunch them together.

I wrote this years ago and we used it in 6461 for various things.


ftp://ftp.isc.org/isc/aggregate/aggregate-1.6.tar.gz

Example:

#aggregate_subnets.script 192.168.0.0/30 192.168.0.4/30 10.0.0.16/29
10.0.0.24/29

#192.168.0.0/29 10.0.0.16/28

[octopus:~]% cat >input-file 192.168.0.0/30 192.168.0.4/30 10.0.0.16/29 10.0.0.24/29 [octopus:~]% [octopus:~]% aggregate <input-file >output-file aggregate: maximum prefix length permitted will be 32 [octopus:~]% cat output-file 10.0.0.16/28 192.168.0.0/29 [octopus:~]%

It's quite bad at dealing with really long lists, but it's ok for small applications. There's a manual page, and options, and stuff. You can make it show its working, if you're worried about whether it is sane.

[octopus:~]% aggregate -v <input-file
aggregate: maximum prefix length permitted will be 32
[    0] + 10.0.0.16/28
[    0] + 192.168.0.0/29
[    1] - 192.168.0.0/30
[    2] - 192.168.0.4/30
[octopus:~]%

I forget exactly what the numbers in the brackets mean, but from memory 0 means it's a generated prefix and anything else refers to a line number in the input stream. No doubt the source would provide illumination.

I don't remember why I thought it was a good idea to spit out the "maximum prefix length" warning to stderr every time.


Joe






Discussion Communities


About Merit | Services | Network | Resources & Support | Network Research
News | Events | Contact | Site Map | Merit Network Home


Merit Network, Inc.