0

I heard (perhaps wrongly) that using an Amazon Elastic IP "EIP" on a network interface and attaching that to an EC2 instance might be a quicker way of bringing up (or switching to) a new machine.

However I am little confused how to handle the networking once the new eth1 is attached. Do people have a eth1 systemd networkd rule with a low RouteMetric or do they remove eth0, or they just alter the route or am I missing a trick?

Ultimately since ELB can't have a static IP address, I am looking for ways of making sure EC2 can be quickly provisioned to avoid down time.

hendry
  • 677
  • 2
  • 10
  • 23
  • What do you mean "quicker way of bringing up (or switching to) a new machine" ? EIP is just an Public IP randomly allocate by Amazon. You still need to modify DNS tables if it associate with your FQDN. How ELB handle loading using IP address is yet another issues. – mootmoot Jul 08 '16 at 12:20
  • Check this out if you intend to create ELB for your EC2 instance into private subnet. Your EC2 instance may REMAINS in private subnet and don't need EIP at all. While ELB may use EIP or auto-assign IP depends on your requriement http://stackoverflow.com/questions/22541895/amazon-elb-for-ec2-instances-in-private-subnet-in-vpc – mootmoot Jul 08 '16 at 12:32
  • It needs to be a static IP address since customers addressing it require an IP ... sadly. – hendry Jul 08 '16 at 13:04
  • You may attach EIP to your EC2 eth0, with the private IP persist. There is no need to allocate eth1 just for the public IP. – mootmoot Jul 08 '16 at 13:11

1 Answers1

0

You can just assign the Elastic IP to the existing interface. Unless you have a compelling reason to keep the original public IP address associated with the instance, there's probably no reason to use a second interface. No change on the instance itself is needed when assigning an Elastic IP to the instance on an existing interface, as traffic for public IPs in AWS is all handled by NAT to the private IP address.

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html

If you manage your zone with Route53, though, you can use their "Alias" record type for an ELB. It's not the same as a static IP, but it suffices in many use cases.

http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-choosing-alias-non-alias.html

Karen B
  • 534
  • 3
  • 7