CLI tool to look up BGP information from bgp.tools
- Shell 95.4%
- Makefile 4.6%
| bin | ||
| .gitignore | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
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