Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Use SetIpAddressType with a CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use SetIpAddressType with a CLI

The following code examples show how to use SetIpAddressType.

CLI
AWS CLI

To set the address type of a load balancer

This example sets the address type of the specified load balancer to dualstack. The load balancer subnets must have associated IPv6 CIDR blocks.

Command:

aws elbv2 set-ip-address-type --load-balancer-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 --ip-address-type dualstack

Output:

{ "IpAddressType": "dualstack" }
PowerShell
Tools for PowerShell

Example 1: This example changes Load balancer IP address type from 'IPv4' to 'DualStack'.

Set-ELB2IpAddressType -LoadBalancerArn 'arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/test-alb/3651b4394dd9a24f' -IpAddressType dualstack

Output:

Value ----- dualstack
  • For API details, see SetIpAddressType in AWS Tools for PowerShell Cmdlet Reference.

AWS CLI

To set the address type of a load balancer

This example sets the address type of the specified load balancer to dualstack. The load balancer subnets must have associated IPv6 CIDR blocks.

Command:

aws elbv2 set-ip-address-type --load-balancer-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 --ip-address-type dualstack

Output:

{ "IpAddressType": "dualstack" }
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.