This topic describes how to add a TCP listener to a Network Load Balancer (NLB) instance to forward TCP requests. TCP provides reliable and accurate data delivery at relatively low connection speeds. Therefore, TCP is suitable for file transmission, email sending or receiving, and remote logons.
Prerequisites
- A NLB instance is created. For more information, see Create and manage an NLB instance.
- A server group is created. For more information, see Create and manage a server group.
References
- Create a TCP listener: the standard configuration method. You can enable the listener to listen by port range and configure advanced settings based on your business requirements.
- Create a TCP listener (quick configuration): the quick configuration method. You need to only specify a listening protocol, a listening port, and a server group.
Create a TCP listener
- Log on to the NLB console.
- In the top navigation bar, select the region of the NLB instance.
- On the Instances page, find the NLB instance that you want to manage and use one of the following methods to open the listener configuration wizard:
- Click Create Listener in the Actions column.
- Click the ID of the NLB instance and click the Listener tab. On the Listener tab, click Create Listener above the listener list.
- Click the instance ID. On the instance details page, click Create Listener in the wizard.
- Click the instance ID. In the upper-right corner of the instance details page, click Create Listener.
- On the Configure Listener wizard page, set the following parameters and click Next.
Parameter Description Listener Protocol Select a listening protocol. In this example, TCP is selected. Listen by Port Range Specify whether to enable the listener to listen by port range. If Listen by Port Range is enabled, the NLB listens to all ports within the port range and directly forwards requests received on the listener ports to the corresponding ports of the backend server. Note- You can enable Listen by Port Range for only one TCP listener (including SSL over TCP) and one UDP listener for an NLB instance.
- You must enable the all-port forwarding feature for server groups that you want to add to listeners that have Listen by Port Range enabled.
Listener Port Range If Listen by Port Range is enabled, you must specify the start and end ports of the Listener Port Range.
Listener Port Specify a Listener Port on which the NLB instance listens. The NLB instance uses the port to receive requests and forward the requests to the backend servers.
You can select a commonly used port, or enter a port number. Valid values: 1 to 65535.
Note If Listen by Port Range is enabled, you do not need to specify this parameter.Listener Name Specify a name for the listener. Advanced Click to show the advanced settings. Idle Timeout Specify a timeout period for idle TCP connections. If no request is received within the specified timeout period, NLB closes the current connection. When another request is received, NLB establishes a new connection. Limit on New Connections Specify whether to limit the number of new connections. Maximum New Connections per Second If Limit on New Connections is enabled, you must specify the maximum number of new connections per second. Enable Proxy Protocol Specify whether to enable Proxy Protocol. After Proxy Protocol is enabled, client IP addresses are passed to the backend servers. - On the Select Server Group wizard page, set Server Type, select a server group based on the specified Server Type, confirm the backend servers, and then click Next.
- On the Confirm wizard page, confirm the configurations and click Submit.
Create a TCP listener (quick configuration)
If you select this method, you need to only specify a listening protocol, a listening port, and a server group.
- In the left-side navigation pane, choose .
- On the Instances page, find the NLB instance that you want to manage and click its ID.
- Click the Listener tab. On the Listener tab, click Quick Create Listener.
- In the Quick Create Listener dialog box, set the following parameters and click OK.
Parameter Description Listener Protocol Select a listening protocol. In this example, TCP is selected. Listener Port Specify the frontend port that is used to receive and forward requests to backend servers.
You can select a commonly used port, or enter a port number. Valid values: 1 to 65535.
Server Group Set Server Type and select a server group based on Server Type.
References
- CreateListener: creates a TCP or UDP listener, or a listener that uses SSL over TCP for an NLB instance.
- DeleteListener: deletes a listener from an NLB instance.
- ListListeners: queries the list of listeners added to an NLB instance.
- UpdateListenerAttribute: updates the configurations of a listener on an NLB instance.
- StartListener: enables a listener for an NLB instance.
- StopListener: disables a listener for an NLB instance.
- GetListenerAttribute: queries the details of a listener for an NLB instance.
- GetListenerHealthStatus: queries the health check status of a listener for an NLB instance.