NLB: Windows Installation and Configuration 2012R2 / 2016 – Network Load Balancing


Windows Server 2019

Presentation of NLB

Network Load Balancing (NLB) is a feature built into Windows that allows the implementation of load balancing at the network level. It is often used with IIS / FTP / RDS.

NLB works with a virtual IP address that is available to all hosts in the cluster.

NLB supports up to 32 nodes on the same cluster, according to Microsoft best practices it is advisable to create clusters of maximum 8 nodes.

The NLB feature relies on network-level distribution, one of the limitations of this solution is that the heatbeats tests monitor whether the hosts are online and not the service. If the web service of one of the hosts is non-functional but the host responds to the HB, requests will be sent to the host.

Representation of an NLB cluster in monodiffussion :

Cluster NLB

Prerequisites

Setting up a Network Load Balancing Cluster you need:

  • At least two servers with the same service installed (for this lab I used two IIS web servers) and two network cards. A card will be for server management and a dedicated NLB cluster card. If the NLB cluster is configured in Multidiffussion it is not necessary to have two network cards.
  • At least 3 IPs: 1 IP for the cluster that will be virtual and an IP address for each node

If your servers are under Hyper-V, you must activate the MAC address spoofing on network adapters dedicated to the NLB cluster.

Hyper-v carte reseau

Modes of transmission

Unicast: the default mode, it will disable the MAC address of the network card and replace it with an identical virtual address on all nodes.

Multicast: recommended mode, it can be used with one or more network cards. With this mode, the network adapter will have two MAC addresses, the one on the network adapter and the virtual MAC address of the cluster.

Installing NLB


The installation of the Network Load Balancing feature is to be done on each node of the cluster.

PowerShell

1. Open a PowerShell command prompt as an administrator and enter the following command to install the NLB role and administrative tools:

Install-WindowsFeature NLB,RSAT-NLB

2. Wait during the installation.

Installation en cours 2/2

3. Installation completed, close the PowerShell window.

Installation terminée

Graphic mode

1. From the server manager, click Manage 1 / Add Roles and Features 2.

Gestionnaire de serveur

2. When launching the wizard, click Next 1.

Assistant installation

3. Type of installation, choose Role-based or feature-based installation 1 and click Next 2.

Type d'installation

4. Select the server 1 where NLB should be installed and click Next 2.

Choix du serveur

5. When selecting roles, click Next 1.

Rôles serveur

6. Features: Check Network Load Balancing 1.

Fonctionnalité NLB

7. Click Add Features 1 to confirm the addition of dependencies.

Ajout des dependances

8. Click Next 1.

Fonctionnalité

9. Confirm the installation by clicking Install 1.

Confirmer l'installation

10. Wait during the installation …

Installation en cours 1/2

11. Installation completed, exit the wizard by clicking Close 1.

Installation terminée

Unicast configuration

Setting up unicast network cards

The following operations are to be done on each server that will compose the cluster, the IP addresses are to be adapted according to your configuration.

1. Open the network connections and identify the cards.

Connexions réseaux

2. Go to the properties of the TCP / IPV4 protocol of the NLB network card and set its address 1 without setting Default Gateway and DNS server and click on Advanced … 2.

Parametrage IPv4

3. Go to the DNS 1 tab, uncheck the box 2 Save the addresses of this connection in the DNS system and click on OK 3 to validate the parameters.

Parametres avances

4. Click OK to validate the IP address of the card.

Cluster creation

In this part, we will create the NLB cluster, which will initially consist of a single node.

1. Open the administration console.

NLB

2. Right-click Network Load Balancing Clusters and click New Cluster 1.

Nouveau cluster

3. Enter the name of Host 1 and click on Connection 2.

Entrer le nom d'un hote

4. Select the interface dedicated to cluster 1 and click Next 2.

Sélectionner interface NLB

5. Click Next 1.

Valider la config IP

6. Click Add 1 to set a virtual address to the cluster.

Ajouter une IP au cluster

7. Enter the IPv4 Address and Subnet Mask 1 of the cluster and click OK 2.

Configuration IP du cluster

8. Click Next 1.

Valider l'adresse

9. Enter the cluster name fqdn 1, select Unicast 2 and click Next 3.

Configuration du cluster

10. Click Edit … 1.

Aller aux paramètres avances

11. From this window it is possible to configure the cluster behavior:

Parametre avances du cluster
  • Define the ports used
  • Multiple Host (Active / Active) or Single Host (Active / Passive)
  • Affinity:
    • None: The connection will be sent to the host with the least connection, to use if no session is managed behind.
    • Unique: The connection will always be sent to the same host (recommended)
    • Network: Ability to manage the distribution according to the source network.

click OK or Cancel to close the window.

12. Click Finish 1 to create the cluster.

Terminer la configuration

13. The cluster is being configured 1.

Création en cours

14. The node has changed to green 1, the NLB cluster is functional.

Cluster operationel

Configuration in Multicast mode

Multicast mode makes it possible to use hosts with only one network card and broadcast on the network.

Cluster creation

1. From the console, right-click Network Load Balancing Cluster 1 and click New Cluster 2 .

add cluster nlb

2. Enter the ip of node 1 and click on Connection 2 .

ip server

3. Once connected, select interface 1 and click Next 2 .

Select network card

4. Click Next 1 .

parameters of the host

5. Click Add 1 to declare the IP address of the cluster.

add IP

6. Enter the IP address 1 with the subnet mask 2 and click OK 3 .

Configuring the IP address

7. The added IP address 1 , click Next 2 .

IP added

8. Enter the DNS name of cluster 1 , select Multicast mode 2 and click Next 3 .

Cluster Configuration

9. Configure port, by default all traffic is listened to. Click Finish 1 to create the cluster.

End of the cluster configuration

10. Wait while creating and configuring the NLB cluster.

Creation in progress

11. The cluster is created and the active node 1 .

Cluster created

Adding a node to the cluster

1. From the Administration Console, right-click cluster 1 and click Add Host to Cluster 2.

Ajouter un noeud

2. Enter the IP or Host Name 1 and click on Connection 2.

IP ou Nom de l hote

3. Select the NLB 1 interface and click Next 2.

Selectionner l interface reseau

4. Click Next 1.

Valider la configuration IP

5. Click Finish 1.

Confirmer la configuration

6. Waiting during Host 1 enters the cluster.

Ajout de l hote en cours...

7. Both hosts are green 1.

Hote ajoute au cluster

You now have a highly available solution. To test from an IIS solution, simply put two different indexes on the sites and load the web page from different client.




Leave a Comment