Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I remove the public IP on my instance without terminating it?

I have several instances on a vpc that communicate with each other through their private ips. Each instance was launched sometime ago and assigned a random public IP which is not used for anything. Since anything that is public presents a vulnerability and they are not used at all, I would like to removed them.

Is it possible to Remove public Ip Addresses without terminating the instance?

like image 363
lonewarrior556 Avatar asked Jul 22 '16 19:07

lonewarrior556


People also ask

Can you remove public IP from EC2 instance?

You cannot manually associate or disassociate a public IP (IPv4) address from your instance. Instead, in certain cases, we release the public IP address from your instance, or assign it a new one: We release your instance's public IP address when it is stopped, hibernated, or terminated.

How do I disable public IP?

Disable the public IP addressing featureOn the Configure Instance Details page, for Network, select a VPC. The Auto-assign Public IP list is displayed. Choose Disable to override the default setting for the subnet.

How do I detach an azure public IP?

Sign in to the Azure portal. Browse to, or search for the virtual machine that you want to disassociate the public IP address from and then select it. In Dissociate public IP address, select Yes.

Can an instances without a public IP access the Internet?

Instances without public IP addresses can access the Internet in one of two ways: Instances without public IP addresses can route their traffic through a NAT gateway or a NAT instance to access the Internet.

Can I remove a public IP address from an instance?

Yes you can remove a public IP address from an instance. This solution applies when your instance was launched in a subnet with the "auto-assign public IP" setting enabled. This makes AWS add a public IP address that seems hard to remove.

How to remove a public IP from an EC2 instance?

There MUST be two or more for this to work. Create a new Elastic IP (in the EC2 console). Right-click on the new EIP and associate it to the instance whose public IP you want to remove. The original public IP will be replaced by the new one. Now do the reverse of step 4, disassociate the EIP you have just added.

How do I remove a public IP from an EIP?

Right-click on the new EIP and associate it to the instance whose public IP you want to remove. The original public IP will be replaced by the new one. Now do the reverse of step 4, disassociate the EIP you have just added.

How do I remove a public IP address from Azure VM?

In the VM page, select Overview, select the public IP address as shown in the following picture: In the public IP address page, select Overview, and then select Dissociate, as shown in the following picture: In Dissociate public IP address, select Yes. Install the Azure CLI, or use the Azure Cloud Shell.


1 Answers

Nope that is not possible without terminating the instance. If it was Elastic Ip then it would have worked.

The only option is Take AMI of the instance, terminate the instance and launch the AMI in the VPC without enabling Public Ip address for that instance.

Once you terminate the instance with that private IP you can assign that private ip again to a new Instance you created from the Image. (As long as it's in the same VPC and subnet) This way you don't need to update the private IPs off all the "instances on a vpc that communicate with each other through their private ips"

like image 80
error2007s Avatar answered Oct 17 '22 08:10

error2007s