Use case 15: Configure layer 4 load balancing on the NetScaler appliance
To configure layer 4 load balancing using the command line interface
add service <name> <serverName> <serviceType> <port>
add lb vserver <name> <serviceType> <ip> <port>
bind lb vserver <name> <serviceName>
add service TCPservice 192.0.2.3 TCP 1
add lb vserver TCPserver TCP 192.0.2.4 1
bind lb vserver TCPserver TCPservice
To configure layer 4 load balancing using the GUI
-
Navigate to Traffic Management > Load Balancing > Services.
-
Click Add to a create a service.
-
Specify the required details in Service Name and IP Address.
-
Select either TCP or UDP in Protocol.
-
Click OK.
-
Click Done.A service is created.When you create a service using UDP as the transport layer protocol, a ping monitor (built-in monitor) is automatically bound to the service. When you create a service using TCP as the transport layer protocol, a tcp_default monitor is automatically bound to the service.For the load balancing setup, you can bind your service to a different type of monitor or multiple monitors. For advance monitoring requirements you can use the tcp-ecv monitor and configure the request and response messages.
-
Navigate to Traffic Management > Load Balancing > Virtual Servers.
-
Click Add to create a new virtual server.When the load balancing is configured, you can connect to the load-balanced website, application, or server through the virtual server's IP address or FQDN.
-
Specify the required details in Name, IP Address Type, and IP Address.
-
Select either TCP or UDP in Protocol.
-
Type a port number (0–1023 based on the type of service) in Port.
-
Click OK.
-
Click No Load Balancing Virtual Server Service Binding in Services and Service Groups.
-
In the Service Binding page, select Click to Select in Select Service.
-
Select the service to be bound and click Select.
-
Click Bind to bind the service to the virtual server.
-
Click Continue.
-
Click Done.The layer 4 load balancing virtual server configuration is completed.