4 ms·
Disclaimer I work for IPinfo. If you can download the free IPinfo IP to ASN database CSV file. You can run the following command to get the IP ranges of an ASN
by reincoder 3y ago
Disclaimer I work for IPinfo.
If you can download the free IPinfo IP to ASN database CSV file. You can run the following command to get the IP ranges of an ASN.
```
grep AS19551 asn.csv | ipinfo range2cidr | cut -f1 -d ','
```
You will need to install the IPinfo CLI to convert the IP range to their CIDR equivalent. I believe the range2cidr command is also available as a standalone binary as well.
After that, you might want to aggregate the IP ranges to bigger ranges. I have used this in the past for this:
https://github.com/job/aggregate6 https://github.com/job/aggregate6
- bswinnerton 3y agoHere's a simpler alternative with IP Guide that doesn't require a CLI: curl -sL ip.guide/AS19551 | jq .routes
- Kirce 3y agoI didn't know ipinfo had a cli, good to know, i'll have a Look. Thank you! I'm currently using ipset, that does aggregation if I remember correctly, but aggregate6 looks good!
- reincoder 3y agoThe CLI has a bunch of features. I highly recommend checking out the `help` output for the CLI. Personally, I use the `grepip`, `bulk`, and `summarize` commands on a daily basis.