CLI tool to look up BGP information from bgp.tools
  • Shell 95.4%
  • Makefile 4.6%
Find a file
2026-07-03 14:10:08 +02:00
bin Clean up unused variables and simplify input validation 2026-03-19 11:48:30 +01:00
.gitignore Add .gitignore for local-only CLAUDE.md 2026-07-03 14:06:26 +02:00
LICENSE Initial release of bgptools-cli v1.0.0 2026-03-19 11:21:59 +01:00
Makefile Initial release of bgptools-cli v1.0.0 2026-03-19 11:21:59 +01:00
README.md Update README.md 2026-07-03 14:10:08 +02:00

bgptools-cli

A command-line tool to look up BGP information from bgp.tools via whois.

Install

Homebrew

brew tap olerap/tap https://git.oles.network/olerap/homebrew-tap.git
brew trust olerap/tap
brew install olerap/tap/bgptools

The brew trust step is required since Homebrew 6, which only loads formulae from third-party taps after you explicitly trust them.

Manual

git clone https://git.oles.network/olerap/bgptools-cli.git
cd bgptools-cli
make install

Usage

# Look up an ASN
bgptools AS13335
bgptools 13335

# Look up an IP address
bgptools 1.1.1.1
bgptools 2606:4700::1111

# Options
bgptools --help
bgptools --version

ASN lookup

Shows name, ASN, country, registry, and allocation date.

AS13335 - Cloudflare, Inc.
────────────────────────────────────────

Name:                Cloudflare, Inc.
ASN:                 AS13335
Country:             US
Registry:            arin
Allocated:           2010-07-14

IP lookup

Shows BGP prefix, origin AS, country, registry, and allocation date.

1.1.1.1 -> 1.1.1.0/24
────────────────────────────────────────

Name:                APNIC-LABS
ASN:                 AS13335
IP:                  1.1.1.1
BGP Prefix:          1.1.1.0/24
Country:             AU
Registry:            apnic
Allocated:           2011-08-11

Requirements

  • bash (4.0+)
  • whois

License

MIT