Configure dual-stack network type for an Amazon MSK cluster
Amazon MSK supports dual-stack network type for existing MSK Provisioned clusters that use Kafka version 3.6.0 or later at no additional cost. With dual-stack networking, your clusters can use both IPv4 and IPv6 addresses. Dual-stack endpoints also support IPv4 thus maintaining backward compatibility. Amazon MSK provides IPv6 support through dual-stack network type, not as IPv6-only.
By default, clients connect to Amazon MSK clusters using the IPv4 network type. All new clusters that you create also use IPv4 by default. To update a cluster's network type to dual-stack, make sure you’ve fulfilled the prerequisites described in the following section. Then, use the UpdateConnectivity API to update connectivity to dual-stack.
When you enable dual-stack networking on your cluster, you'll receive two types of bootstrap strings - one for IPv4 and one for IPv6 connectivity. While the cluster itself supports both IPv4 and IPv6 simultaneously (dual-stack), each bootstrap string is protocol-specific - you'll need to use IPv4 bootstrap strings for IPv4 connections and IPv6 bootstrap strings for IPv6 connections. There is no single bootstrap string that supports both protocols. Your existing IPv4 bootstrap strings will continue to work as before, while the new IPv6 bootstrap strings will be identified by the 'bi6-' prefix. Note that IPv6 connectivity is only available for broker nodes - ZooKeeper nodes can only be accessed using IPv4 bootstrap strings. Make sure to configure the appropriate ports for the protocol you plan to use, as IPv4 and IPv6 connections use different ports. For more information on required ports, see Port Information.
All existing MSK Provisioned clusters that support dual-stack network type will use the same IPv6 bootstrap strings for both default and public access connectivity. If you have public access enabled on your cluster, the IPv6 bootstrap strings will automatically have public access capability. Note that if public access is not enabled on your cluster, these IPv6 bootstrap strings will not have public access capability. Your existing IPv4 bootstrap strings will continue to work as before for IPv4 connectivity.
Note
Once you update your cluster to use the dual-stack network type, you can’t switch it back to the IPv4 network type.
Topics
Prerequisites for using dual-stack network type
Before you configure dual-stack network type for your clusters, make sure you have the following:
-
Kafka version 3.6.0 or later for existing MSK Provisioned clusters.
-
All subnets you provide during cluster creation must have both IPv4 and IPv6 CIDR blocks assigned and support dual-stack network type. If even one subnet in your cluster doesn’t have IPv6 CIDR blocks assigned, you won’t be able to use the dual-stack network type for your cluster.
-
Dual-stack connectivity is not supported on kafka.t3.small instance types. If you have a this instance type and want to use dual-stack connectivity, you need to upgrade to another supported instance type first.
-
Required ports must be open for IPv6 connectivity. For information about the required ports, see Port information.
-
Dual-stack connectivity is not supported for ZooKeeper nodes. You can only connect to ZooKeeper nodes using IPv4.
IAM permissions to configure dual-stack network type
You must have the following IAM permissions:
-
ec2:CreateTags -
ec2:DescribeSubnets -
kafka:UpdateConnectivity
For a complete list of permissions required to perform all Amazon MSK actions, see AWS managed policy: AmazonMSKFullAccess.
Configure dual-stack network type for an existing cluster
You can update the network type for an existing MSK Provisioned cluster using the AWS Management Console, AWS CLI, or AWS SDK.
Considerations for using dual-stack network type
-
IPv6 support is currently available only in dual-stack mode (IPv4 + IPv6), not as IPv6-only.
-
To use dual-stack network type for your Amazon MSK Provisioned clusters, Kafka version 3.6.0 or later is required.
-
Dual-stack network type is unavailable for multi-VPC private connectivity.
-
IPv6 connectivity for Zookeeper nodes is unavailable. You can only connect to ZooKeeper nodes using IPv4.
-
You can change the network type from IPv4 to dual-stack for an existing cluster only if all its subnets support the dual-stack network type.
-
You can't revert to the IPv4 network type after enabling dual-stack. To switch back, you must delete and recreate the cluster.
-
You must have the following IAM permissions:
-
ec2:CreateTags,ec2:DescribeSubnetsandkafka:UpdateConnectivity
-