By using AWS re:Post, you agree to the AWS re:Post Terms of Use

How to remove IPv4 public IP address from load balancer?

0

Hi

I need to move my existing AWS services (ec2, load balancer, nat_gateway) from using public IPv4 IP addresses to using private IPv4 or IPv6 IP addresses.

I know how to do it for ec2 instances (create an AMI, launch a new instance using the created AMI, disable auto-assign public IP option)

I want to do the same thing for my load balancers and nat_gateways.

Side note: On the load balancer, there is an option to Edit IP address type (to Dualstack), however, this requires a subnet that supports IPv6, and a VPC that supports IPv6.

  1. Suppose I wanted to move to IPv6, would this be the way forward? New VPC, new subnets.
  2. How would I remove the public IPv4 IPs from the load balancers and nat_gateways and just use private IPv4 addresses?
  3. Is it possible to have an external load balancer without a public IP address attached/assigned to it (I would use the DNS name to connect to it instead)
asked 9 months ago1.5K views
2 Answers
1
Accepted Answer

To remove public IPv4 addresses from load balancers and NAT gateways, you can follow these steps:

Create a new VPC with IPv6 enabled and new subnets that support IPv6.

Launch new EC2 instances in the new VPC/subnets. You can omit the public IPv4 assignment during launch.

Create new load balancers and NAT gateways in the new VPC. Load balancers and NAT gateways launched in an IPv6 enabled VPC will not be assigned public IPv4 addresses.

Update DNS records and security groups to point to the new resources.

Terminate the old resources like instances, load balancers, NAT gateways that were using public IPv4 addresses.

To edit the IP address type of an existing load balancer to dualstack, the VPC and subnets must support IPv6. This allows the load balancer to be accessible over both IPv4 and IPv6.

profile picture
EXPERT
answered 9 months ago
profile picture
EXPERT
reviewed 4 months ago
profile picture
EXPERT
reviewed 9 months ago
profile pictureAWS
EXPERT
reviewed 9 months ago
  • Hi Giovanni

    Thank you for this response.

    Agreed, when following the steps on the console, those are the options I see.

    To confirm, it's not possible to remove a public IP from a load balancer and nat_gateway and just have a private IP assigned to it? I'm asking this in case moving to IPv6 is not an option for me right now.

0

You can only update the load balancer to IPv4 only or Dualstack. You can't change an internet-facing Load Balancer to an internal Load Balancer. It's the same for NAT Gateway. You would have to recreate them.

profile pictureAWS
EXPERT
answered 9 months ago
  • Hi I'm not sure I understand your response. I am not trying to change an internet-facing load balancer to internal.

    I am am trying to remove the public IP from my internet-facing load balancers, and my internal load balancers.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions