Skip to main content

Find free IP address blocks in AWS EC2

Project description

This script searches for the largest available IP subnets within the unallocated spaces between your VPC subnets, or between VPCs for a given CIDR block.

free address blocks in a VPC


Install vpc-free to /usr/local/bin with:

$ pip install vpc-free

The script uses the Amazon AWS SDK (boto3) to connect to AWS. The SDK must be configured with credentials to connect to the AWS APIs. Please see the Boto3 documentation for instruction.


$ vpc-free -h
usage: vpc-free [-h] TARGET

Find free IP blocks in AWS EC2.

positional arguments:
  TARGET      CIDR, VPC ID or VPC Name to search

optional arguments:
  -h, --help  show this help message and exit


# search for unallocated blocks between VPCs in
$ vpc-free
MIN IP    MAX IP         MASK SIZE     BEST         LABEL  /10  4194304  FREE  /16  65536                 vpc-c4871ca0 (Demo)      12517376 FREE

# search for unallocated blocks between subnets in a VPC
$ vpc-free vpc-c4671caf  /20  4096                 subnet-74247002 (Subnet 1)  /20  4096                 subnet-d32421a5 (Subnet 2)  /20  4096  FREE  /20  4096                 subnet-0a257077 (Subnet 4)      49152 FREE

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for vpc-free, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size vpc-free-1.1.0.tar.gz (4.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page