All Products
Search
Document Center

Server Load Balancer:Change the network type of an ALB instance

Last Updated:Aug 09, 2024

This topic describes how to change the network type of an Application Load Balancer (ALB) instance to meet business requirements.

Network types

ALB provides Internet-facing and internal-facing instances. Differences between Internet-facing and internal-facing ALB instances:

  • Intranet: The ALB instance has only private IP addresses and can be accessed only by resources in the VPC where the ALB instance is deployed.

  • Internet: The ALB instance has public and private IP addresses. By default, Internet-facing ALB instances use EIPs to provide services over the Internet. If you select Internet, you are charged instance fees and data transfer fees for the EIPs.

    If you want your ALB instance to use an Anycast elastic IP address (EIP) to communicate with the Internet, associate an Anycast EIP with the ALB instance. For more information, see Associate Anycast EIPs with an ALB instance to enable access through the nearest access point.

IP versions

ALB supports IPv4 and dual-stack networking. The following table describes the differences between IPv4 and dual-stack.

IP version

Default value

Description

IPv4

  • An IPv4 Internet-facing ALB instance is assigned a public IPv4 address and a private IPv4 address in each zone.

  • An IPv4 internal-facing ALB instance is assigned a private IPv4 address in each zone.

Clients can use only IPv4 addresses, such as 192.0.2.1, to access IPv4 ALB instances.

IPv4 ALB instances forward requests from IPv4 clients only to IPv4 backend servers. You can specify ECS instances, elastic network interfaces (ENIs), elastic container instances, IP addresses, and Function Compute functions as backend servers.

Dual-stack

  • A dual-stack Internet-facing ALB instance is assigned a public IPv4 address, a private IPv4 address, and an IPv6 address in each zone.

  • A dual-stack internal-facing ALB instance is assigned a private IPv4 address and an IPv6 address in each zone.

Clients can use IPv4 addresses, such as 192.168.0.1, and IPv6 addresses, such as 2001:db8:1:1:1:1:1:1, to access dual-stack ALB instances.

Dual-stack ALB instances can forward requests from IPv4 clients and IPv6 clients to backend IPv4 services and IPv6 services.

  • Dual-stack ALB instances can forward requests from IPv6 clients to IPv4 backend services deployed on the following types of backend servers: ECS instances, ENIs, elastic container instances, and IP addresses. Backend servers of the Function Compute type are not supported.

  • Dual-stack ALB instances can forward requests from IPv6 clients to IPv6 backend services deployed on the following types of backend servers: ECS instances, ENIs, and elastic container instances. Backend servers of the IP address or Function Compute type are not supported.

ALB provides services through domain names. ALB is integrated with Alibaba Cloud DNS, which allows you to customize domain name resolution. We recommend that you use CNAME records to map custom domain names to the domain name of your ALB instance and use the ALB instance to manage resource access. For more information, see Add a CNAME record to an ALB instance.

Public IP address types

ALB supports the following types of public IP addresses:

  • EIP: An EIP is a public IP address that you can purchase and use as an independent resource. You can associate an EIP with a Classic Load Balancer (CLB) instance in a virtual private cloud (VPC), an internal-facing ALB instance, or an Internet NAT gateway. For more information, see What is EIP?

  • Anycast EIP: An Anycast EIP is a public IP address that you can purchase and use as an independent resource. Each Anycast EIP is assigned an IP address that has Internet access. For more information, see What is Anycast EIP?

Note

For more information about the differences between Anycast EIPs and EIPs, see Comparison between Anycast EIPs and EIPs.

Limits

Limits on associating an Anycast EIP with an ALB instance:

The following table describes the regions where you can associate Anycast EIPs with ALB instances.

Area

Region

China

China (Hong Kong)

Asia Pacific

South Korea (Seoul), Japan (Tokyo), Singapore, Malaysia (Kuala Lumpur), Indonesia (Jakarta), Philippines (Manila), and Thailand (Bangkok)

Europe and Americas

UK (London), US (Virginia), US (Silicon Valley), and Germany (Frankfurt)

Limits on associating an EIP with an ALB instance:

  • The EIPs that are specified for different zones of the same ALB instance must be of the same type. For more information about the types of EIPs that are supported by ALB, see What types of EIPs can be associated with ALB instances?

  • The EIP that you want to associate with an ALB instance cannot be associated with an Internet Shared Bandwidth instance. After you associate an EIP with an ALB instance, you can associate an Internet Shared Bandwidth instance with the ALB instance in the ALB console. The line type of the EIP must be the same as the line type of the Internet Shared Bandwidth instance. For more information about how to associate an Internet Shared Bandwidth instance with an ALB instance, see Modify the maximum bandwidth.

Impacts on billing

  • ALB is billed on an hourly basis. If you use an ALB instance for less than 1 hour, the usage duration is rounded up to 1 hour. A change to the network type of an ALB instance immediately takes effect. After you change the network type of an ALB instance, you are charged based on the previous network type within the current usage duration, which is rounded up to 1 hour. For more information, see ALB billing rules.

  • The following table describes the impacts of network changes on billing.

    Change

    Scenario

    Operation

    Impact on billing

    References

    Private IPv4 address to public IPv4 address

    The ALB instance needs to provide Internet-facing IPv4 services.

    Associate an EIP or an Anycast EIP with the ALB instance.

    After you associate an EIP or an Anycast EIP with the ALB instance, you are charged Internet data transfer fees.

    Public IPv4 address to private IPv4 address

    The ALB instance no longer needs to provide Internet-facing IPv4 services

    Disassociate EIPs or Anycast EIPs from the ALB instance.

    After you change the network type, view the actual bill for billing details.

    None

    Private IPv6 address to public IPv6 address

    The ALB instance needs to provide Internet-facing IPv6 services

    Enable Internet bandwidth for the IPv6 gateway.

    You are charged for the Internet bandwidth.

    IPv6 gateway billing rules

    Public IPv6 address to private IPv6 address

    The ALB instance no longer needs to provide Internet-facing IPv6 services.

    Disable Internet bandwidth for the IPv6 gateway.

    After you change the network type, view the actual bill for billing details.

    None

Prerequisites

An ALB instance is created. For more information, see Create an ALB instance.

Change the network type of an IPv4 ALB instance

Private IPv4 address to public IPv4 address

After you change the network type of an ALB instance from private IPv4 to public IPv4, you must assign EIPs or Anycast EIPs to the ALB instance. You are charged Internet data transfer fees for the EIPs or Anycast EIPs. For more information, see EIP billing and Anycast EIP billing.

  1. Log on to the ALB console.
  2. In the top navigation bar, select the region in which the ALB instance is deployed.

  3. On the Instances page, click the ID of the internal-facing ALB instance that you want to manage.

  4. On the Instance Details tab, find Network Type in the Basic Information section, and click Change Network Type on the right side of the private IPv4 address.

  5. In the Change Network Type dialog box, select an IP address type, assign public IP addresses, and then click OK.

    • Assign EIPs

      1. Set IP Address Type to EIP.

      2. Select Purchase EIP from the Assign EIP drop-down list.

      Note
      • You must assign an EIP to each zone in the list.

      • If your service requires ALB to use an EIP that has a specific IP address, replace the EIP. To replace an EIP, you can add zones to associate the ALB instance with the EIP or remove zones to disassociate the ALB instance from the EIP. For more information, see Modify the configurations of ALB instances.

      • When you select Purchase EIP, take note of the following rules:

        • A change to the network type of an ALB affects services. The EIP that is assigned when you create the ALB instance is automatically released or disassociated from the ALB instance. Released EIPs cannot be restored.

        • You can view the details about an EIP in the EIP console.

        • The EIP uses the pay-as-you-go billing method and the pay-by-data-transfer metering method. The EIP uses BGP (Multi-ISP) lines and is protected by Anti-DDoS Origin Basic.

    • Assign Anycast EIPs

      For more information about the limits on and procedure for associating Anycast EIPs, see Associate Anycast EIPs with an ALB instance to enable access through the nearest access point.

      1. Set IP Address Type to Anycast EIP.

      2. Select Purchase Anycast EIP from the Assign EIP drop-down list, or select an existing Anycast EIP.

        Note
        • You must assign Anycast EIPs to all zones in the list.

        • If you select Purchase Anycast EIP, take note of the following items:

          • When you change an ALB instance from Internet-facing to internal-facing or release the ALB instance, the associated Anycast EIPs are automatically disassociated and released.

          • You can view the parameters of an Anycast EIP in the Anycast EIP console.

  6. Return to the Instance Details tab to check the value of the Network Type parameter.

    It takes about 1 minute to apply the change. If the Network Type parameter on the Instance Details tab displays Public next to IPv4, the ALB instance has switched to an Internet-facing ALB instance.

Public IPv4 address to private IPv4 address

After an ALB instance switches to an internal-facing ALB instance, all public IP addresses are disassociated from the ALB instance. The DNS records of the ALB instance are also updated. Proceed with caution.

  1. Log on to the ALB console.
  2. In the top navigation bar, select the region where you want to create the ALB instance.

  3. On the Instances page, click the ID the Internet-facing ALB instance that you want to manage.

  4. On the Instance Details tab, find Network Type in the Basic Information section, and click Change Network Type on the right side of the public IPv4 address.

  5. In the message that appears, check the impacts of the change and click OK.

  6. Return to the Instance Details tab to check the value of the Network Type parameter.

    It takes about 1 minute to apply the change. If the Network Type parameter on the Instance Details tab displays Private next to IPv4, the ALB instance has switched to an internal-facing ALB instance.

Change the network type of a dual-stack ALB instance

Private IPv4 address to public IPv4 address

  • For more information about how to switch from private IPv4 to public IPv4, see Change the network type of an IPv4 ALB instance.

  • The following procedure shows how to switch to a public IPv6 address.

    Note

    After the network of an ALB instance switches from private IPv6 to public IPv6, Internet bandwidth is enabled for the IPv6 gateway. You can view the details in the VPC console. Internet bandwidth is billed and is automatically enabled or disabled based on the network type of the ALB instance. For more information, see IPv6 gateway billing.

  1. Log on to the ALB console.
  2. In the top navigation bar, select the region in which the ALB instance is deployed.

  3. On the Instances page, click the ID of the internal-facing ALB instance that you want to manage.

  4. On the Instance Details tab, find Network Type in the Basic Information section, and click Change Network Type on the right side of the IPv6 address.

  5. In the Change Network Type message, check the impacts of the change and click OK.

    Note

    If the VPC where the ALB instance is deployed does not have an IPv6 gateway, you are prompted to create an IPv6 gateway. Create an IPv6 gateway in the console as prompted.

  6. Return to the Instance Details tab to check the value of the Network Type parameter.

    It takes about 1 minute to apply the change. If the Network Type parameter on the Instance Details tab displays Public next to IPv6, the network of the ALB instance has switched to public IPv6.

Public IPv4 address to private IPv4 address

  1. Log on to the ALB console.
  2. In the top navigation bar, select the region where you want to create the ALB instance.

  3. On the Instances page, click the ID the Internet-facing ALB instance that you want to manage.

  4. On the Instance Details tab, find Network Type in the Basic Information section, and click Change Network Type on the right side of the IPv6 address.

  5. In the Change Network Type message, check the impacts of the change and click OK.

  6. Return to the Instance Details tab to check the value of the Network Type parameter.

    It takes about 1 minute to apply the change. If the Network Type parameter on the Instance Details tab displays Private next to IPv6, the network of the ALB instance has switched to private IPv6.

References