Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including
Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
The best answers are voted up and rise to the top
7 years, 10 months ago
When I launch instance in AWS console I can set "Auto-assign Public IP" to true and newly created instance will be assigned with public IP address from pool.
Now assume I have launched instance with this setting set to false and want to assign public IP to this instance. The same public IP as in first case, not Elastic IP.
PS I know I can launch new instance and shut down old one. I'm particularly interested in assigning to one already running.
Jul 17, 2015 at 14:26
Yaroslav Admin Yaroslav Admin
1,078 1 1 gold badge 10 10 silver badges 15 15 bronze badges
The instance that you launched without a public IP will stay without one as it is only assignable when you launch the instance. Even having a subnet with
auto assign public IP switched on will not assign a public IP to your instance if, when you launched the instance you chose not to have a public IP.
The only way I know is to select
assign a public IP
before launching the instance or having the subnet set up to auto assign public IPs which will do that only when you launch a new instance.
So to summarize:
It is not possible to
assign a public IP after launching that instance unless you use EIPs.
96.1k 29 29 gold badges 174 174 silver badges 230 230 bronze badges
Jan 5, 2016 at 10:28
896 7 7 silver badges 3 3 bronze badges
To correct it afterwards, spin down your original server, spin up a new with auto assign public IP enabled and the existing volumes attached.
You can then discard the original instance.
Jun 6, 2016 at 11:46
If you are using ELB and Autoscaling, creating instance on fly and to stress test the instance is difficult. One solution during this scenario:
Select EC2 instance> Actions>Networking> Manage Ip Addresses.
Then use option "To add or edit an IPv4 public IP Allocate an Elastic IP to this instance or network interface".
Create an elastic IP
Navigate to Elastic IP address link> click Associate IP
Select the instance to associate IP and save.
Now you will have EC2 instance with public IP without restarting/deleting EC2 instance.
Mar 26, 2018 at 15:20
Nischal S Nischal S
145 1 1 silver badge 2 2 bronze badges
Assuming your instance is running in a VPC you can create an
Elastic Network Interfaces (ENI) that has a public IP assigned to it then associate that ENI with your instance without needs to create a new one.
Jul 17, 2015 at 20:38
To assign a public IP to instance at run time:
Click on instance and select Networking-->Manage IP Addresses from action dropdown
Select Allocate elastic from "To add or edit an IPv4 public IP Allocate an Elastic IP to this instance or network interface." line then it will create a public IP for you
A window will appear asking to assign IP created in step 3 to instance and to private IP. Provide the required value.
Now try to ssh via putty. It worked for me. Hope it will help. Best of luck.
13.8k 5 5 gold badges 40 40 silver badges 55 55 bronze badges
Nov 2, 2017 at 18:56
Jan 20, 2022 at 1:04
117 5 5 bronze badges
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our
Accept all cookies
Necessary cookies only