How to remove IPv4 public IP address from ec2 instances before February 2024? (IPv6)

1

Hello.

I have assigned IPv6 to my VPC, along with other changes and assigned IPv6 addresses to my instances, it works well (i.e. internet connection).

But I want to remove the public IPv4 address of the instances to avoid being charged in February.

How can that be done?

1개 답변
1

In order to deassociate the public IPv4 address, kindly follow these steps below.

  1. Create an ENI and attach it to the instance.
  2. Allocate an Elastic IP address using the below doc[1]
  3. Associate the Elastic IP to the primary ENI that has the public IP of the instance[2].
  4. Refresh the browser page and observe the instance public IP has changed to the new Elastic IP address.
  5. Disassociate the Elastic IP address from the primary ENI by following the below doc[3]
  6. Refresh the browser page again, and observe the instance public IP has been removed.
  7. Release the Elastic IP[4] and detach the ENI attached by the step #1.

References:

[1] Elastic IP addresses - Allocate an Elastic IP address - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#using-instance-addressing-eips-allocating

[2] Elastic IP addresses - Associate an Elastic IP address with an instance or network interface - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#using-instance-addressing-eips-associating

[3] Elastic IP addresses - Disassociate an Elastic IP address - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#using-instance-addressing-eips-associating-different

[4] Elastic IP addresses - Release an Elastic IP address - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#using-instance-addressing-eips-releasing

AWS
sugitks
답변함 4달 전
profile picture
전문가
검토됨 4달 전
  • In my experience, this will work as long as the instance isn't stopped and started. If it is, a public IP address will be assigned again to the primary ENI.

  • This method doesn't work. The public ip will be assigned again automatically after the instance stop and restart. Evene during the public ip removal, ipv6 internet sites access are ok, but ipv4 internet sites can't be accessed whthin the instance. How to fix that?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인