rpsl and bird

Matthew Walster matthew at walster.org
Wed Apr 27 13:40:13 UTC 2011


On 26 April 2011 18:15, Manh Do <mdo at equinix.com> wrote:
> Once you have the final version of the script ‘filter.sh’ which will
> incorporate the lookup of the prefixes, can you make it post it again?

The version I had published already did the lookup of the prefixes,
though it was a little "nasty" in that it just searched for lines with
"route:" in them. The latest version uses the commands to the RADB
whois server as outlined by others.

It can be found at:

https://github.com/dotwaffle/filterlist/blob/master/filter.sh

Run it to get the usage information:

./filter.sh: A filterlist generator
Usage: ./filter.sh [OPTS] AS-SET
    -t | --type [juniper | cisco | brocade]
    -n | --name [Filter Name]

For instance:

[dotwaffle at baud:Code/filter]$ ./filter.sh AS-IXREACH
212.9.96.0/24
212.9.96.0/19
188.74.64.0/18
109.246.192.0/20
109.246.128.0/18
109.246.32.0/20
46.18.168.0/21
91.196.184.0/22
91.196.184.0/24
91.196.185.0/24
91.196.186.0/24
91.196.187.0/24

or suitable or inserting into a config:

[dotwaffle at baud:Code/filter]$ ./filter.sh -t cisco -n IXREACH AS-IXREACH
ip prefix-list IXREACH 10 permit 212.9.96.0/24
ip prefix-list IXREACH 20 permit 212.9.96.0/19
ip prefix-list IXREACH 30 permit 188.74.64.0/18
ip prefix-list IXREACH 40 permit 109.246.192.0/20
ip prefix-list IXREACH 50 permit 109.246.128.0/18
ip prefix-list IXREACH 60 permit 109.246.32.0/20
ip prefix-list IXREACH 70 permit 46.18.168.0/21
ip prefix-list IXREACH 80 permit 91.196.184.0/22
ip prefix-list IXREACH 90 permit 91.196.184.0/24
ip prefix-list IXREACH 100 permit 91.196.185.0/24
ip prefix-list IXREACH 110 permit 91.196.186.0/24
ip prefix-list IXREACH 120 permit 91.196.187.0/24

However, as Randy says, "peval" will do 99% of the job that does too
and since this is the IRRToolset mailing list, I feel a little guilty
for pimping my poor excuse for coding on it ;)

[dotwaffle at baud:src/peval]$ ./peval AS-IXREACH
({212.9.96.0/19, 212.9.96.0/24, 188.74.64.0/18, 109.246.192.0/20,
109.246.128.0/18, 109.246.32.0/20, 91.196.184.0/22, 91.196.184.0/24,
91.196.185.0/24, 91.196.186.0/24, 91.196.187.0/24, 46.18.168.0/21})

Hope that helps!

M



More information about the irrtoolset mailing list