Does Amazon EC2 Elastic Load Balancer's IP ever Change?
Asked Answered
T

4

46

Does the ELB's IP Ever Change once setup, or will it always access instances from the same location during its lifetime no matter what might be going on with it behind the scenes at Amazon?

Theorem answered 29/9, 2010 at 11:54 Comment(0)
S
46

ELB's IP address keeps changing. You should instead use the DNS name provided to you.

http://developer.amazonwebservices.com/connect/thread.jspa?threadID=32280

Stribling answered 30/9, 2010 at 11:59 Comment(3)
And what would you recommend if these addresses need to be maintained in a Firewall?Blackheart
@JamesBoutcher maybe you should use a VPNExperienced
The DNS name only resolves to the external IPs (of a public load balancer) and not the internal IPs, even if you're in the same VPC and subnetBregenz
D
17

The short answer: Yes, ELB's IP addresses (both the ones that are publicly distributed to clients of your service, and the internal IPs from which ELB sends traffic to your instances) dynamically change.

The long answer: See my article about how ELB works for more info: http://shlomoswidler.com/2009/07/elastic-in-elastic-load-balancing-elb/

Dished answered 30/9, 2010 at 19:2 Comment(2)
Nice Article Shlomo but I'm making the forum thread my preferred answer on this one as it deals with many people's experiences directly.Theorem
Link is dead Shiomo, plz edit if it's still available anywhereBaguio
U
12

I understand this question has been already answered but I found the article "Best Practices in Evaluating Elastic Load Balancing" on the AWS site that explains why the ELB's IP addresses keep changing.

By default, Elastic Load Balancing will return multiple IP addresses when clients perform a DNS resolution, with the records being randomly ordered on each DNS resolution request.

...and the importance to ask to the DNS the actual IPs to use

If clients do not re-resolve the DNS at least once per minute, then the new resources Elastic Load Balancing adds to DNS will not be used by clients.

http://aws.amazon.com/articles/1636185810492479

Upali answered 1/8, 2013 at 6:18 Comment(0)
L
3

Note: originally ELB (Elastic Load Balancer) referred to an L7 balancer what is now called ALB (Application Load Balancer), which indeed has changing IPs.

But there's an other kind of ELB, the L4 NLB (Network Load Balancer), which by default uses static IP addresses (and you can stick Elastic IP as well, if you want flexibility of moving the ElasticIP around).

So it is important to distinguish which ELB we are talking about - ALB or NLB.

Lenitalenitive answered 6/9, 2021 at 16:38 Comment(1)
At the time the question was originally asked there was only the "elastic load balancer" which is now the Layer 7 (L7) ALB you refer to. So the questions and answers pertain to that.Theorem

© 2022 - 2024 — McMap. All rights reserved.