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)
Comfort
已提问 2 个月前1044 查看次数
2 回答
1
已接受的回答

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
专家
已回答 2 个月前
profile picture
专家
已审核 2 个月前
profile pictureAWS
专家
已审核 2 个月前
  • 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
专家
已回答 2 个月前
  • 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.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则