[ixpmanager] Update from PeeringDB
Arnold Nipper
arnold at nipper.de
Thu May 11 12:07:32 IST 2023
On 05.05.2023 22:09, Richard Laager via ixpmanager wrote:
> Yes, my request is for importing AS-SET and max-prefix information from PeeringDB into IXP Manager.
>
I've hacked a q&d bash script which takes the asn from your IX-F JSON
and retrieves AS-SET and max-prefix information from PeeringDB formatted
as TSV. You know better how to import this information into IXP Manager.
Arnold
--
Keep calm, keep distance, keep connected!
Arnold Nipper
email: arnold at nipper.de
mobile: +49 172 2650958
-------------- next part --------------
#! /bin/bash
#
# Arnold Nipper, arnold at nipper.de
#
# Your "ixp_id". This is to single out the IXP in question if you have multiple IXP in one IX-F JSON
IXPID=5
# (public) URL to your IXF-JSON
URL=https://portal.de-cix.net/customer_nyc
# Compile a list of ASN connected to your IXP
ASNLIST=$(curl -sGL "${URL}" | jq -r -c '[.member_list[] | select (.connection_list[].ixp_id == '$IXPID') | .asnum] | unique | @csv')
# echo $ASNLIST;exit
# Retrieve asn, max_pref (IPv4, IPv6), as-set from PeeringDB
curl -sG https://www.peeringdb.com/api/net \
--data-urlencode asn__in=$ASNLIST \
--data-urlencode fields=asn,irr_as_set,info_prefixes4,info_prefixes6 \
| jq -r '.data[] | .asn, .irr_as_set, .info_prefixes4, .info_prefixes6' \
| paste - - - - \
| sort -n
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 203 bytes
Desc: OpenPGP digital signature
URL: <https://www.inex.ie/pipermail/ixpmanager/attachments/20230511/b02537c0/attachment.sig>
More information about the ixpmanager
mailing list