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

Installation

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.

Usage

$ 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

Examples

# search for unallocated blocks between VPCs in 10.0.0.0/8
$ vpc-free 10.0.0.0/8
MIN IP    MAX IP         MASK SIZE     BEST         LABEL
10.0.0.0  10.63.255.255  /10  4194304  10.0.0.0/10  FREE
10.64.0.0 10.64.255.255  /16  65536                 vpc-c4871ca0 (Demo)
10.65.0.0 10.255.255.255      12517376 10.128.0.0/9 FREE

# search for unallocated blocks between subnets in a VPC
$ vpc-free vpc-c4671caf
10.64.0.0  10.64.15.255  /20  4096                 subnet-74247002 (Subnet 1)
10.64.16.0 10.64.31.255  /20  4096                 subnet-d32421a5 (Subnet 2)
10.64.32.0 10.64.47.255  /20  4096  10.64.32.0/20  FREE
10.64.48.0 10.64.63.255  /20  4096                 subnet-0a257077 (Subnet 4)
10.64.64.0 10.64.255.255      49152 10.64.128.0/17 FREE

Project details


Download files

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

Source Distribution

vpc-free-1.1.0.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file vpc-free-1.1.0.tar.gz.

File metadata

  • Download URL: vpc-free-1.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for vpc-free-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d42bd9b3f998243ef9c4a4736cc514d54af2eeaa1ea43d7ab0981660e5e39d01
MD5 64ba24254a993e7fdd70b49be32e0c0f
BLAKE2b-256 5a5437bcfc7021d663ea8f56d385a3999e776b3a7ee6cf9fbf3cb37437693e9d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page