Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pfx2as subcommand for bulk prefix-to-as lookup #72

Merged
merged 3 commits into from
Mar 4, 2025
Merged

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.

1 participant