Using static IP address with Amazon EC2

扶醉桌前 提交于 2019-12-23 06:47:12

问题


I want to use the Amazon Web Service free micro-instance for my different projects for testing and personal purpose. But I required some static-public IP on which I can run my server.

Is that possible? From where I can buy just IP and use it with my AWS?


回答1:


EC2 Elastic IP Addresses

Elastic IPs are tied to an account, not an instance.




回答2:


You need to look at AWS VPC for this.

Whilst VPC is free outside of the usual instance pricing, it doesn't work with Micro instances (the cheapest ones).

When not using VPC, you're assigned IP addresses through DHCP. When the DHCP lease expires, or you restart, your IP is released back to the pool.

VPC lets you use private IP addressing, you can use it with Elastic IPs and is much easier to integrate with a physical infrastructure setup.

If you're only testing/investigating AWS and have little or no budget to use anything other than a Micro instance, I'd just suck it up and deal with the changing of IPs.

If you've got a budget that lets you use instances other than Micro, then go for VPC.

Also, if you're doing more than testing/investigating I'd recommend starting with VPC straight away as trying to migrate from a non VPC to a VPC infrastructure is a massive PITA.




回答3:


For every AWS account, 5 free elastic ips are provided. You have to just allocate them to required instance. But make sure that the allocate address(newly created elastic ip) in in use, because you will billed if the Elastic ip is not in use.




回答4:


Looks like they have configured ARP statically so you can only use the IP address on an instance that was bound to that instance through the EC2 management console.

I just configured one of my instances to use a static IP address other than the one assigned through the management console and rebooted the instance.

I'm still receiving ARP responses on the old address but not receiving ARP responses on the new address at all.

Unfortunately for me, I have a not responding instance (NFS File Server) stuck in a stopping state while I attempt to terminate it. The IP Address bound to that instance cannot be re-assigned to a replacement instance so now I have to reconfigure




回答5:


On the whole pricing delima: When you come to think of it, there is a limited amount of static IPs so there must some pricing (supply and demand). This pricing is two fold: 1) for upto a limited number (5 per account) you don't have to pay. 2) if you created one you need to use it if you don't you'll be billed (to prevent every user to get 5 static IPs)



来源:https://stackoverflow.com/questions/9578553/using-static-ip-address-with-amazon-ec2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!