Skip to content

Instantly share code, notes, and snippets.

@n-st
Created October 28, 2019 16:30
Show Gist options
  • Save n-st/2644e34965e82c0429030ade90cb5340 to your computer and use it in GitHub Desktop.
Save n-st/2644e34965e82c0429030ade90cb5340 to your computer and use it in GitHub Desktop.
Get parsable peer list for given IXP from PeeringDB
# Compare which peers are present at different IXPs:
curl -s https://www.peeringdb.com/api/ix/123 | jq .data[0].ixlan_set[].id | xargs -I@ curl -s https://www.peeringdb.com/api/ixlan/@ | jq -j -r '.data[0].net_set[]|(.name,", AS ",.asn, "\n")' | sort > kleyrex.txt
# Let's you do things like "show me peers that are present at Locix, but not at Kleyrex"
comm -23 locix.txt kleyrex.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment