Skip to content

A simple CLI tool to get CIDR ranges from common internet providers

Notifications You must be signed in to change notification settings

franzramadhan/cidrlist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cidrlist

Simple cli to get CIDR list from well known providers

Available Providers

Provider name Constant name Source of IP addresses
akamai cidrlist.ProviderAkamai Akamai Origin IP ACL
aws cidrlist.ProviderAWS AWS IP Address Ranges
cloudflare cidrlist.ProviderCloudflare Cloudflare IP Ranges
gcp cidrlist.ProviderGCP Google Cloud Global & Regional IP Address Ranges
google cidrlist.ProviderGoogle Google IP Address Ranges

Usage

Install the library using the following command:

go get -u github.com/franzramadhan/cidrlist

Implementation example:

package main

import (
	"fmt"

	"github.com/franzramadhan/cidrlist"
)

func main() {
	ips, err := cidrlist.Get(cidrlist.ProviderAWS)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Printf("IP of provider %s:\n", cidrlist.ProviderAWS)
	for _, ip := range ips {
		fmt.Println(ip)
	}
}

CLI Usage

Install cidrlist CLI using the following command:

go install github.com/franzramadhan/cidrlist/cmd/cidrlist@latest

Usage:

cidrlist get <provider-name>
cidrlist get cloudflare
cidrlist get gcp

About

A simple CLI tool to get CIDR ranges from common internet providers

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages