Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Load Balancer with a static IP address

I have a set-up running on Amazon cloud with a couple of EC2 Instances running through a load balancer.

It is important that the site has a unique(static) IP or set of IPs as I'm plugging in 3rd party APIs which only accept requests made from IPs which have been added to their whitelist.

So basically unless we can give these 3rd parties a static IP or range of IPs that the requests from the site will always come from then we would be unable to make any calls to them.

Anyone knows how to achieve this as I know that Elastic IPs are not compatible with load balancers?

If I were to look up the IP of the load balancer DNS name (e.g. dualstack.awseb-BAMobile-ENV-xxxxxxxxx.eu-west-1.elb.amazonaws.com resolves to 200.200.200.200) would that IP be Static?

Any help/advise is greatly appreciated guys.

like image 794
AndrewB87 Avatar asked Dec 07 '12 16:12

AndrewB87


People also ask

Can application load balancer have static IP?

Short description. You can't assign a static IP address to an Application Load Balancer. If you need a static IP address for your Application Load Balancer, it's a best practice to register the Application Load Balancer behind a Network Load Balancer.

Can AWS alb have static IP?

With this feature, you can now use AWS PrivateLink and expose static IP addresses for applications built on ALB. ALB is a managed layer 7 proxy that provides advanced request-based routing. NLB operates at layer 4 and provides support for PrivateLink and zonal static IP addresses.

Does AWS load balancer have IP address?

These are the IP addresses where the clients should send the requests that are destined for the load balancer. However, Classic Load Balancers and Application Load Balancers use the private IP addresses associated with their elastic network interfaces as the source IP address for requests forwarded to your web servers.

Does application load balancer support AWS privatelink and static IP addresses?

Cloud expert, remote work enthusiast and speaker. Amazon recently announced that the Application Load Balancer supports AWS PrivateLink and static IP addresses by direct integration with the Network Load Balancer. The new feature combines the capabilities of two AWS services, the Network Load Balancer (NLB) and the Application Load Balancer (ALB).

How do private IP addresses work in Elastic Load balancing?

When you create an internal load balancer, you can optionally specify one private IP address per subnet. If you do not specify an IP address from the subnet, Elastic Load Balancing chooses one for you. These private IP addresses provide your load balancer with static IP addresses that will not change during the life of the load balancer.

Can the network load balancer have a static IP address?

You currently have three options for load balancing in AWS: Of those three only one, the Network Load Balancer can have a static IP address. It's listed in the reference below.

How does AWS support static IP addresses for NLBS?

Rohit Aswani, senior specialist solutions architect at AWS, explains how static IP addresses are supported: This new feature allows AWS customers to directly register an ALB as an NLB target, eliminating the need to actively manage changing ALB IP addresses in a daisy chain configuration.


2 Answers

The ip addresses of your load balancer is not static. In any event, your incoming load balancer IP wouldn't be used for outgoing connections.

You could assign elastic IPs to the actual instances behind the load balancer, which would then be used for outgoing requests. You get 5 free elastic ips, and I believe you can apply for more if you need them.

Additionally if using a VPC and if your instances are in a private subnet then they will only be able to access the internet via the NAT instance(s) you setup, and you can of course assign an elastic IP to the NAT instances

like image 190
Frederick Cheung Avatar answered Sep 28 '22 12:09

Frederick Cheung


This is an old question, but things have changed now.

Now you can create a Network ELB to get a LB with a static IP.

from https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html

  • Support for static IP addresses for the load balancer. You can also assign one Elastic IP address per subnet enabled for the load balancer.

https://aws.amazon.com/blogs/aws/new-network-load-balancer-effortless-scaling-to-millions-of-requests-per-second/

like image 40
Anshu Prateek Avatar answered Sep 28 '22 12:09

Anshu Prateek