You can change the network type of a Network Load Balancer (NLB) instance as needed. If you change the network type of an NLB instance from internal-facing to Internet-facing, you must specify elastic IP addresses (EIPs) or Anycast EIPs for the NLB instance.
Network types
NLB supports the Internet and internal networks. Differences between Internet-facing NLB instances and internal-facing NLB instances:
Internal-facing NLB instances: If you create an internal-facing NLB instance, a private IP address is assigned to each zone. The NLB instance is accessible only over the internal network of Alibaba Cloud.
Internet-facing NLB instances: If you create an Internet-facing NLB instance, a public IP address and a private IP address are assigned to each zone. By default, Internet-facing NLB instances use EIPs to provide Internet-facing services. You are charged instance fees and bandwidth or data transfer fees for the EIPs. If you want to use Anycast EIPs to enable Internet access, associate Anycast EIPs with the NLB instance.
IP versions
NLB supports IPv4 and dual stack. The following table describes the differences between IPv4 and dual stack.
IP version | Default value | Description |
IPv4 |
| Clients can access IPv4 NLB instances only by using IPv4 addresses, such as 192.168.0.1. |
Dual-stack |
| Clients can access dual-stack NLB instances by using IPv4 addresses such as 192.168.0.1, or IPv6 addresses such as 2001:db8:1:1:1:1:1:1. |
How NLB provides Internet-facing services
NLB 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. EIPs can be associated with Elastic Compute Service (ECS) instances, Classic Load Balancer (CLB) instances deployed in virtual private clouds (VPCs), internal-facing Application Load Balancer (ALB) instances, and NLB instances. 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 supports Internet access. For more information, see What is Anycast EIP?
NoteFor more information about the differences between Anycast EIPs and EIPs, see Comparison between Anycast EIPs and EIPs.
IPv6 gateways: IPv6 gateways route IPv6 traffic to and from VPCs. You can allocate Internet bandwidth to an IPv6 address to enable an NLB instance to provide Internet-facing services by using the IPv6 address. For more information, see What is an IPv6 gateway?
Impact on billing
NLB is billed on an hourly basis. If you use an NLB instance for less than 1 hour, the usage duration is rounded up to 1 hour. Network type changes immediately take effect. After you change the network type of an NLB 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 NLB billable items.
The following table describes the impact of network changes on billing.
Operation | Scenario | Change | Impact on billing | References |
Private IPv4 to public IPv4 | The NLB instance needs to use a public IPv4 address to provide services over the Internet. | Associate an EIP or an Anycast EIP with the NLB instance. | You are charged an Internet data transfer fee for the EIP or Anycast EIP associated with the NLB instance. | |
Public IPv4 to private IPv4 | The NLB instance no longer needs to use the public IPv4 address to provide services over the Internet. | Disassociate the EIP or Anycast EIP from the NLB instance. | After you change the network type, view the actual bill for billing details. | None |
Private IPv6 to public IPv6 | The NLB instance needs to use a public IPv6 address to provide services over the Internet. | Enable Internet bandwidth for the IPv6 gateway. | You are charged for the IPv6 gateway and Internet bandwidth resources. | |
Public IPv6 to private IPv6 | The NLB instance no longer needs to use the public IPv6 address to provide services over the Internet. | Disable Internet bandwidth for the IPv6 gateway. | After you change the network type, view the actual bill for billing details. | None |
Prerequisites
An NLB instance is created. For more information, see Create and manage an NLB instance.
Change the network type of an IPv4 NLB instance
Private IPv4 to public IPv4
When you change the network type of an NLB from internal-facing to Internet-facing, you must assign public IP addresses, such as EIPs or Anycast EIPs, to the NLB instance. After the network type is changed to Internet-facing, you are charged for Internet data transfer. For more information, see EIP billing and Anycast EIP billing.
- Log on to the NLB console.
In the top navigation bar, select the region where the NLB instance is deployed.
On the Instances page, click the ID of the internal-facing NLB that you want to manage.
On the Instance Details tab, find Network Type in the Basic Information section, and click Change Network Type on the right side of IPv4.
In the Change Network Type dialog box, select an IP Address Type, assign a public IP address to each zone, and then click OK.
Assign EIPs
Set IP Address Type to EIP.
Select Purchase EIP from the Assign EIP drop-down list or specify an existing EIP.
NoteYou must assign an EIP to each zone in the list.
If you select Purchase EIP, the EIP is released when the NLB instance is released or the network type of the NLB instance is changed to internal-facing. If you specify an existing EIP, the EIP is retained when the NLB instance is released or the network type of the NLB instance is changed to internal-facing.
You can view the details about an EIP in the EIP console.
Assign Anycast EIPs
Set IP Address Type to Anycast EIP.
Select Purchase Anycast EIP from the Assign Anycast EIP drop-down list or specify an existing Anycast EIP.
NoteYou must assign Anycast EIPs to all zones in the list.
If you select Purchase Anycast EIP, the Anycast EIP is released when the NLB instance is released or the network type of the NLB instance is changed to internal-facing. If you specify an existing Anycast EIP, the Anycast EIP is retained when the NLB instance is released or the network type of the NLB instance is changed to internal-facing.
You can view the parameters of an Anycast EIP in the Anycast EIP console.
You can view the Network Type of the NLB instance on the Instance Details tab.
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 NLB instance has switched to an Internet-facing NLB instance.
Public IPv4 to private IPv4
After an NLB instance switches to private IPv4, all public IP addresses are disassociated from the NLB instance. The DNS records of the NLB instance are also updated. Proceed with caution.
- Log on to the NLB console.
In the top navigation bar, select the region where the NLB instance is deployed.
On the Instances page, click the ID of the Internet-facing NLB instance that you want to manage.
On the Instance Details tab, find Basic Information and click Change Network Type next to IPv4 on the right side of Network Type.
In the message that appears, check the impact of the change and click OK.
You can view the Network Type of the NLB instance on the Instance Details tab.
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 NLB instance has switched to an internal-facing NLB instance.
Change the network type of a dual-stack NLB instance
Private dual stack to public dual stack
For more information about how to switch from private IPv4 to public IPv4, see Change the network type of an IPv4 NLB instance.
The following procedure shows how to switch from private IPv6 to public IPv6.
NoteAfter an NLB 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. After Internet bandwidth is enabled, you are charged for Internet data transfer. The IPv6 gateway is enabled or disabled based on the network type of the NLB instance. For more information, see IPv6 gateway billing.
- Log on to the NLB console.
In the top navigation bar, select the region where the NLB instance is deployed.
On the Instances page, click the ID of the internal-facing NLB instance that you want to manage.
On the Instance Details tab, find Network Type in the Basic Information section, and click Change Network Type on the right side of IPv6.
In the Change Network Type message, check the impact of the change and click OK.
NoteIf the NLB instance does not have an IPv6 gateway in the VPC, you are prompted to create one. Create an IPv6 gateway in the console as prompted.
You can view the Network Type of the NLB instance on the Instance Details tab.
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 NLB instance has switched to public IPv6.
Public dual stack to private dual stack
For more information about how to switch from public IPv4 to private IPv4, see Change the network type of an IPv4 NLB instance.
The following procedure shows how to switch from public IPv6 to private IPv6.
- Log on to the NLB console.
In the top navigation bar, select the region where the NLB instance is deployed.
On the Instances page, click the ID of the Internet-facing NLB instance that you want to manage.
On the Instance Details tab, find Network Type in the Basic Information section, and click Change Network Type on the right side of IPv6.
In the Change Network Type message, check the impact of the change and click OK.
You can view the Network Type of the NLB instance on the Instance Details tab.
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 NLB instance has switched to private IPv6.