Skip to content

Conversation

@digizeph
Copy link
Member

@digizeph digizeph commented Mar 4, 2025

Usage

Bulk prefix-to-AS mapping lookup with the pre-generated data file

Usage: monocle pfx2as [OPTIONS] <INPUT>...

Arguments:
  <INPUT>...  IP prefixes or prefix files (one prefix per line)

Options:
      --data-file-path <DATA_FILE_PATH>
          Prefix-to-AS mapping data file location [default: https://data.bgpkit.com/pfx2as/pfx2as-latest.json.bz2]
      --debug
          Print debug information
  -e, --exact-match
          Only matching exact prefixes. By default, it does longest-prefix matching
      --json
          Output as JSON objects
  -h, --help
          Print help
  -V, --version
          Print version
➜  cargo run --release -- pfx2as 1.1.1.0/24 8.8.8.0/24 --json
[
  {
    "origin": 13335,
    "prefix": "1.1.1.0/24"
  },
  {
    "origin": 15169,
    "prefix": "8.8.8.0/24"
  }
]

@digizeph digizeph merged commit c61203b into main Mar 4, 2025
1 check passed
@digizeph digizeph deleted the feature/pfx2as branch March 4, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants