amazon web services - Private IP remains same everytime but public IP changes everytime we restart EC2 instance -
why private ip of ec2 instance remains same after stop whereas public ip of instance changes everytime stopped , restarted?
there pool of public ip addresses assigned ec2 instance every time start (or restart) instance.
the ip addresses reused , returned pool once instance stopped (this helps use addresses efficiently).
take amazon docs:
a public ip address assigned instance amazon's pool of public ip addresses, , not associated aws account. when public ip address disassociated instance, released public ip address pool, , cannot reuse it.
it makes sense keep private ip address same because may used communication between instances (which in same subnet).
there might solution enabling keep same public address:
if require persistent public ip address can associated , instances require, use elastic ip address instead. can allocate own elastic ip address, , associate instance. more information, see elastic ip addresses (eip).
take here.
Comments
Post a Comment