Jesin's Blog

Welcome to the Portal of Technology

  • Facebook
  • GitHub
  • RSS
  • Twitter
  • Home
  • Categories
    • Domains
    • Linux
    • Networking
    • PHP
    • Virtualization
    • Web Design
    • Web Servers
    • Windows
  • WordPress Plugins
    • Custom Error Pages
    • HTTP Digest Authentication
    • Mailgun Email Validator
  • Toolbox
    • DNS Lookup Tool
    • htdigest Generator Tool Online
    • htpasswd Generator Tool Online
    • HTTP Headers Lookup Tool
    • MD5 Encryption Tool
    • Open Port Check Tool
    • SHA-1 Encryption Tool
    • URL Encoding/Decoding Tool
  • About Me
  • Contact Me
  • Sitemap
Home ›
Windows ›
Setting up Network Load Balancing (Single Network Adapter)

Setting up Network Load Balancing (Single Network Adapter)

September 1, 2010 Windows Jesin A 5 Comments

windows category thumbnail

Network load balancing is an excellent feature of the Microsoft Server Family operating systems. It allows the setup to make use of a single IP address to balance the load between two or more machine. In this article I’ll explain step by step on how to setup network load balancing on Windows Server 2003 using a single network adapter. For testing whether this configuration works I’ve setup IIS (Internet Information Services) but testing can also be done some other way.

The basic requirements for setting up Network Load Balancing:-

  • Two or more servers running the same service (e.g. IIS)
  • Both the servers should have a Windows Server Operating System installed.
  • IIS should be installed and running on both the servers.
  • The IP addresses for both the servers should be static i.e. manually assigned (DHCP should not be used)

For this article I’ve used two servers running IIS on Windows Server 2003 and one client with Windows 7. The following diagram will make things clear

network load balancing single nic diagram
This the network setup of computers used in this article

Step 1:- Setting up IIS on both servers

The first step is to ensure IIS is setup and running on both the windows servers. To install IIS go to control panel -> Add/Remove Programs -> Add/Remove Windows components -> select Application server, click details and tick Internet Information Services (IIS). Click OK then Next. Installation will start now and prompt you for the Windows Server 2003 OS CD. After installation go to C:\Inetpub\wwwroot create a file named default.htm. Type the following html code into that file

<html>
<body>
<h1>This is Server 1</h1>
</body>
</html>

Do the same in your second server also but while creating the default.htm file replace the word “server 1” with “server 2” so that the difference is noticeable when running load balancing.

Test whether both the IIS servers are functioning properly. To check this fire up your browser on both machines and type http://localhost/ you should see the following page

network-load-balancing-iis-testing
Check whether IIS works on both the servers

Now that IIS is up and running its time to configure IP addresses on both servers.

Step 2:- Configure IP addresses

Go to server 1 Control Panel -> Network Connections -> Right-click Local Area Connection -> Properties. Select Internet Protocol (TCP/IP) -> Properties and manually assign IP addresses as follows

IP address: 192.168.0.2
Subnet Mask: 255.255.255.0

You can also enter your gateway address (usually the modem or router) and DNS address. But in the setup I’m doing it isn’t required.

Now go to server 2 Control Panel -> Network Connections -> Right-click Local Area Connection -> Properties. Select Internet Protocol (TCP/IP) -> Properties and manually assign IP addresses as follows

IP address: 192.168.0.3
Subnet Mask: 255.255.255.0

Finally assign the client computer an IP address in the same range i.e. 192.168.0.x (x is between 4 to 254)

Step 3:- Configure Load Balancing IP address

This is that crucial step in setting up network load balancing and if it isn’t done properly will end up with a non-working configuration.

Server 1:-

Open the Local Area Connection’s properties of server 1, tick Network Load Balancing option, go to properties. Under cluster parameters enter the following in cluster IP configuration

IP address: 192.168.0.10 (This is the virtual IP address)
Subnet Mask: 255.255.255.0
Full Internet Name: cluster.domain.com (Enter your domain name associated with the cluster. If you have not registered any domain name or wish to use the IP address itself leave it blank)

Next under the Cluster Operation mode select Unicast or Multicast. So what is the difference between the two ?

When unicast is selected all the hosts (computers) in a cluster share an identical unicast MAC address. Network Load Balancing overwrites the original MAC address of the cluster adapter with the unicast MAC address that is assigned to all the cluster hosts.

When multicast is selected the original MAC address is retained by each host in the cluster.

So what should you select ? In this configuration multicast should be selected, because is unicast is selected peer-to-peer communication between the cluster hosts is not possible as an identical MAC address is assigned to all network adapters. This limitation can be overcome by using multiple network Adapters.

Under the host parameters tab set the priority as 1 and under Dedicated IP configuration enter the IP address of server 1.

IP address: 192.168.0.2
Subnet Mask: 255.255.255.0

So with the Network Load Balancing Properties done press OK. Now is the most important step, assigning the IP to the adapter. Go to the Internet Protocol (TCP/IP) properties and click advanced, under the IP settings tab click Add and enter the cluster‘s IP address.

network load balancing cluster ip
Assign the IP address and the subnet mask of the cluster

Click OK thrice and the configuration for server 1 is over.

Server 2:-

The configuration is same as server 1 except for a few changes

  1. Under host parameter in Network Load Balancing properties set the priority as 2.
  2. Enter the same cluster IP address (192.168.0.10) under cluster parameters.
  3. In the dedicated IP configuration enter the IP address as 192.168.0.3
  4. Enter the IP address of the cluster (192.168.0.10) under the IP addresses in the Advanced TCP/IP settings.

Click OK thrice. Now its time to check whether the IP addresses have been correctly assigned. Go to the command prompt of both the servers and type ipconfig /all and you’ll a screen like this

network load balancing ipconfig
Check the IP addresses of both servers by using the ipconfig /all command

If everything is correct move on to the next step which is testing the configuration.

Step 4:- Testing the setup

So its time to test whether it works, so go to the client system open the web browser and type the cluster IP address http://192.168.0.10/ and you’ll see the web page stored in Server 1

network load balancing server 1 iis
Server 1 has more priority so the webpage stored in server1 is displayed

To check server 2 disable the network adapter of server 1 (Control Panel -> Network Connections -> Right-click Local Area Connection and click disable) refresh the web browser on the client and viola! you see the web page stored in Server 2

network load balancing server 2 iis
Disabling Server1's network adapter displays the webpage in Server2

Now even if you enable server 1’s network adapter you’ll still see server 2’s content. To get back to server 1 disable server 2’s network adapter and refresh the web browser.

Thats it you’ve successfully configured network load balancing using a single network adapter. You can add any number of hosts to this cluster by editing their network adapter’s Network Load Balancing settings.

Related posts:

linux category thumbnailConfigure Apache Web Server Load Balancing virtualization category thumbnailAdding Custom Network Adapter in VMware Player virtualization category thumbnailComponents of VMware Network virtualization category thumbnailUsing VMware Network Editor (vmnetcfg.exe) windows category thumbnailSetting up an authoritative DNS in Windows Server 2008

Tags: iis, NLB, windows server

Comments

  1. jahir shaikh says

    August 22, 2011 at 1:27 pm

    realy good and delpy understandable tutorial.
    thank you

    Reply
  2. pravesh sharda says

    February 10, 2012 at 1:12 pm

    Excelent Blog. very useful.

    thx

    with Regards
    Pravesh sharda

    Reply
  3. Ramya says

    January 9, 2014 at 2:17 pm

    Clearly Understandable good one

    Reply
  4. Alan Jebakumar says

    May 21, 2014 at 2:42 pm

    Hi Jesin, This is a very good articles, which makes readers to understand NLB. It’d be more nice if you had included some more snapshots of the NLB configuration.

    Anyways nice one.
    -Alan.

    Reply
  5. Keneth says

    August 1, 2015 at 5:31 am

    This the best ever article for Network Load balancing. Thanks so much. Please i also need some help on clustering steps using cluster administrator in server 2003

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Get a wealth of information delivered to your inbox. Subscribe and never miss a single article.

  • Tutorials and howtos
  • Code, scripts and commands
  • Online Tools

* No spam, unsubscribe anytime

Hire Me

  • SSL installation and hardening (A+ on Qualys SSL test)
  • Apache & Nginx configuration
  • Email deliverability improvement (10/10 on Mail Tester & MailGenius)
  • WordPress customization, optimization and migration
  • and much more…

    Tools

    • DNS Lookup Tool
    • htdigest Generator Tool Online
    • htpasswd Generator Tool Online
    • HTTP Headers Lookup Tool
    • MD5 Encryption Tool
    • Open Port Check Tool
    • SHA-1 Encryption Tool
    • URL Encoding/Decoding Tool

    Nav

    • Home
    • About Me
    • Contact Me
    • Privacy Policy
    • Sitemap
    Vultr SSD VPS

    Creative Commons License
    Jesin's Blog by Jesin A is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
    Based on a work at websistent.com.