Why does a subnet that load balancers use in my VPC have insufficient IP addresses?

2 minute read

A subnet in my virtual private cloud (VPC) ran out of available IP addresses, and I'm using this subnet with Elastic Load Balancing load balancers.

Short description

If subnets in your VPC run out of available IP addresses, then AWS resources, such as load balancers, might not respond to increased traffic.

It's a best practice to keep at least eight IP addresses available in each subnet. There are two ways to free up or add IP addresses to use with load balancers. The following methods apply to both Application Load Balancers and Classic Load Balancers:

  • Delete unused elastic network interfaces to free up IP addresses in the subnet.
  • Create and add a new subnet to your VPC.

Note: Load balancers can have only one subnet per Availability Zone. Review the other requirements for subnets on a load balancer.


Delete unused elastic network interfaces

To delete an unused elastic network interface, see Delete a network interface.

Add a new subnet with available IP addresses for your load balancer

  1. Create and add a new subnet to your VPC.
    Note: You can create a new subnet using the VPC's original CIDR blocks. You can also add CIDR blocks to your VPC to use with the new subnet.
  2. Replace your old subnet with the new subnet. For Classic Load Balancers, see Add a subnet. For Application Load Balancers, see Availability Zones for your Application Load Balancer.
  3. Check the route tables and network access control list (network ACL) rules that are associated with your subnet. Make sure that your new subnet routes traffic the same way that your previous subnet did. For example, if you configured a default route to an internet gateway in your previous subnet, then make sure that your new subnet has a similar route.
  4. (Optional) As a best practice, turn on cross-zone load balancing.

Related information

Tutorial: Create a Classic Load Balancer

Tutorial: Create an Application Load Balancer using the AWS Command Line Interface (AWS CLI)

AWS OFFICIALUpdated 10 months ago