AWS Load Balancer with a static IP address
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
In the evolving landscape of cloud computing, reliable load balancing is a fundamental requirement for distributing incoming application traffic across multiple targets. AWS (Amazon Web Services) offers robust load balancing solutions through its Elastic Load Balancing (ELB) service. While ELB is powerful and flexible, a common limitation faced by organizations is the need for static IP addresses, especially for applications that require IP whitelisting or have strict security compliance requirements. AWS now supports using a Network Load Balancer (NLB) with static IP addresses to address these needs.
AWS Load Balancers Overview
AWS provides several types of load balancers, each catering to different types of workloads:
- Application Load Balancer (ALB): Operates at the application layer (OSI layer 7). Ideal for HTTP and HTTPS traffic.
- Network Load Balancer (NLB): Functions at the transport layer (OSI layer 4). Best suited for TCP and UDP traffic where need for high performance and low latency is critical.
- Classic Load Balancer: Primarily used for EC2-Classic networks, but largely deprecated for new applications.
The focus here is on the Network Load Balancer, which now supports static IP addresses.
Network Load Balancer with Static IP
The introduction of static IP addresses for NLBs addresses several key scenarios where static IPs are necessary:
- IP Whitelisting: Companies often require certain workloads to only accept traffic from predetermined IP address ranges.
- Firewall Rules: Updating allowed IPs in firewall configurations or for regulatory compliance often demands static IPs.
- DNS Requirements: Some DNS setup scenarios can benefit from static IPs rather than dynamic IP addresses offered through conventional load balancing.
How Network Load Balancer Provides Static IPs
When you create a Network Load Balancer in a Virtual Private Cloud (VPC), AWS assigns an Elastic IP (EIP) to each Availability Zone where the load balancer operates. These EIPs serve as the static IP addresses for the load balancer.
Example Configuration Steps
- Create NLB:
- Log in to the AWS Management Console.
- Open the EC2 Dashboard and navigate to the Load Balancers section.
- Choose the "Create Load Balancer" and select "Network Load Balancer".
- Configure the listeners and select target groups as usual.
- Assign Elastic IPs:
- During configuration, allocate Elastic IPs for each subnet in each Availability Zone where the NLB is deployed.
- Ensure these Elastic IPs are associated with the Network Load Balancer.
- DNS Setup (if needed):
- Configure DNS to point to the assigned EIP(s).
By doing so, traffic routed through the NLB will be associated with the static IPs, ensuring consistent access points for clients.
Technical Considerations
- Scalability and Performance: NLBs are built to handle millions of requests per second while maintaining ultra-low latency, which is critical for real-time application's performance.
- Cross-Zone Load Balancing: By default, NLB distributes incoming requests evenly across targets in all enabled AZs. Ensure this feature meets your specific redundancy and scaling requirements.
- Networking and Security: Security group configurations don’t directly apply to Network Load Balancers. Instead, network ACLs are used to manage traffic flow.
- Health Checks: Custom health checks ensure that requests are only routed to healthy targets, removing any non-responsive instances from the rotation.
Limitations and Best Practices
While the static IP feature of AWS NLB is a significant enhancement, users must consider certain limitations and best practices:
- Regional Availability: Verify that the static IP feature is available in your preferred AWS Region.
- Elastic IP Limits: AWS accounts have default limits on the number of Elastic IPs per region, so plan accordingly.
- Cost Considerations: While Elastic IPs are generally low-cost, ensure you understand how these might add to your overall AWS hosting costs.
Summary Table
| Feature/Aspect | Network Load Balancer (NLB) |
| IP Type | Static (Elastic IP) |
| Supported Protocols | TCP, UDP |
| Layer | Transport Layer (OSI Layer 4) |
| Main Use Case | High performance, low-latency traffic requiring static IPs |
| Scalability | Automatically scalable (millions of requests/second) |
| Load Balancing Type | Optional cross-zone load balancing |
| Security | Network ACLs (instead of security groups) |
| Health Checks | Customizable, target-based |
AWS Network Load Balancers with static IPs provide a versatile solution for enterprises needing reliable and consistent ingress IP addresses alongside state-of-the-art load balancing features. With proper planning and implementation, they can enhance application performance and security while simplifying networking configurations within AWS environments.

