Get the VPC IP Fragmentation Viewer running in under 5 minutes!
Choose one of these setups:
- Docker and Docker Compose installed
- AWS credentials configured (
~/.aws/credentialsor environment variables)
- Python 3.11+
- Node.js 18+
- AWS credentials configured
The application needs read-only access to EC2 APIs. Ensure you have AWS credentials configured:
# Option 1: AWS CLI credentials (recommended)
aws configure
# Option 2: Environment variables
export AWS_ACCESS_KEY_ID=your_key_id
export AWS_SECRET_ACCESS_KEY=your_secret_key
export AWS_DEFAULT_REGION=us-east-1Required IAM Permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeVpcs",
"ec2:DescribeSubnets",
"ec2:DescribeNetworkInterfaces"
],
"Resource": "*"
}
]
}./start.shThe script will guide you through starting either with Docker or local development.
# Create .env file
cp .env.example .env
# Start all services
docker-compose up
# Access the application
# Frontend: http://localhost:3000
# Backend API: http://localhost:5000# Terminal 1: Backend
./setup.sh
source venv/bin/activate
python app.py
# Terminal 2: Frontend
cd frontend
npm install
npm start- Select a VPC from the dropdown at the top
- Browse subnets in the left panel - they show:
- IP utilization percentage
- Fragmentation score
- Primary, secondary, and prefix delegation IP counts
- Click a subnet to see the detailed visualization
- Hover over IP blocks in the visualization to see:
- IP address
- Status (used/free/reserved)
- ENI details (for used IPs)
- IP type (primary, secondary, prefix delegation)
- Blue blocks - Primary ENI IPs (EC2 instances, load balancers, etc.)
- Cyan blocks - Secondary IPs (EKS pods without dedicated ENIs)
- Purple blocks - Prefix delegation IPs (EKS prefix mode)
- Gray blocks - AWS reserved IPs (.0, .1, .2, .3, and last IP)
- Light gray blocks - Available/free IPs
- 0-20 (Green) - Low fragmentation, most IPs are contiguous
- 21-50 (Orange) - Moderate fragmentation, some scattered allocations
- 51-100 (Red) - High fragmentation, many small gaps
High fragmentation can make it difficult to allocate large blocks of IPs, especially for:
- Prefix delegation (requires contiguous /28 blocks)
- Large EKS node groups
- Multiple secondary IPs per ENI
- Check AWS credentials: Run
aws sts get-caller-identityto verify - Check IAM permissions: Ensure you have the required EC2 describe permissions
- Check region: Verify you're looking at the correct AWS region
# Rebuild containers
docker-compose down
docker-compose up --build
# View logs
docker-compose logs backend
docker-compose logs frontend# Clear React cache
cd frontend
rm -rf node_modules package-lock.json
npm install
npm start- Deploy to ECS/EKS: See README.md for deployment instructions
- Customize: Modify visualization colors, grid size, or add new metrics
- Integrate: Use the REST API endpoints in your own tools
GET /api/vpcs- List all VPCsGET /api/vpc/<vpc_id>/subnets- Get subnets with statisticsGET /api/subnet/<subnet_id>/ips- Get detailed IP allocation mapGET /api/health- Health check
Example:
curl http://localhost:5000/api/vpcs
curl http://localhost:5000/api/vpc/vpc-12345/subnets
curl http://localhost:5000/api/subnet/subnet-67890/ips- Large subnets (>/28) may take a moment to load the full IP map
- Refresh regularly - IP allocations change as pods are created/deleted
- Monitor fragmentation over time to identify allocation patterns
- High fragmentation may indicate the need to recreate the subnet or consolidate workloads
For issues or questions:
- Check the README.md for detailed documentation
- Review the application logs for error messages
- Ensure AWS credentials and permissions are correct