Use RIPEstat for ASN announced prefixes

This commit is contained in:
Ettore
2026-04-08 22:46:03 +02:00
parent 52e6b4a9a0
commit fa1e465d4f
2 changed files with 61 additions and 43 deletions

View File

@@ -1,6 +1,6 @@
# netflix-asn
A small **Python utility** that fetches IPv4/IPv6 prefixes announced by one or more ASNs (via the [BGPView API](https://bgpview.io/api)) and ensures those prefixes are present in a MikroTik **IP firewall address-list**.
A small **Python utility** that fetches IPv4/IPv6 prefixes announced by one or more ASNs (via the [RIPEstat API](https://stat.ripe.net/)) and ensures those prefixes are present in a MikroTik **IP firewall address-list**.
Its designed to run inside **Docker** — using a `Dockerfile` and `docker-compose.yml`.
@@ -68,9 +68,11 @@ ADDRESS_LIST_NAME=Netflix
1. The script loads configuration from environment variables.
2. For each ASN, it queries:
```text
https://stat.ripe.net//data/announced-prefixes/data.json?resource=<ASN>"
```
https://api.bgpview.io/asn/<ASN>/prefixes
```
3. It collects all IPv4/IPv6 prefixes and removes duplicates.
4. Connects to the MikroTik API using [`librouteros`](https://pypi.org/project/librouteros/).
5. For each prefix: