Skip to content

robdanz/cf-bgp-prefixes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

This Cloudflare worker polls the RIPEstat API and gets the prefixes for an AS and puts them in a D1 database.

You need a D1 binding called "DB", and you need a table per ASN.

You need a table that looks like this: CREATE TABLE IF NOT EXISTS ASyourASNGoesHere ( id INTEGER PRIMARY KEY AUTOINCREMENT, prefix TEXT NOT NULL UNIQUE, active BOOLEAN NOT NULL DEFAULT TRUE, last_seen_at TEXT NOT NULL ); You can run the Worker as a cron, or you can force a manual update with

https://your-worker.goes-here.workers.dev/update?asn=AS14593 and this would get you all of the Starlink prefixes in AS14593.
Hypothetically, you could use this with another script to manage Cloudflare Gateway Lists. Hypothetically.

About

CF workers to get all the prefixes for an ASN and put them in D1

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published