You can change the network type of a Network Load Balancer (NLB) instance as needed. If you change an NLB instance from internal-facing to Internet-facing, you must specify an elastic IP address (EIP) or Anycast EIP.
Network type
- Internal-facing: 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.
- Internet-facing: 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 services over the Internet. If you create Internet-facing NLB instances, you are charged instance fees and bandwidth fees or data transfer fees for the EIPs. To provide Internet-facing services by using Anycast EIPs, you must associate Anycast EIPs with NLB instances.
IP version
IP version | Default value | Description |
---|---|---|
IPv4 |
| Clients must use IPv4 addresses to access the NLB instance. |
Dual-stack |
| Clients can use both IPv4 and IPv6 addresses to access the NLB instance. |
How NLB provides Internet-facing services
- EIP: An EIP is a public IP address that you can purchase and use as an independent resource. EIPs can be associated with ECS instances, Classic Load Balancer (CLB) instances deployed in VPCs, and 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 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.
- IPv6 gateways: IPv6 gateways route IPv6 traffic to and from VPCs. You can enable public bandwidth for an IPv6 address so that an NLB instance can provide Internet-facing services by using the IPv6 address. What is an IPv6 gateway?.
Limits
Only NLB instances in the China (Hong Kong) region can be associated with Anycast EIPs.
Impacts 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 hour. The usage duration is rounded up to 1 hour. For more information, see NLB billable items.
The following table describes the impacts of network changes on billing.Procedure | Scenario | Method | 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. | If you associate an EIP or Anycast EIP with an NLB instance, you are charged an Internet data transfer fee for the EIP or Anycast EIP. | |
Public IPv4 to private IPv4 | The NLB instance no longer needs to use a public IPv4 address to provide services over the Internet. | Disassociate an EIP or Anycast EIP from the NLB instance. | After you change the network type, view the actual bill for billing details. | N/A |
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. | IPv6 gateway billing rules |
Public IPv6 to private IPv6 | The NLB instance no longer needs to use a 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. | N/A |
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
After you change the network type of an NLB instance from private IPv4 to public IPv4, you must assign an EIP or an Anycast EIP to the NLB instance. EIPs and Anycast EIPs incur Internet data transfer fees. 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, find the NLB instance that you want to manage and click its ID.
- On the Instance Details tab, find the Basic Information section, and click Change Network Type on the right side of Network Type.
- In the Change Network Type dialog box, set IP Address Type, select a public IP address for the NLB instance, and then click OK.
- Assign an EIP
- Set IP Address Type to EIP.
- Select Purchase EIP from the Assign EIP drop-down list or specify an existing EIP.
Note- You must assign an EIP to each zone in the list.
- When you select Purchase EIP, take note of the following rules:
- When you switch an NLB instance from Internet-facing to internal-facing or the NLB instance is released, the EIP associated with the NLB instance will be automatically disassociated and released.
- You can view the details about an EIP in the EIP console.
- Assign an Anycast EIP
- Set IP Address Type to Anycast EIP.
- 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.
- When you select Purchase Anycast EIP, take note of the following items:
- When you switch an NLB instance from Internet-facing to internal facing, or you release the NLB instance, the associated Anycast EIP is automatically disassociated and released.
- You can view the parameters of an Anycast EIP in the Anycast EIP console.
- Assign an EIP
- 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 value of the Network Type parameter on the Instance Details tab changes to Public, it indicates that the NLB instance has switched to public IPv4.
Public IPv4 to private IPv4
After an NLB instance switches from public IPv4 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, find the NLB instance that you want to manage and click its ID.
- On the Instance Details tab, find the Basic Information section, and click Change Network Type on the right side of Network Type.
- In the Change Network Type dialog box, modify and confirm the settings, and click OK.
- 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 value of the Network Type parameter on the Instance Details tab changes to Private, it indicates that the NLB instance has switched to private IPv4.
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. Note After 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. Internet bandwidth incurs fees and is automatically 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, find the NLB instance that you want to manage and click its ID.
- On the Instance Details tab, find the Basic Information section, and click Change Network Type on the right side of Network Type.
- In the Change Network Type dialog box, modify and confirm the settings, and click OK. Note If the VPC where the NLB instance is deployed does not have an IPv6 gateway, you are prompted to create one. Create an IPv6 gateway in the console as prompted.
- 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 value of the Network Type parameter on the Instance Details tab changes to Public, it indicates that 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, find the NLB instance that you want to manage and click its ID.
- On the Instance Details tab, find the Basic Information section, and click Change Network Type on the right side of Network Type.
- In the Change Network Type dialog box, modify and confirm the settings, and click Disable.
- 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 value of the Network Type parameter on the Instance Details tab changes to Private, it indicates that the NLB instance has switched to private IPv6.