Create and manage NLB instances
Network Load Balancer (NLB) is a Layer 4 load balancer designed for Internet of Everything (IoE) scenarios. After you create an NLB instance, you can distribute client requests to backend servers.
Prerequisites
You have created a Virtual Private Cloud (VPC).
Each vSwitch specified during NLB instance creation must have sufficient available IP addresses. The system consumes three IP addresses per vSwitch: two local IPs for backend communication and health checks, and one VIP that serves clients. The VIP remains static after creation. If a vSwitch has insufficient IP addresses, instance creation fails.
To support NLB elasticity, we recommend reserving at least eight IP addresses in each vSwitch used by the NLB instance.
Your account must have the
AliyunServiceRoleForNlbservice-linked role. The console prompts you to create this role the first time you create an NLB instance. It grants NLB access to ENIs, EIPs, and Internet Shared Bandwidth.
Create an instance
Log on to the NLB console.
-
In the top navigation bar, select the region in which the NLB instance is deployed.
On the Instances page, click Create NLB.
On the Network Load Balancer (Pay-As-You-Go) page, configure the following parameters.
Parameter
Description
Region
Select the region where you want to create the instance.
Network Type
Select the network type. The system assigns a private or public service address accordingly.
Private: A private IP address is provisioned in each zone. The instance is accessible only from within the Alibaba Cloud internal network.
Public: A public IP address and a private IP address are provisioned in each zone. A public NLB instance uses an EIP for public access. You are charged for the EIP and for bandwidth or data transfer.
The EIP allows the NLB instance to be accessed from the internet.
The private IP address allows access to the NLB instance from ECS instances within the VPC.
After you create an NLB instance, you can change the network type of an NLB instance at any time.
For a dual-stack instance, IPv4 is used for public services by default. To use IPv6 for public services, change the network type. This incurs IPv6 gateway fees. IPv6 gateway billing.
VPC
Select the VPC where you want to deploy the instance.
Zone
Select availability zones and vSwitches.
NLB supports multi-zone deployment. If the region supports two or more zones, select at least two for high availability. NLB does not charge extra for multiple zones.
Select a vSwitch for each zone. If none is available, create one as prompted.
Optional: If you set Network Type to Public, you must select an EIP for each selected availability zone.
If no EIP is available, keep the default Purchase EIP. The system creates a pay-as-you-go (pay-by-data-transfer) BGP (Multi-ISP) EIP with default protection and associates it with the NLB instance.
Select an existing EIP to associate with the NLB instance.
ImportantOnly pay-as-you-go (pay-by-data-transfer) EIPs that are not associated with an Internet Shared Bandwidth instance can be used.
The EIPs that you allocate to different availability zones of the same NLB instance must be of the same type.
When you release an Internet-facing NLB instance, you can retain auto-assigned EIPs, except Anycast EIPs. Retained EIPs are billed on a pay-as-you-go basis. NLB automatically retains manually associated EIPs.
IP Version
Select an IP version for the instance.
IPv4: The NLB instance can be accessed only by clients that use IPv4 addresses.
Dual-stack: The NLB instance can be accessed by clients that use both IPv4 and IPv6 addresses.
Associate with EIP Bandwidth Plan
Select whether to add the EIPs to an Internet Shared Bandwidth instance. If you select Associate with EIP Bandwidth Plan, select an existing instance or click Purchase Internet Shared Bandwidth to create one. Then, return to the NLB creation page and click the
icon to refresh the list.We recommend a pay-as-you-go Internet Shared Bandwidth instance.
This parameter is available only when you set Network Type to Public.
Internet Metering Method
The default billing method is Pay-By-Data-Transfer. The bandwidth peak is an upper limit, not a guarantee. During resource contention, actual bandwidth may be lower. EIP billing.
This parameter is available only when Network Type is set to Public and Associate with EIP Bandwidth Plan is not selected.
Service-linked role
The first time you create an NLB instance, click Create Service-Linked Role to create the required role.
Instance Name
Enter a name for the instance.
Resource Group
Select a resource group for the instance.
Click Create Now and complete the purchase as prompted.
Return to the Instances page and select the correct region to view your new instance.
Release an instance
After an instance is released, you no longer need to pay its Instance fee.
When you release an Internet-facing NLB instance, you can retain auto-assigned EIPs, except Anycast EIPs. Retained EIPs are billed on a pay-as-you-go basis. Manually associated EIPs are retained automatically.
If you mapped a custom domain name to the DNS name or IP address of the NLB instance, remap it to another load balancer before releasing the NLB instance to prevent service interruptions.
Releasing an NLB instance permanently deletes its configurations and data, which cannot be recovered.
If the NLB instance is managed by another cloud service such as ACK, releasing the NLB instance causes that service to stop working. This operation cannot be reversed.
You cannot release an instance if deletion protection is enabled for it.
Log on to the NLB console.
-
In the top navigation bar, select the region in which the NLB instance is deployed.
On the Instances page, find the target instance. In the Actions column, click the
icon and select Release.In the Release Instance dialog box, click OK.
More operations
Actions | Procedure |
Modify an instance name | On the Instances page, find the target instance, move the pointer over the instance name, click the |
Manage tags |
Add or edit tags
Filter by tag Above the instance list on the Instances page, click Filter Tags. Select a Tag Key and a Tag Value. To remove the filter, click Clear Search Condition above the instance list. |
Enable or disable cross-zone load balancing | When cross-zone load balancing is enabled, the NLB instance distributes traffic to backend servers across all enabled zones in the region. On the Instances page, click the ID of the target instance. In the Instance Property section, turn on or turn off Cross-Zone Distribution. |
Configure deletion protection | Deletion protection prevents accidental release of an instance.
|
Configure modification protection | Important If your NLB instance is managed by Container Service for Kubernetes (ACK), changing the NLB instance configuration after you disable modification protection affects the ACK cluster's normal operation. Modification protection prevents accidental changes to instance settings.
|
What to do next
After you create an instance, add a listener to distribute connection requests to backend servers based on your scheduling algorithm.
References
Overview:
For an overview of NLB use cases and components, see What is Network Load Balancer?.
To learn about NLB features, see Features.
User guides:
API reference:
CreateLoadBalancer: creates an NLB instance.
DeleteLoadBalancer: deletes an NLB instance.
UpdateLoadBalancerAttribute: modifies the name and status of an NLB instance.
UpdateLoadBalancerAddressTypeConfig: changes the network type of the IPv4 address of an NLB instance.
UpdateLoadBalancerZones: modifies the availability zone attributes of an NLB instance.
EnableLoadBalancerIpv6Internet: changes the network type of an IPv6 NLB instance from private to public.
DisableLoadBalancerIpv6Internet: changes the network type of an IPv6 NLB instance from public to private.